Check -W options before using them.

This commit is contained in:
Andrew Cagney 2000-05-12 04:37:00 +00:00
parent a76b448c6f
commit 746a987d82
3 changed files with 369 additions and 337 deletions

View File

@ -1,3 +1,9 @@
Thu May 11 21:52:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
* configure.in (WERROR_CFLAGS): Check that GCC accepts a -W
options before using them. Report result.
* configure: Regenerate.
2000-05-11 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* coffread.c (coff_symtab_read): In the case of C_THUMBEXT |

675
gdb/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -498,20 +498,27 @@ AC_ARG_ENABLE(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
echo "Setting compiler warning flags = $build_warnings" 6>&1
fi])dnl
WARN_CFLAGS=""
WERROR_CFLAGS=""
if test "x${build_warnings}" != x -a "x$GCC" = xyes
then
# Separate out the -Werror flag as some files just cannot be
# compiled with it enabled.
for w in ${build_warnings}; do
case $w in
-Werr*) WERROR_CFLAGS=-Werror ;;
*) WARN_CFLAGS="${WARN_CFLAGS} $w"
esac
done
AC_MSG_CHECKING(compiler warning flags)
# Separate out the -Werror flag as some files just cannot be
# compiled with it enabled.
for w in ${build_warnings}; do
case $w in
-Werr*) WERROR_CFLAGS=-Werror ;;
*) # Check that GCC accepts it
if $CC $w 2>&1 | grep 'unrecognized option' > /dev/null; then
:
else
WARN_CFLAGS="${WARN_CFLAGS} $w"
fi
esac
done
AC_MSG_RESULT(${WARN_CFLAGS}${WERROR_CFLAGS})
fi
AC_SUBST(WARN_CFLAGS)
AC_SUBST(WERROR_CFLAGS)