summaryrefslogtreecommitdiff
path: root/gdbserver
diff options
context:
space:
mode:
Diffstat (limited to 'gdbserver')
-rw-r--r--gdbserver/acinclude.m43
-rwxr-xr-xgdbserver/configure66
-rw-r--r--gdbserver/configure.ac1
3 files changed, 69 insertions, 1 deletions
diff --git a/gdbserver/acinclude.m4 b/gdbserver/acinclude.m4
index d68e318229..32d5d14ca6 100644
--- a/gdbserver/acinclude.m4
+++ b/gdbserver/acinclude.m4
@@ -7,6 +7,9 @@ dnl system search paths.
dnl gdb/gdbserver/configure.in uses BFD_HAVE_SYS_PROCFS_TYPE.
m4_include(../bfd/bfd.m4)
+# This get AM_GDB_COMPILER_TYPE.
+m4_include(../gdbsupport/compiler-type.m4)
+
dnl This gets AM_GDB_WARNINGS.
m4_include(../gdbsupport/warning.m4)
diff --git a/gdbserver/configure b/gdbserver/configure
index d90135be45..bcb15941ed 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -9707,6 +9707,64 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking the compiler type" >&5
+$as_echo_n "checking the compiler type... " >&6; }
+if ${gdb_cv_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gdb_cv_compiler_type=unknown
+ if test "$gdb_cv_compiler_type" = unknown; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ #if !defined __GNUC__ || defined __clang__
+ #error not gcc
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gdb_cv_compiler_type=gcc
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+
+ if test "$gdb_cv_compiler_type" = unknown; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ #ifndef __clang__
+ #error not clang
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gdb_cv_compiler_type=clang
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_compiler_type" >&5
+$as_echo "$gdb_cv_compiler_type" >&6; }
+
+ GDB_COMPILER_TYPE="$gdb_cv_compiler_type"
+
+
# Check whether --enable-werror was given.
if test "${enable_werror+set}" = set; then :
enableval=$enable_werror; case "${enableval}" in
@@ -9743,10 +9801,16 @@ build_warnings="-Wall -Wpointer-arith \
-Wdeprecated-copy-dtor \
-Wredundant-move \
-Wmissing-declarations \
--Wmissing-prototypes \
-Wstrict-null-sentinel \
"
+# The -Wmissing-prototypes flag will be accepted by GCC, but results
+# in a warning being printed about the flag not being valid for C++,
+# this is something to do with using ccache, and argument ordering.
+if test "$GDB_COMPILER_TYPE" != gcc; then
+ build_warnings="$build_warnings -Wmissing-prototypes"
+fi
+
case "${host}" in
*-*-mingw32*)
# Enable -Wno-format by default when using gcc on mingw since many
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
index 557654654b..dc33f1a235 100644
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -146,6 +146,7 @@ fi
AC_SUBST(ustlibs)
AC_SUBST(ustinc)
+AM_GDB_COMPILER_TYPE
AM_GDB_WARNINGS
dnl dladdr is glibc-specific. It is used by thread-db.c but only for