public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* housekeeping, -Wno-error
@ 2005-04-12  2:51 Alan Modra
  2005-04-12  2:54 ` Daniel Jacobowitz
  2005-04-12  4:36 ` H. J. Lu
  0 siblings, 2 replies; 8+ messages in thread
From: Alan Modra @ 2005-04-12  2:51 UTC (permalink / raw)
  To: binutils

Adds -Wno-error when compiling yacc/lex generated files, and other
housekeeping.

bfd/
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* libcoff.h: Regenerate.
bfd/doc/
	* Makefile.in: Regenerate.
binutils/
	* Makefile.am: Run "make dep-am".
	(syslex.o, sysinfo.o, arparse.o, arlex.o): Add -Wno-error to command.
	(sysroff.o, defparse.o, deflex.o): Likewise.
	(nlmheader.o, rcparse.o, rclex.o): Likewise.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* config.in: Regenerate.
	* configure: Regenerate.
gas/
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
ld/
	* Makefile.am: Run "make dep-am".
	(ldgram.o, ldlex.o, deffilep.o): Add -Wno-error to command.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.

Index: binutils/Makefile.am
===================================================================
RCS file: /cvs/src/src/binutils/Makefile.am,v
retrieving revision 1.55
diff -u -p -r1.55 Makefile.am
--- binutils/Makefile.am	22 Feb 2005 12:57:26 -0000	1.55
+++ binutils/Makefile.am	12 Apr 2005 01:59:11 -0000
@@ -223,16 +223,16 @@ sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o sy
 
 syslex.o:
 	if [ -r syslex.c ]; then \
-	  $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS)  syslex.c  ; \
+	  $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) syslex.c -Wno-error ; \
 	else \
-	  $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS) $(srcdir)/syslex.c ;\
+	  $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS) $(srcdir)/syslex.c -Wno-error ;\
 	fi
 
 sysinfo.o:
 	if [ -r sysinfo.c ]; then \
-	  $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS)  sysinfo.c  ; \
+	  $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) sysinfo.c -Wno-error ; \
 	else \
-	  $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) $(srcdir)/sysinfo.c ; \
+	  $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) $(srcdir)/sysinfo.c -Wno-error ; \
 	fi
 
 # We need these for parallel make.
@@ -242,6 +242,25 @@ nlmheader.h: nlmheader.c
 rcparse.h: rcparse.c
 sysinfo.h: sysinfo.c
 
+# Disable -Werror, if it has been enabled, since old versions of bison/
+# yacc will produce working code which contain compile time warnings. 
+arparse.o:
+	$(COMPILE) -c $< -Wno-error
+arlex.o:
+	$(COMPILE) -c $< -Wno-error
+sysroff.o:
+	$(COMPILE) -c $< -Wno-error
+defparse.o:
+	$(COMPILE) -c $< -Wno-error
+deflex.o:
+	$(COMPILE) -c $< -Wno-error
+nlmheader.o:
+	$(COMPILE) -c $< -Wno-error
+rcparse.o:
+	$(COMPILE) -c $< -Wno-error
+rclex.o:
+	$(COMPILE) -c $< -Wno-error
+
 srconv_SOURCES = srconv.c coffgrok.c $(BULIBS)
 
 dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS)
@@ -363,15 +382,15 @@ install-exec-local: install-binPROGRAMS 
 
 # DO NOT DELETE THIS LINE -- mkdep uses it.
 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-addr2line.o: addr2line.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+addr2line.o: addr2line.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/symcat.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h \
-  $(INCDIR)/demangle.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
+  $(INCDIR)/demangle.h bucomm.h $(INCDIR)/bin-bugs.h \
   $(INCDIR)/fopen-same.h budemang.h
 ar.o: ar.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
   $(INCDIR)/libiberty.h $(INCDIR)/progress.h bucomm.h \
   config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
-  $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h arsup.h $(INCDIR)/filenames.h \
-  binemul.h
+  $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h \
+  arsup.h $(INCDIR)/filenames.h binemul.h
 arsup.o: arsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/symcat.h arsup.h $(INCDIR)/libiberty.h bucomm.h \
   config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
@@ -382,7 +401,7 @@ binemul.o: binemul.c binemul.h ../bfd/bf
 bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/symcat.h ../bfd/bfdver.h $(INCDIR)/libiberty.h \
   bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
-  $(INCDIR)/filenames.h $(BFDDIR)/libbfd.h
+  $(INCDIR)/filenames.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h
 budemang.o: budemang.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \
   budemang.h
Index: gas/Makefile.am
===================================================================
RCS file: /cvs/src/src/gas/Makefile.am,v
retrieving revision 1.104
diff -u -p -r1.104 Makefile.am
--- gas/Makefile.am	21 Mar 2005 15:35:30 -0000	1.104
+++ gas/Makefile.am	12 Apr 2005 01:59:29 -0000
@@ -995,13 +995,13 @@ DEPTC_a29k_elf = $(INCDIR)/symcat.h $(sr
 DEPTC_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
   $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \
   $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
-  struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/safe-ctype.h \
-  $(srcdir)/config/atof-vax.c
+  struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \
+  $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c
 DEPTC_alpha_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \
   $(srcdir)/config/tc-alpha.h ecoff.h $(INCDIR)/coff/sym.h \
   $(INCDIR)/coff/ecoff.h subsegs.h $(INCDIR)/obstack.h \
-  struc-symbol.h $(INCDIR)/opcode/alpha.h $(INCDIR)/safe-ctype.h \
-  $(srcdir)/config/atof-vax.c
+  struc-symbol.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \
+  $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c
 DEPTC_alpha_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
   $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h \
@@ -1012,8 +1012,8 @@ DEPTC_alpha_elf = $(INCDIR)/symcat.h $(s
   $(srcdir)/config/atof-vax.c
 DEPTC_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \
   $(srcdir)/config/tc-alpha.h subsegs.h $(INCDIR)/obstack.h \
-  struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/safe-ctype.h \
-  $(srcdir)/config/atof-vax.c
+  struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h dw2gencfi.h \
+  $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c
 DEPTC_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
   $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \
   $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \
@@ -1113,13 +1113,15 @@ DEPTC_frv_coff = $(INCDIR)/symcat.h $(sr
   $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
   $(srcdir)/../opcodes/frv-desc.h $(INCDIR)/opcode/cgen.h \
   $(srcdir)/../opcodes/frv-opc.h cgen.h $(BFDDIR)/libbfd.h \
-  $(INCDIR)/elf/common.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h
+  $(INCDIR)/hashtab.h $(INCDIR)/elf/common.h $(INCDIR)/elf/frv.h \
+  $(INCDIR)/elf/reloc-macros.h
 DEPTC_frv_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
   $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h \
   subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \
   $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/frv-opc.h \
-  cgen.h $(BFDDIR)/libbfd.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h
+  cgen.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h $(INCDIR)/elf/frv.h \
+  $(INCDIR)/elf/reloc-macros.h
 DEPTC_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
   $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \
@@ -1209,14 +1211,15 @@ DEPTC_ip2k_coff = $(INCDIR)/symcat.h $(s
   $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
   $(srcdir)/../opcodes/ip2k-desc.h $(INCDIR)/opcode/cgen.h \
   $(srcdir)/../opcodes/ip2k-opc.h cgen.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h
+  $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h \
+  $(INCDIR)/hashtab.h
 DEPTC_ip2k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
   $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \
   subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/ip2k-desc.h \
   $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/ip2k-opc.h \
   cgen.h $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h \
-  $(BFDDIR)/libbfd.h
+  $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h
 DEPTC_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
   $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \
   $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
@@ -1289,24 +1292,26 @@ DEPTC_mips_coff = $(INCDIR)/symcat.h $(s
   $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \
   $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
-  $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h $(srcdir)/config/obj-elf.h \
-  $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
-  $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
-  ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
+  $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h \
+  $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h ecoff.h \
+  $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
 DEPTC_mips_ecoff = $(INCDIR)/symcat.h $(srcdir)/config/obj-ecoff.h \
   $(srcdir)/config/tc-mips.h ecoff.h $(INCDIR)/coff/sym.h \
   $(INCDIR)/coff/ecoff.h subsegs.h $(INCDIR)/obstack.h \
   $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/mips.h itbl-ops.h \
-  dwarf2dbg.h $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
-  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
-  $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h
+  dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h \
+  $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+  $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h \
+  $(INCDIR)/elf/reloc-macros.h
 DEPTC_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
   $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h \
   subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
-  $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/mips.h \
-  $(INCDIR)/elf/reloc-macros.h ecoff.h $(INCDIR)/coff/sym.h \
-  $(INCDIR)/coff/ecoff.h
+  $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h \
+  $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
+  ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
 DEPTC_mmix_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
   $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \
Index: ld/Makefile.am
===================================================================
RCS file: /cvs/src/src/ld/Makefile.am,v
retrieving revision 1.170
diff -u -p -r1.170 Makefile.am
--- ld/Makefile.am	11 Mar 2005 19:55:36 -0000	1.170
+++ ld/Makefile.am	12 Apr 2005 01:59:42 -0000
@@ -417,6 +417,15 @@ OFILES = ldgram.o ldlex.o lexsup.o ldlan
 
 STAGESTUFF = *.o ldscripts/* e*.c
 
+# Disable -Werror, if it has been enabled, since old versions of bison/
+# yacc will produce working code which contain compile time warnings. 
+ldgram.o:
+	$(COMPILE) -c $< -Wno-error
+ldlex.o:
+	$(COMPILE) -c $< -Wno-error
+deffilep.o:
+	$(COMPILE) -c $< -Wno-error
+
 # At the moment this is just a list of those emulation template files
 # that contain internationalised strings.
 EMULATION_FILES = emultempl/pe.em emultempl/armcoff.em
@@ -1739,8 +1748,8 @@ ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR
   $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h ld.h $(INCDIR)/bin-bugs.h \
   ldexp.h ldlang.h ldmisc.h ldgram.h ldmain.h ldctor.h
-ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
-  $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
+ldemul.o: ldemul.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+  $(INCDIR)/symcat.h sysdep.h $(INCDIR)/fopen-same.h \
   ld.h $(INCDIR)/bin-bugs.h ldmisc.h ldexp.h ldlang.h \
   ldfile.h ldemul.h ldmain.h ldemul-list.h
 ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
@@ -1781,8 +1790,8 @@ ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCD
   $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \
   ld.h $(INCDIR)/bin-bugs.h ldexp.h ldlang.h ldwrite.h \
   ldmisc.h ldgram.h ldmain.h
-lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
-  $(INCDIR)/symcat.h sysdep.h config.h $(INCDIR)/fopen-same.h \
+lexsup.o: lexsup.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
+  $(INCDIR)/symcat.h sysdep.h $(INCDIR)/fopen-same.h \
   $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h \
   ld.h $(INCDIR)/bin-bugs.h ldmain.h ldmisc.h ldexp.h \
   ldlang.h ldgram.h ldlex.h ldfile.h ldver.h ldemul.h \

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: housekeeping, -Wno-error
  2005-04-12  2:51 housekeeping, -Wno-error Alan Modra
@ 2005-04-12  2:54 ` Daniel Jacobowitz
  2005-04-12  4:36 ` H. J. Lu
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2005-04-12  2:54 UTC (permalink / raw)
  To: binutils

On Tue, Apr 12, 2005 at 12:20:55PM +0930, Alan Modra wrote:
> Adds -Wno-error when compiling yacc/lex generated files, and other
> housekeeping.

Thanks!


-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: housekeeping, -Wno-error
  2005-04-12  2:51 housekeeping, -Wno-error Alan Modra
  2005-04-12  2:54 ` Daniel Jacobowitz
@ 2005-04-12  4:36 ` H. J. Lu
  2005-04-12  5:42   ` Alan Modra
  1 sibling, 1 reply; 8+ messages in thread
From: H. J. Lu @ 2005-04-12  4:36 UTC (permalink / raw)
  To: binutils

On Tue, Apr 12, 2005 at 12:20:55PM +0930, Alan Modra wrote:
> Adds -Wno-error when compiling yacc/lex generated files, and other
> housekeeping.
> 
> bfd/
> 	* Makefile.am: Run "make dep-am".
> 	* Makefile.in: Regenerate.
> 	* aclocal.m4: Regenerate.
> 	* libcoff.h: Regenerate.
> bfd/doc/
> 	* Makefile.in: Regenerate.
> binutils/
> 	* Makefile.am: Run "make dep-am".
> 	(syslex.o, sysinfo.o, arparse.o, arlex.o): Add -Wno-error to command.

Are we assuming that gcc is the only supported compiler for binutils?


H.J.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: housekeeping, -Wno-error
  2005-04-12  4:36 ` H. J. Lu
@ 2005-04-12  5:42   ` Alan Modra
  2005-04-12  8:37     ` Nick Clifton
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Modra @ 2005-04-12  5:42 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Mon, Apr 11, 2005 at 09:36:21PM -0700, H. J. Lu wrote:
> On Tue, Apr 12, 2005 at 12:20:55PM +0930, Alan Modra wrote:
> > Adds -Wno-error when compiling yacc/lex generated files, and other
> > housekeeping.
> 
> Are we assuming that gcc is the only supported compiler for binutils?

Good question.  I hadn't even thought about that, just followed Nick's
lead with -Wno-error in gas/.  -W{no-,}error probably ought to only
happen by default for gcc.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: housekeeping, -Wno-error
  2005-04-12  5:42   ` Alan Modra
@ 2005-04-12  8:37     ` Nick Clifton
  2005-04-12 11:41       ` Alan Modra
  0 siblings, 1 reply; 8+ messages in thread
From: Nick Clifton @ 2005-04-12  8:37 UTC (permalink / raw)
  To: Alan Modra; +Cc: H. J. Lu, binutils

Hi Alan,

>>Are we assuming that gcc is the only supported compiler for binutils?

> Good question.  I hadn't even thought about that, just followed Nick's
> lead with -Wno-error in gas/.  -W{no-,}error probably ought to only
> happen by default for gcc.

Actually I was waiting for Maciej's patch to fix this problem in the 
configure files.  In the meantime however I was about to apply a 
Makefile based patch like this:

+ # Disable -Werror, if it has been enabled, when building generated C 
source
+ # files since old versions of bison & yacc will produce working code which
+ # contain compile time warnings.
+ GENERATED_OFILES := $(GENERATED_CFILES:.c=.o)
+ NO_WERROR_COMPILE = $(COMPILE:Werror=Wno-error)
+ $(GENERATED_OFILES):
+       $(NO_WERROR_COMPILE) -c `basename $@ .o`.c
+

Which does not depend upon the host compiler being GCC.  My bad for not 
applying this patch sooner.  Ideally the configure based solution would 
be best since it could check for known good versions of bison/yacc/flex 
etc and keep -Werror enabled for them.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: housekeeping, -Wno-error
  2005-04-12  8:37     ` Nick Clifton
@ 2005-04-12 11:41       ` Alan Modra
  2005-04-13 15:35         ` Nick Clifton
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Modra @ 2005-04-12 11:41 UTC (permalink / raw)
  To: Nick Clifton; +Cc: H. J. Lu, binutils

On Tue, Apr 12, 2005 at 09:35:44AM +0100, Nick Clifton wrote:
> configure files.  In the meantime however I was about to apply a 
> Makefile based patch like this:

I've been playing with the following, along with Makefile.am changes
to use $(NO_WERROR) in place of -Wno-error.  The idea is to put this
some place so that all the configure.in can use a common definition
for warnings.  I've changed it so that --enable-werror and
--enable-build-warnings should be usable with compilers other than
gcc.

AC_DEFUN([AM_BINUTILS_WARNINGS],[
WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"

AC_ARG_ENABLE(werror,
  [  --enable-werror    treat compile warnings as errors],
  [case "${enableval}" in
     yes | y) ERROR_ON_WARNING="yes" ;;
     no | n)  ERROR_ON_WARNING="no" ;;
     *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
   esac])

# Enable -Werror by default when using gcc
if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
    ERROR_ON_WARNING=yes
fi

NO_WERROR=
if test "${ERROR_ON_WARNING}" = yes ; then
    WARN_CFLAGS="$WARN_CFLAGS -Werror"
    NO_WERROR="-Wno-error"
fi
		   
AC_ARG_ENABLE(build-warnings,
[  --enable-build-warnings Enable build-time compiler warnings],
[case "${enableval}" in
  yes)	;;
  no)	WARN_CFLAGS="-w";;
  ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
        WARN_CFLAGS="${WARN_CFLAGS} ${t}";;
  *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
        WARN_CFLAGS="${t} ${WARN_CFLAGS}";;
  *)    WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;;
esac])

if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then
  echo "Setting warning flags = $WARN_CFLAGS" 6>&1
fi

AC_SUBST(WARN_CFLAGS)
AC_SUBST(NO_WERROR)
])


-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: housekeeping, -Wno-error
  2005-04-12 11:41       ` Alan Modra
@ 2005-04-13 15:35         ` Nick Clifton
  2005-04-14  5:29           ` Alan Modra
  0 siblings, 1 reply; 8+ messages in thread
From: Nick Clifton @ 2005-04-13 15:35 UTC (permalink / raw)
  To: Alan Modra; +Cc: H. J. Lu, binutils

Hi Alan,

> I've been playing with the following, along with Makefile.am changes
> to use $(NO_WERROR) in place of -Wno-error.  The idea is to put this
> some place so that all the configure.in can use a common definition
> for warnings.  I've changed it so that --enable-werror and
> --enable-build-warnings should be usable with compilers other than
> gcc.
> 
> AC_DEFUN([AM_BINUTILS_WARNINGS],[
> WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
> 
> AC_ARG_ENABLE(werror,
>   [  --enable-werror    treat compile warnings as errors],
>   [case "${enableval}" in
>      yes | y) ERROR_ON_WARNING="yes" ;;
>      no | n)  ERROR_ON_WARNING="no" ;;
>      *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
>    esac])
> 
> # Enable -Werror by default when using gcc
> if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
>     ERROR_ON_WARNING=yes
> fi
> 
> NO_WERROR=
> if test "${ERROR_ON_WARNING}" = yes ; then
>     WARN_CFLAGS="$WARN_CFLAGS -Werror"
>     NO_WERROR="-Wno-error"
> fi
> 		   
> AC_ARG_ENABLE(build-warnings,
> [  --enable-build-warnings Enable build-time compiler warnings],
> [case "${enableval}" in
>   yes)	;;
>   no)	WARN_CFLAGS="-w";;
>   ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
>         WARN_CFLAGS="${WARN_CFLAGS} ${t}";;
>   *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
>         WARN_CFLAGS="${t} ${WARN_CFLAGS}";;
>   *)    WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;;
> esac])
> 
> if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then
>   echo "Setting warning flags = $WARN_CFLAGS" 6>&1
> fi
> 
> AC_SUBST(WARN_CFLAGS)
> AC_SUBST(NO_WERROR)
> ])

This seems like a very good approach.  Would you consider applying it to 
the relevant Makefile.am(s) please ?

Cheers
   Nick


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: housekeeping, -Wno-error
  2005-04-13 15:35         ` Nick Clifton
@ 2005-04-14  5:29           ` Alan Modra
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Modra @ 2005-04-14  5:29 UTC (permalink / raw)
  To: binutils

On Wed, Apr 13, 2005 at 04:33:25PM +0100, Nick Clifton wrote:
> This seems like a very good approach.  Would you consider applying it to 
> the relevant Makefile.am(s) please ?

Done.  The thing that was stopping me from committing was not being able
to use ../bfd/warning.m4 in binutils/ and ld/, which both still use the
old 2.13 autotools.  I eventually punted on getting that working, and
just expanded the file in place.

bfd/
	* Makefile.am (NO_WERROR): Define.
	* warning.m4: New file
	* acinclude.m4: Include warning.m4.
	* configure.in: Invoke AM_BINUTILS_WARNINGS.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
bfd/doc/
	* Makefile.in: Regenerate.
binutils/
	* Makefile.am (NO_WERROR): Define.  Use instead of -Wno-error.
	* configure.in: Include ../bfd/warning.m4 contents.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
gas/
	* Makefile.am (NO_WERROR): Define.  Use instead of -Wno-error.
	* acinclude.m4: Include ../bfd/warning.m4.
	* configure.in: Invoke AM_BINUTILS_WARNINGS.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
gprof/
	* Makefile.am (NO_WERROR): Define.
	* acinclude.m4: Include ../bfd/warning.m4.
	* configure.in: Invoke AM_BINUTILS_WARNINGS.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
ld/
	* Makefile.am (NO_WERROR): Define.  Use instead of -Wno-error.
	* configure.in: Include ../bfd/warning.m4 contents.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
opcodes/
	* Makefile.am (NO_WERROR): Define.
	* configure.in: Invoke AM_BINUTILS_WARNINGS.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.151
diff -u -p -r1.151 Makefile.am
--- bfd/Makefile.am	12 Apr 2005 02:50:24 -0000	1.151
+++ bfd/Makefile.am	14 Apr 2005 04:46:31 -0000
@@ -18,6 +18,7 @@ bfdincludedir = @bfdincludedir@
 bfdlib_LTLIBRARIES = libbfd.la
 
 WARN_CFLAGS = @WARN_CFLAGS@
+NO_WERROR = @NO_WERROR@
 AM_CFLAGS = $(WARN_CFLAGS)
 
 # bfd.h goes here, for now
Index: bfd/warning.m4
===================================================================
RCS file: bfd/warning.m4
diff -N bfd/warning.m4
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ bfd/warning.m4	14 Apr 2005 05:09:42 -0000
@@ -0,0 +1,43 @@
+dnl Common configure.in fragment
+
+AC_DEFUN([AM_BINUTILS_WARNINGS],[
+WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+
+AC_ARG_ENABLE(werror,
+  [  --enable-werror    treat compile warnings as errors],
+  [case "${enableval}" in
+     yes | y) ERROR_ON_WARNING="yes" ;;
+     no | n)  ERROR_ON_WARNING="no" ;;
+     *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
+   esac])
+
+# Enable -Werror by default when using gcc
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+    ERROR_ON_WARNING=yes
+fi
+
+NO_WERROR=
+if test "${ERROR_ON_WARNING}" = yes ; then
+    WARN_CFLAGS="$WARN_CFLAGS -Werror"
+    NO_WERROR="-Wno-error"
+fi
+		   
+AC_ARG_ENABLE(build-warnings,
+[  --enable-build-warnings Enable build-time compiler warnings],
+[case "${enableval}" in
+  yes)	;;
+  no)	WARN_CFLAGS="-w";;
+  ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
+        WARN_CFLAGS="${WARN_CFLAGS} ${t}";;
+  *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
+        WARN_CFLAGS="${t} ${WARN_CFLAGS}";;
+  *)    WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+esac])
+
+if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then
+  echo "Setting warning flags = $WARN_CFLAGS" 6>&1
+fi
+
+AC_SUBST(WARN_CFLAGS)
+AC_SUBST(NO_WERROR)
+])
Index: bfd/acinclude.m4
===================================================================
RCS file: /cvs/src/src/bfd/acinclude.m4,v
retrieving revision 1.13
diff -u -p -r1.13 acinclude.m4
--- bfd/acinclude.m4	15 Jan 2005 19:14:54 -0000	1.13
+++ bfd/acinclude.m4	14 Apr 2005 04:46:32 -0000
@@ -1,6 +1,7 @@
 sinclude(../config/accross.m4)
 sinclude(../config/acx.m4)
 sinclude(../bfd/bfd.m4)
+sinclude(../bfd/warning.m4)
 
 dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
 AC_DEFUN([BFD_BINARY_FOPEN],
Index: bfd/configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.174
diff -u -p -r1.174 configure.in
--- bfd/configure.in	5 Apr 2005 07:58:38 -0000	1.174
+++ bfd/configure.in	14 Apr 2005 04:46:41 -0000
@@ -51,42 +51,7 @@ AC_ARG_WITH(mmap,
   *)    AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;;
 esac],[want_mmap=false])dnl
 
-build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
-
-AC_ARG_ENABLE(werror,
-  [  --enable-werror    treat compile warnings as errors],
-  [case "${enableval}" in
-     yes | y) ERROR_ON_WARNING="yes" ;;
-     no | n)  ERROR_ON_WARNING="no" ;;
-     *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
-   esac])
-
-# Enable -Werror by default, suppressing it only for --disable-werror
-# or --disable-build-warnings.
-if test "${ERROR_ON_WARNING}" != no
-then
-  build_warnings="$build_warnings -Werror"
-fi
-
-AC_ARG_ENABLE(build-warnings,
-[  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
-[case "${enableval}" in
-  yes)	;;
-  no)	build_warnings="-w";;
-  ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
-        build_warnings="${build_warnings} ${t}";;
-  *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
-        build_warnings="${t} ${build_warnings}";;
-  *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
-esac
-if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
-  echo "Setting warning flags = $build_warnings" 6>&1
-fi])dnl
-WARN_CFLAGS=""
-if test "x${build_warnings}" != x && test "x$GCC" = xyes ; then
-    WARN_CFLAGS="${build_warnings}"
-fi
-AC_SUBST(WARN_CFLAGS)
+AM_BINUTILS_WARNINGS
 
 AM_CONFIG_HEADER(config.h:config.in)
 
Index: binutils/Makefile.am
===================================================================
RCS file: /cvs/src/src/binutils/Makefile.am,v
retrieving revision 1.56
diff -u -p -r1.56 Makefile.am
--- binutils/Makefile.am	12 Apr 2005 02:50:25 -0000	1.56
+++ binutils/Makefile.am	14 Apr 2005 04:46:44 -0000
@@ -20,6 +20,7 @@ YFLAGS = -d
 LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi`
 
 WARN_CFLAGS = @WARN_CFLAGS@
+NO_WERROR = @NO_WERROR@
 AM_CFLAGS = $(WARN_CFLAGS)
 
 # these two are almost the same program
@@ -245,21 +246,21 @@ sysinfo.h: sysinfo.c
 # Disable -Werror, if it has been enabled, since old versions of bison/
 # yacc will produce working code which contain compile time warnings. 
 arparse.o:
-	$(COMPILE) -c $< -Wno-error
+	$(COMPILE) -c $< $(NO_WERROR)
 arlex.o:
-	$(COMPILE) -c $< -Wno-error
+	$(COMPILE) -c $< $(NO_WERROR)
 sysroff.o:
-	$(COMPILE) -c $< -Wno-error
+	$(COMPILE) -c $< $(NO_WERROR)
 defparse.o:
-	$(COMPILE) -c $< -Wno-error
+	$(COMPILE) -c $< $(NO_WERROR)
 deflex.o:
-	$(COMPILE) -c $< -Wno-error
+	$(COMPILE) -c $< $(NO_WERROR)
 nlmheader.o:
-	$(COMPILE) -c $< -Wno-error
+	$(COMPILE) -c $< $(NO_WERROR)
 rcparse.o:
-	$(COMPILE) -c $< -Wno-error
+	$(COMPILE) -c $< $(NO_WERROR)
 rclex.o:
-	$(COMPILE) -c $< -Wno-error
+	$(COMPILE) -c $< $(NO_WERROR)
 
 srconv_SOURCES = srconv.c coffgrok.c $(BULIBS)
 
Index: binutils/configure.in
===================================================================
RCS file: /cvs/src/src/binutils/configure.in,v
retrieving revision 1.50
diff -u -p -r1.50 configure.in
--- binutils/configure.in	6 Apr 2005 14:45:54 -0000	1.50
+++ binutils/configure.in	14 Apr 2005 04:46:48 -0000
@@ -29,7 +29,10 @@ AC_ARG_ENABLE(commonbfdlib,
   *)   AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
 esac])dnl
 
-build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+dnl FIXME: The following is bfd/warning.m4 contents expanded
+dnl When converting to current autotools, please replace with
+dnl AM_BINUTILS_WARNINGS
+WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
 
 AC_ARG_ENABLE(werror,
   [  --enable-werror    treat compile warnings as errors],
@@ -39,32 +42,35 @@ AC_ARG_ENABLE(werror,
      *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
    esac])
 
-# Enable -Werror by default, suppressing it only for --disable-werror
-# or --disable-build-warnings.
-if test "${ERROR_ON_WARNING}" != no
-then
-  build_warnings="$build_warnings -Werror"
+# Enable -Werror by default when using gcc
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+    ERROR_ON_WARNING=yes
 fi
 
+NO_WERROR=
+if test "${ERROR_ON_WARNING}" = yes ; then
+    WARN_CFLAGS="$WARN_CFLAGS -Werror"
+    NO_WERROR="-Wno-error"
+fi
+		   
 AC_ARG_ENABLE(build-warnings,
-[  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
+[  --enable-build-warnings Enable build-time compiler warnings],
 [case "${enableval}" in
   yes)	;;
-  no)	build_warnings="-w";;
+  no)	WARN_CFLAGS="-w";;
   ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
-        build_warnings="${build_warnings} ${t}";;
+        WARN_CFLAGS="${WARN_CFLAGS} ${t}";;
   *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
-        build_warnings="${t} ${build_warnings}";;
-  *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
-esac
-if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
-  echo "Setting warning flags = $build_warnings" 6>&1
-fi])dnl
-WARN_CFLAGS=""
-if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
-    WARN_CFLAGS="${build_warnings}"
+        WARN_CFLAGS="${t} ${WARN_CFLAGS}";;
+  *)    WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+esac])
+
+if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then
+  echo "Setting warning flags = $WARN_CFLAGS" 6>&1
 fi
+
 AC_SUBST(WARN_CFLAGS)
+AC_SUBST(NO_WERROR)
 
 AM_CONFIG_HEADER(config.h:config.in)
 
Index: gas/Makefile.am
===================================================================
RCS file: /cvs/src/src/gas/Makefile.am,v
retrieving revision 1.106
diff -u -p -r1.106 Makefile.am
--- gas/Makefile.am	12 Apr 2005 08:42:37 -0000	1.106
+++ gas/Makefile.am	14 Apr 2005 04:47:06 -0000
@@ -16,6 +16,7 @@ YACC = `if [ -f ../bison/bison ] ; then 
 LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo @LEX@ ; fi`
 
 WARN_CFLAGS = @WARN_CFLAGS@
+NO_WERROR = @NO_WERROR@
 AM_CFLAGS = $(WARN_CFLAGS)
 
 MKDEP = gcc -MM
@@ -644,7 +645,7 @@ m68k-parse.c: $(srcdir)/config/m68k-pars
 # Disable -Werror, if it has been enabled, since old versions of bison/
 # yacc will produce working code which contain compile time warnings. 
 m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h
-	$(COMPILE) -c $< -Wno-error
+	$(COMPILE) -c $< $(NO_WERROR)
 
 # Don't let the .y.h rule clobber m68k-parse.h.
 m68k-parse.h: ; @true
@@ -658,7 +659,7 @@ itbl-lex.o: itbl-lex.c itbl-parse.h $(sr
 # Disable -Werror, if it has been enabled, since old versions of bison/
 # yacc will produce working code which contain compile time warnings. 
 itbl-parse.o: itbl-parse.c itbl-parse.h $(srcdir)/itbl-ops.h $(srcdir)/itbl-lex.h
-	$(COMPILE) -c $< -Wno-error
+	$(COMPILE) -c $< $(NO_WERROR)
 
 itbl-ops.o: $(srcdir)/itbl-ops.c $(srcdir)/itbl-ops.h itbl-parse.h
 
Index: gas/acinclude.m4
===================================================================
RCS file: /cvs/src/src/gas/acinclude.m4,v
retrieving revision 1.3
diff -u -p -r1.3 acinclude.m4
--- gas/acinclude.m4	14 Jan 2004 13:41:37 -0000	1.3
+++ gas/acinclude.m4	14 Apr 2005 04:47:07 -0000
@@ -1,3 +1,5 @@
+sinclude(../bfd/warning.m4)
+
 dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers)
 AC_DEFUN([GAS_CHECK_DECL_NEEDED],[
 AC_MSG_CHECKING(whether declaration is required for $1)
Index: gprof/Makefile.am
===================================================================
RCS file: /cvs/src/src/gprof/Makefile.am,v
retrieving revision 1.22
diff -u -p -r1.22 Makefile.am
--- gprof/Makefile.am	30 Nov 2004 17:20:48 -0000	1.22
+++ gprof/Makefile.am	14 Apr 2005 05:03:35 -0000
@@ -11,6 +11,7 @@ BFDDIR = $(BASEDIR)/bfd
 INCDIR	= $(BASEDIR)/include
 
 WARN_CFLAGS = @WARN_CFLAGS@
+NO_WERROR = @NO_WERROR@
 AM_CFLAGS = $(WARN_CFLAGS)
 
 MKDEP = gcc -MM
Index: gprof/configure.in
===================================================================
RCS file: /cvs/src/src/gprof/configure.in,v
retrieving revision 1.25
diff -u -p -r1.25 configure.in
--- gprof/configure.in	6 Apr 2005 15:42:14 -0000	1.25
+++ gprof/configure.in	14 Apr 2005 04:47:25 -0000
@@ -42,42 +42,7 @@ if test $gprof_cv_decl_getopt_unistd_h =
 	    [Is the prototype for getopt in <unistd.h> in the expected format?])
 fi
 
-build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
-
-AC_ARG_ENABLE(werror,
-  [  --enable-werror    treat compile warnings as errors],
-  [case "${enableval}" in
-     yes | y) ERROR_ON_WARNING="yes" ;;
-     no | n)  ERROR_ON_WARNING="no" ;;
-     *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
-   esac])
-
-# Enable -Werror by default, suppressing it only for --disable-werror
-# or --disable-build-warnings.
-if test "${ERROR_ON_WARNING}" != no
-then
-  build_warnings="$build_warnings -Werror"
-fi
-
-AC_ARG_ENABLE(build-warnings,
-[  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
-[case "${enableval}" in
-  yes)	;;
-  no)	build_warnings="-w";;
-  ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
-        build_warnings="${build_warnings} ${t}";;
-  *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
-        build_warnings="${t} ${build_warnings}";;
-  *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
-esac
-if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
-  echo "Setting warning flags = $build_warnings" 6>&1
-fi])dnl
-WARN_CFLAGS=""
-if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
-    WARN_CFLAGS="${build_warnings}"
-fi
-AC_SUBST(WARN_CFLAGS)
+AM_BINUTILS_WARNINGS
 
 AC_CONFIG_FILES([Makefile po/Makefile.in:po/Make-in])
 AC_CONFIG_COMMANDS([default],[[sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile]],[[]])
Index: ld/Makefile.am
===================================================================
RCS file: /cvs/src/src/ld/Makefile.am,v
retrieving revision 1.171
diff -u -p -r1.171 Makefile.am
--- ld/Makefile.am	12 Apr 2005 02:50:28 -0000	1.171
+++ ld/Makefile.am	14 Apr 2005 04:47:26 -0000
@@ -14,6 +14,7 @@ YFLAGS = -d
 LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi`
 
 WARN_CFLAGS = @WARN_CFLAGS@
+NO_WERROR = @NO_WERROR@
 AM_CFLAGS = $(WARN_CFLAGS)
 
 # We put the scripts in the directory $(scriptdir)/ldscripts.
@@ -420,11 +421,11 @@ STAGESTUFF = *.o ldscripts/* e*.c
 # Disable -Werror, if it has been enabled, since old versions of bison/
 # yacc will produce working code which contain compile time warnings. 
 ldgram.o:
-	$(COMPILE) -c $< -Wno-error
+	$(COMPILE) -c $< $(NO_WERROR)
 ldlex.o:
-	$(COMPILE) -c $< -Wno-error
+	$(COMPILE) -c $< $(NO_WERROR)
 deffilep.o:
-	$(COMPILE) -c $< -Wno-error
+	$(COMPILE) -c $< $(NO_WERROR)
 
 # At the moment this is just a list of those emulation template files
 # that contain internationalised strings.
Index: ld/configure.in
===================================================================
RCS file: /cvs/src/src/ld/configure.in,v
retrieving revision 1.29
diff -u -p -r1.29 configure.in
--- ld/configure.in	4 Apr 2005 11:27:14 -0000	1.29
+++ ld/configure.in	14 Apr 2005 04:47:32 -0000
@@ -66,7 +66,10 @@ AC_SUBST(use_sysroot)
 AC_SUBST(TARGET_SYSTEM_ROOT)
 AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
 
-build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+dnl FIXME: The following is bfd/warning.m4 contents expanded
+dnl When converting to current autotools, please replace with
+dnl AM_BINUTILS_WARNINGS
+WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
 
 AC_ARG_ENABLE(werror,
   [  --enable-werror    treat compile warnings as errors],
@@ -76,32 +79,35 @@ AC_ARG_ENABLE(werror,
      *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
    esac])
 
-# Enable -Werror by default, suppressing it only for --disable-werror
-# or --disable-build-warnings.
-if test "${ERROR_ON_WARNING}" != no
-then
-  build_warnings="$build_warnings -Werror"
+# Enable -Werror by default when using gcc
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+    ERROR_ON_WARNING=yes
 fi
 
+NO_WERROR=
+if test "${ERROR_ON_WARNING}" = yes ; then
+    WARN_CFLAGS="$WARN_CFLAGS -Werror"
+    NO_WERROR="-Wno-error"
+fi
+		   
 AC_ARG_ENABLE(build-warnings,
-[  --enable-build-warnings enable build-time compiler warnings if gcc is used],
+[  --enable-build-warnings Enable build-time compiler warnings],
 [case "${enableval}" in
   yes)	;;
-  no)	build_warnings="-w";;
+  no)	WARN_CFLAGS="-w";;
   ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
-        build_warnings="${build_warnings} ${t}";;
+        WARN_CFLAGS="${WARN_CFLAGS} ${t}";;
   *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
-        build_warnings="${t} ${build_warnings}";;
-  *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
-esac
-if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
-  echo "Setting warning flags = $build_warnings" 6>&1
-fi])dnl
-WARN_CFLAGS=""
-if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
-    WARN_CFLAGS="${build_warnings}"
+        WARN_CFLAGS="${t} ${WARN_CFLAGS}";;
+  *)    WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+esac])
+
+if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then
+  echo "Setting warning flags = $WARN_CFLAGS" 6>&1
 fi
+
 AC_SUBST(WARN_CFLAGS)
+AC_SUBST(NO_WERROR)
 
 AM_CONFIG_HEADER(config.h:config.in)
 
Index: opcodes/Makefile.am
===================================================================
RCS file: /cvs/src/src/opcodes/Makefile.am,v
retrieving revision 1.81
diff -u -p -r1.81 Makefile.am
--- opcodes/Makefile.am	21 Feb 2005 11:48:33 -0000	1.81
+++ opcodes/Makefile.am	14 Apr 2005 04:47:37 -0000
@@ -9,6 +9,7 @@ BFDDIR = $(srcdir)/../bfd
 MKDEP = gcc -MM
 
 WARN_CFLAGS = @WARN_CFLAGS@
+NO_WERROR = @NO_WERROR@
 AM_CFLAGS = $(WARN_CFLAGS)
 
 bfdlibdir = @bfdlibdir@
Index: opcodes/configure.in
===================================================================
RCS file: /cvs/src/src/opcodes/configure.in,v
retrieving revision 1.53
diff -u -p -r1.53 configure.in
--- opcodes/configure.in	31 Mar 2005 16:52:54 -0000	1.53
+++ opcodes/configure.in	14 Apr 2005 04:47:44 -0000
@@ -44,42 +44,7 @@ AC_ARG_ENABLE(commonbfdlib,
   *)   AC_MSG_ERROR([bad value ${enableval} for opcodes commonbfdlib option]) ;;
 esac])dnl
 
-build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
-
-AC_ARG_ENABLE(werror,
-  [  --enable-werror    treat compile warnings as errors],
-  [case "${enableval}" in
-     yes | y) ERROR_ON_WARNING="yes" ;;
-     no | n)  ERROR_ON_WARNING="no" ;;
-     *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
-   esac])
-
-# Enable -Werror by default, suppressing it only for --disable-werror
-# or --disable-build-warnings.
-if test "${ERROR_ON_WARNING}" != no
-then
-  build_warnings="$build_warnings -Werror"
-fi
-
-AC_ARG_ENABLE(build-warnings,
-[  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
-[case "${enableval}" in
-  yes)	;;
-  no)	build_warnings="-w";;
-  ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
-        build_warnings="${build_warnings} ${t}";;
-  *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
-        build_warnings="${t} ${build_warnings}";;
-  *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
-esac
-if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
-  echo "Setting warning flags = $build_warnings" 6>&1
-fi])dnl
-WARN_CFLAGS=""
-if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
-    WARN_CFLAGS="${build_warnings}"
-fi
-AC_SUBST(WARN_CFLAGS)
+AM_BINUTILS_WARNINGS
 
 AM_CONFIG_HEADER(config.h:config.in)
 


-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-04-14  5:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-12  2:51 housekeeping, -Wno-error Alan Modra
2005-04-12  2:54 ` Daniel Jacobowitz
2005-04-12  4:36 ` H. J. Lu
2005-04-12  5:42   ` Alan Modra
2005-04-12  8:37     ` Nick Clifton
2005-04-12 11:41       ` Alan Modra
2005-04-13 15:35         ` Nick Clifton
2005-04-14  5:29           ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).