summaryrefslogtreecommitdiff
path: root/gdbserver/configure
diff options
context:
space:
mode:
Diffstat (limited to 'gdbserver/configure')
-rwxr-xr-xgdbserver/configure85
1 files changed, 74 insertions, 11 deletions
diff --git a/gdbserver/configure b/gdbserver/configure
index d90135be45c..e6b46c24588 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -7930,12 +7930,11 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
- if test "$threads" = "yes"; then
- save_LIBS="$LIBS"
- LIBS="$PTHREAD_LIBS $LIBS"
- save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$PTHREAD_CFLAGS $save_CXXFLAGS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::thread" >&5
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$PTHREAD_CFLAGS $save_CXXFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::thread" >&5
$as_echo_n "checking for std::thread... " >&6; }
if ${gdb_cv_cxx_std_thread+:} false; then :
$as_echo_n "(cached) " >&6
@@ -7943,7 +7942,7 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <thread>
- void callback() { }
+ void callback() { }
int
main ()
{
@@ -7962,6 +7961,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_cxx_std_thread" >&5
$as_echo "$gdb_cv_cxx_std_thread" >&6; }
+ if test "$threads" = "yes"; then
# This check must be here, while LIBS includes any necessary
# threading library.
for ac_func in pthread_sigmask pthread_setname_np
@@ -7976,10 +7976,9 @@ _ACEOF
fi
done
-
- LIBS="$save_LIBS"
- CXXFLAGS="$save_CXXFLAGS"
fi
+ LIBS="$save_LIBS"
+ CXXFLAGS="$save_CXXFLAGS"
if test "$want_threading" = "yes"; then
if test "$gdb_cv_cxx_std_thread" = "yes"; then
@@ -9707,6 +9706,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 +9800,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