aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure.in
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-05-12 04:37:00 +0000
committerAndrew Cagney <cagney@redhat.com>2000-05-12 04:37:00 +0000
commit746a987d82a5517a78b9fe8e1827969984301252 (patch)
tree2f89aef60e155a0feda68d0926f746dce11bab26 /gdb/configure.in
parenta76b448c6ff46befe77f3708d330edfc8c03da20 (diff)
downloadgdb-746a987d82a5517a78b9fe8e1827969984301252.zip
gdb-746a987d82a5517a78b9fe8e1827969984301252.tar.gz
gdb-746a987d82a5517a78b9fe8e1827969984301252.tar.bz2
Check -W options before using them.
Diffstat (limited to 'gdb/configure.in')
-rw-r--r--gdb/configure.in25
1 files changed, 16 insertions, 9 deletions
diff --git a/gdb/configure.in b/gdb/configure.in
index 5f112c0..65e8cc0 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -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)