Fix -Wno-unknown-warning support detection
[deliverable/binutils-gdb.git] / gdb / configure.ac
index ebd797bf51940c614b295e24e5a2b37998cabf89..b9d8f8bca57b9de20f0fe42e8f58bdc0699dad4a 100644 (file)
@@ -2007,14 +2007,23 @@ then
     # Separate out the -Werror flag as some files just cannot be
     # compiled with it enabled.
     for w in ${build_warnings}; do
+       # GCC does not complain about -Wno-unknown-warning.  Invert
+       # and test -Wunknown-warning instead.
+       case $w in
+       -Wno-*)
+               wtest=`echo $w | sed 's/-Wno-/-W/g'` ;;
+       *)
+               wtest=$w ;;
+       esac
+
        case $w in
        -Werr*) WERROR_CFLAGS=-Werror ;;
        *)
            # Check whether GCC accepts it.
            saved_CFLAGS="$CFLAGS"
-           CFLAGS="$CFLAGS $w"
+           CFLAGS="$CFLAGS $wtest"
            saved_CXXFLAGS="$CXXFLAGS"
-           CXXFLAGS="$CXXFLAGS $w"
+           CXXFLAGS="$CXXFLAGS $wtest"
            AC_TRY_COMPILE([],[],WARN_CFLAGS="${WARN_CFLAGS} $w",)
            CFLAGS="$saved_CFLAGS"
            CXXFLAGS="$saved_CXXFLAGS"
This page took 0.02891 seconds and 4 git commands to generate.