summaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog9
-rw-r--r--gas/Makefile.am5
-rw-r--r--gas/Makefile.in9
-rw-r--r--gas/acinclude.m42
-rwxr-xr-xgas/configure43
-rw-r--r--gas/configure.in37
-rw-r--r--gas/doc/Makefile.in5
7 files changed, 48 insertions, 62 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 944f31688e5..58dc0a6995c 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,12 @@
+2005-04-14 Alan Modra <amodra@bigpond.net.au>
+
+ * 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.
+
2005-04-13 Maciej W. Rozycki <macro@linux-mips.org>
* config/tc-mips.c (IS_ZEXT_32BIT_NUM): New macro.
diff --git a/gas/Makefile.am b/gas/Makefile.am
index c03e5805957..11fc5f7a144 100644
--- a/gas/Makefile.am
+++ b/gas/Makefile.am
@@ -16,6 +16,7 @@ YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison
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-parse.y
# 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 $(srcdir)/itbl-lex.h
# 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
diff --git a/gas/Makefile.in b/gas/Makefile.in
index e3554baee38..2cfd5b15f7c 100644
--- a/gas/Makefile.in
+++ b/gas/Makefile.in
@@ -53,8 +53,8 @@ DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/../libtool.m4 $(top_srcdir)/../gettext.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \
+ $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -171,6 +171,7 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
+NO_WERROR = @NO_WERROR@
OBJEXT = @OBJEXT@
OPCODES_LIB = @OPCODES_LIB@
PACKAGE = @PACKAGE@
@@ -3045,7 +3046,7 @@ m68k-parse.c: $(srcdir)/config/m68k-parse.y
# 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
@@ -3059,7 +3060,7 @@ itbl-lex.o: itbl-lex.c itbl-parse.h $(srcdir)/itbl-lex.h
# 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
diff --git a/gas/acinclude.m4 b/gas/acinclude.m4
index 4a3ccf358bd..0946e724f12 100644
--- a/gas/acinclude.m4
+++ b/gas/acinclude.m4
@@ -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)
diff --git a/gas/configure b/gas/configure
index de08b68551a..c54691471b7 100755
--- a/gas/configure
+++ b/gas/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL WARN_CFLAGS GDBINIT cgen_cpu_prefix extra_objects target_cpu_type obj_format te_file install_tooldir atof BFDLIB OPCODES_LIB BFDVER_H ALL_OBJ_DEPS YACC LEX LEXLIB LEX_OUTPUT_ROOT CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBM LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL WARN_CFLAGS NO_WERROR GDBINIT cgen_cpu_prefix extra_objects target_cpu_type obj_format te_file install_tooldir atof BFDLIB OPCODES_LIB BFDVER_H ALL_OBJ_DEPS YACC LEX LEXLIB LEX_OUTPUT_ROOT CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBM LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -860,7 +860,7 @@ Optional Features:
targets alternative target configurations besides the primary
--enable-commonbfdlib build shared BFD/opcodes/libiberty library
--enable-werror treat compile warnings as errors
- --enable-build-warnings Enable build-time compiler warnings if gcc is used
+ --enable-build-warnings Enable build-time compiler warnings
--disable-nls do not use Native Language Support
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
@@ -4088,7 +4088,8 @@ esac
fi;
using_cgen=no
-build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+
+WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
# Check whether --enable-werror or --disable-werror was given.
if test "${enable_werror+set}" = set; then
@@ -4102,11 +4103,15 @@ echo "$as_me: error: bad value ${enableval} for --enable-werror" >&2;}
esac
fi;
-# 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
# Check whether --enable-build-warnings or --disable-build-warnings was given.
@@ -4114,22 +4119,23 @@ if test "${enable_build_warnings+set}" = set; then
enableval="$enable_build_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"`;;
+ WARN_CFLAGS="${t} ${WARN_CFLAGS}";;
+ *) WARN_CFLAGS=`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
-fi; WARN_CFLAGS=""
-if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
- WARN_CFLAGS="${build_warnings}"
+fi;
+
+if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then
+ echo "Setting warning flags = $WARN_CFLAGS" 6>&1
fi
+
+
+
# Generate a header file
ac_config_headers="$ac_config_headers config.h:config.in"
@@ -11698,6 +11704,7 @@ s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
s,@LIBTOOL@,$LIBTOOL,;t t
s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t
+s,@NO_WERROR@,$NO_WERROR,;t t
s,@GDBINIT@,$GDBINIT,;t t
s,@cgen_cpu_prefix@,$cgen_cpu_prefix,;t t
s,@extra_objects@,$extra_objects,;t t
diff --git a/gas/configure.in b/gas/configure.in
index 50df7fe514f..e9deeafdf3a 100644
--- a/gas/configure.in
+++ b/gas/configure.in
@@ -48,42 +48,7 @@ esac])dnl
using_cgen=no
-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
# Generate a header file
AM_CONFIG_HEADER(config.h:config.in)
diff --git a/gas/doc/Makefile.in b/gas/doc/Makefile.in
index cd989da1726..dce02982ebc 100644
--- a/gas/doc/Makefile.in
+++ b/gas/doc/Makefile.in
@@ -40,8 +40,8 @@ subdir = doc
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/../libtool.m4 $(top_srcdir)/../gettext.m4 \
- $(top_srcdir)/configure.in
+ $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../libtool.m4 \
+ $(top_srcdir)/../gettext.m4 $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
@@ -129,6 +129,7 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
+NO_WERROR = @NO_WERROR@
OBJEXT = @OBJEXT@
OPCODES_LIB = @OPCODES_LIB@
PACKAGE = @PACKAGE@