aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/configure.ac
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-01-11 14:12:51 -0500
committerMike Frysinger <vapier@gentoo.org>2016-01-12 10:34:57 -0500
commit8f13a3ce8afc1144169a14c7704689e263316e70 (patch)
tree0e0a9d1e9617685e66c3ac39db80702691a7cdb2 /gdb/gdbserver/configure.ac
parent5b3da067f0893be637f9e992b409e36682ea081a (diff)
downloadfsf-binutils-gdb-8f13a3ce8afc1144169a14c7704689e263316e70.zip
fsf-binutils-gdb-8f13a3ce8afc1144169a14c7704689e263316e70.tar.gz
fsf-binutils-gdb-8f13a3ce8afc1144169a14c7704689e263316e70.tar.bz2
gdbserver: use the new gdb warning helpers
We need to use -Wno-missing-prototypes for now as much of the code sticks externs in local files and not in common headers. 2016-01-11 Mike Frysinger <vapier@gentoo.org> * acinclude.m4: Include new ../warning.m4 file. * configure: Regenerated. * configure.ac: Replace all warning logic with AM_GDB_WARNINGS.
Diffstat (limited to 'gdb/gdbserver/configure.ac')
-rw-r--r--gdb/gdbserver/configure.ac81
1 files changed, 7 insertions, 74 deletions
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index fbf33c3..8476fbd 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -149,80 +149,13 @@ fi
AC_SUBST(ustlibs)
AC_SUBST(ustinc)
-AC_ARG_ENABLE(werror,
- AS_HELP_STRING([--enable-werror], [treat compile warnings as errors]),
- [case "${enableval}" in
- yes | y) ERROR_ON_WARNING="yes" ;;
- no | n) ERROR_ON_WARNING="no" ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
- esac])
-
-# Enable -Werror by default when using gcc. Turn it off for releases.
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" \
- && test x"$enable_build_with_cxx" != x"yes" \
- && $development; then
- ERROR_ON_WARNING=yes
-fi
-
-WERROR_CFLAGS=""
-if test "${ERROR_ON_WARNING}" = yes ; then
- WERROR_CFLAGS="-Werror"
-fi
-
-build_warnings="-Wall -Wpointer-arith \
--Wformat-nonliteral -Wno-char-subscripts -Wempty-body"
-
-# Now add in C and C++ specific options, depending on mode.
-if test "$enable_build_with_cxx" = "yes"; then
- build_warnings="$build_warnings -Wno-sign-compare -Wno-write-strings \
--Wno-narrowing"
-else
- build_warnings="$build_warnings -Wdeclaration-after-statement"
-fi
-
-# The set of warnings supported by a C++ compiler is not the same as
-# of the C compiler.
-if test "$enable_build_with_cxx" = "yes"; then
- AC_LANG_PUSH([C++])
-fi
-
-WARN_CFLAGS=""
-if test "x$GCC" = xyes
-then
- 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
- # 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 $wtest"
- saved_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS $wtest"
- AC_TRY_COMPILE([],[],WARN_CFLAGS="${WARN_CFLAGS} $w",)
- CFLAGS="$saved_CFLAGS"
- CXXFLAGS="$saved_CXXFLAGS"
- esac
- done
- AC_MSG_RESULT(${WARN_CFLAGS} ${WERROR_CFLAGS})
-fi
-AC_SUBST(WARN_CFLAGS)
-AC_SUBST(WERROR_CFLAGS)
-
-if test "$enable_build_with_cxx" = "yes"; then
- AC_LANG_POP([C++])
-fi
+AM_GDB_WARNINGS
+dnl The codebase isn't clean yet with this flag.
+case " $WARN_CFLAGS " in
+*" -Wmissing-prototypes "*)
+ WARN_CFLAGS="$WARN_CFLAGS -Wno-missing-prototypes"
+ ;;
+esac
dnl dladdr is glibc-specific. It is used by thread-db.c but only for
dnl debugging messages. It lives in -ldl which is handled below so we don't