[rfc] Check that GCC accepts the given -W option

Andrew Cagney ac131313@cygnus.com
Thu May 11 05:04:00 GMT 2000


Hello,

The attatched tweeks the configury so that it checks that a -W option is
valid before trying to use it.
Look ok?

	Andrew
Thu May 11 21:52:55 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* configure.in (WERROR_CFLAGS): Check that GCC accepts a -W option
 	before using it.

Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.21
diff -p -r1.21 configure.in
*** configure.in	2000/04/14 10:13:50	1.21
--- configure.in	2000/05/11 11:54:05
*************** then
*** 509,515 ****
    for w in ${build_warnings}; do
      case $w in
      -Werr*) WERROR_CFLAGS=-Werror ;;
!     *) WARN_CFLAGS="${WARN_CFLAGS} $w"
      esac
    done
  fi
--- 509,520 ----
    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
  fi


More information about the Gdb-patches mailing list