From 49c96104aa8c20ee6d0e7911e5ae44b496ce3986 Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Mon, 7 Nov 2005 22:14:12 +0000 Subject: * warning.m4 (AM_BINUTILS_WARNINGS): Default to empty string if compiler is not GCC. * configure: Regenerate --- bfd/warning.m4 | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'bfd/warning.m4') diff --git a/bfd/warning.m4 b/bfd/warning.m4 index 38feb5f0336..2e2dd424c0f 100644 --- a/bfd/warning.m4 +++ b/bfd/warning.m4 @@ -1,7 +1,7 @@ dnl Common configure.in fragment AC_DEFUN([AM_BINUTILS_WARNINGS],[ -WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" +GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" AC_ARG_ENABLE(werror, [ --enable-werror treat compile warnings as errors], @@ -18,19 +18,25 @@ fi NO_WERROR= if test "${ERROR_ON_WARNING}" = yes ; then - WARN_CFLAGS="$WARN_CFLAGS -Werror" + GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" NO_WERROR="-Wno-error" fi +if test "${GCC}" = yes ; then + WARN_CFLAGS="${GCC_WARN_CFLAGS}" +fi + AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings], [case "${enableval}" in - yes) ;; - no) WARN_CFLAGS="-w";; + yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; + no) if test "${GCC}" = yes ; then + WARN_CFLAGS="-w" + fi;; ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${WARN_CFLAGS} ${t}";; + WARN_CFLAGS="${GCC_WARN_CFLAGS} ${t}";; *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - WARN_CFLAGS="${t} ${WARN_CFLAGS}";; + WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac]) -- cgit v1.2.1