# New Ticket Created by  Lars Balker Rasmussen 
# Please include the string:  [perl #23027]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=23027 >


I've added a way to add or remove options on a per-c-file basis.

Right now all it does is make sure that tsq.c won't be affected by
Configure.pl --optimize, and that the amounts of silly warnings is
reduced (by removing -Wformat-nonliteral on files we know use that
feature..), as well as removing a couple of sparc-specific(?) VERY
noisy warnings. On top of this, the Makefile rewrite hack for imcc
has been eliminated.

As of now there is no documentation of the system, but I hope it's
fairly straightforward - let me know.
-- 
Lars Balker Rasmussen                                      Consult::Perl



-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/61200/45201/a968a4/cflags.diff

-- attachment  2 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/61200/45202/4388b7/cflags.tar.gz

? cflags.diff
? t.tar
? config/gen/cflags
? config/gen/cflags.pl
? tools/dev/cc_flags.pl
Index: .cvsignore
===================================================================
RCS file: /cvs/public/parrot/.cvsignore,v
retrieving revision 1.27
diff -u -a -r1.27 .cvsignore
--- .cvsignore	14 Jul 2003 22:31:21 -0000	1.27
+++ .cvsignore	17 Jul 2003 20:00:48 -0000
@@ -26,3 +26,4 @@
 test
 nci.c
 test_main
+CFLAGS
Index: config/gen/makefiles.pl
===================================================================
RCS file: /cvs/public/parrot/config/gen/makefiles.pl,v
retrieving revision 1.15
diff -u -a -r1.15 makefiles.pl
--- config/gen/makefiles.pl	12 Mar 2003 09:51:17 -0000	1.15
+++ config/gen/makefiles.pl	17 Jul 2003 20:00:48 -0000
@@ -33,16 +33,6 @@
           commentType => '#');
   genfile('config/gen/makefiles/ook.in',       'languages/ook/Makefile',
           commentType => '#');
-
-  # Change compiler flags in IMCC's makefile using inplace edit.
-  my $PQ   = Configure::Data->get('PQ');
-  my $imcc = 'languages/imcc/Makefile';
-  my $pgm  = ' s/ -Wwrite-strings//;'
-           . ' s/ -Wcast-qual//;'
-           . ' s/ -Wno-unused/ -Wunused/;';
-  system "$^X -pi.bak -e$PQ$pgm$PQ $imcc" and warn;
-  unlink "$imcc.bak" or warn;
-
 }
 
 1;
Index: config/gen/makefiles/imcc.in
===================================================================
RCS file: /cvs/public/parrot/config/gen/makefiles/imcc.in,v
retrieving revision 1.24
diff -u -a -r1.24 imcc.in
--- config/gen/makefiles/imcc.in	8 Jul 2003 08:09:30 -0000	1.24
+++ config/gen/makefiles/imcc.in	17 Jul 2003 20:00:48 -0000
@@ -64,7 +64,7 @@
 	$(TOUCH) imcc.l.flag imclexer.c
 
 .c$(O):
-	$(CC) $(CFLAGS) ${cc_exe_out}$@ -c $<
+	@$(PERL) ../../tools/dev/cc_flags.pl ./CFLAGS $(CC) $(CFLAGS) ${cc_exe_out}$@ -c $<
 
 $(IMCC_O_FILES) : $(H_FILES)
 
Index: config/gen/makefiles/root.in
===================================================================
RCS file: /cvs/public/parrot/config/gen/makefiles/root.in,v
retrieving revision 1.94
diff -u -a -r1.94 root.in
--- config/gen/makefiles/root.in	16 Jul 2003 12:53:06 -0000	1.94
+++ config/gen/makefiles/root.in	17 Jul 2003 20:00:48 -0000
@@ -43,7 +43,8 @@
 	include/parrot/has_header.h \
 	include/parrot/feature.h \
 	lib/Parrot/Config.pm lib/Parrot/PMC.pm platform.c \
-	include/parrot/core_pmcs.h core_pmcs.c
+	include/parrot/core_pmcs.h core_pmcs.c \
+	CFLAGS languages/imcc/CFLAGS
 
 STICKY_FILES = $(GEN_CONFIGS) $(GEN_MAKEFILES) myconfig
 
@@ -192,7 +193,7 @@
 ${make_set_make}
 
 .c$(O) :
-	$(CC) $(CFLAGS) ${cc_o_out}$@ -c $<
+	@$(PERL) tools/dev/cc_flags.pl ./CFLAGS $(CC) $(CFLAGS) ${cc_o_out}$@ -c $<
 
 all : $(TEST_PROG) $(IMCC_PROG) docs
 
Index: languages/imcc/.cvsignore
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/.cvsignore,v
retrieving revision 1.6
diff -u -a -r1.6 .cvsignore
--- languages/imcc/.cvsignore	30 May 2003 05:06:06 -0000	1.6
+++ languages/imcc/.cvsignore	17 Jul 2003 20:00:49 -0000
@@ -6,3 +6,4 @@
 Makefile
 *.tmp
 *.flag
+CFLAGS
Index: lib/Parrot/Configure/RunSteps.pm
===================================================================
RCS file: /cvs/public/parrot/lib/Parrot/Configure/RunSteps.pm,v
retrieving revision 1.22
diff -u -a -r1.22 RunSteps.pm
--- lib/Parrot/Configure/RunSteps.pm	14 Jul 2003 07:58:26 -0000	1.22
+++ lib/Parrot/Configure/RunSteps.pm	17 Jul 2003 20:00:49 -0000
@@ -35,6 +35,7 @@
 	gen/feature_h.pl
 	gen/config_pm.pl
 	gen/makefiles.pl
+	gen/cflags.pl
 	gen/myconfig.pl
 	gen/platform.pl
 	gen/libparrot_def.pl

Attachment: cflags.tar.gz
Description: cflags.tar.gz

Reply via email to