Fix unused function error
[deliverable/binutils-gdb.git] / gdb / configure
index 22a5f6051d47ba83d192fcc5c2644baf318cbb91..324eb509440881d59fba79d9effe2ef74893d17e 100755 (executable)
@@ -626,7 +626,11 @@ LIBOBJS
 GCORE_TRANSFORM_NAME
 GDB_TRANSFORM_NAME
 XSLTPROC
+NM_H
 GDB_NM_FILE
+LTLIBXXHASH
+LIBXXHASH
+HAVE_LIBXXHASH
 LTLIBBABELTRACE
 LIBBABELTRACE
 HAVE_LIBBABELTRACE
@@ -693,10 +697,16 @@ WIN32LIBS
 SER_HARDWIRE
 WERROR_CFLAGS
 WARN_CFLAGS
+SYSTEM_GDBINIT_DIR
 SYSTEM_GDBINIT
 TARGET_SYSTEM_ROOT
 CONFIG_LDFLAGS
 RDYNAMIC
+PTHREAD_CFLAGS
+PTHREAD_LIBS
+PTHREAD_CC
+ax_pthread_config
+SED
 ALLOCA
 LTLIBIPT
 LIBIPT
@@ -884,6 +894,7 @@ with_libipt_prefix
 with_included_regex
 with_sysroot
 with_system_gdbinit
+with_system_gdbinit_dir
 enable_werror
 enable_build_warnings
 enable_gdb_build_warnings
@@ -897,6 +908,8 @@ enable_sim
 enable_gdbserver
 with_babeltrace
 with_libbabeltrace_prefix
+with_xxhash
+with_libxxhash_prefix
 enable_unit_tests
 '
       ac_precious_vars='build_alias
@@ -1618,6 +1631,9 @@ Optional Packages:
   --with-sysroot[=DIR]    search for usr/lib et al within DIR
   --with-system-gdbinit=PATH
                           automatically load a system-wide gdbinit file
+  --with-system-gdbinit-dir=PATH
+                          automatically load system-wide gdbinit files from
+                          this directory
   --with-lzma             support lzma compression (auto/yes/no)
   --with-liblzma-prefix[=DIR]  search for liblzma in DIR/include and DIR/lib
   --without-liblzma-prefix     don't search for liblzma in includedir and libdir
@@ -1627,6 +1643,9 @@ Optional Packages:
   --with-babeltrace       include babeltrace support (auto/yes/no)
   --with-libbabeltrace-prefix[=DIR]  search for libbabeltrace in DIR/include and DIR/lib
   --without-libbabeltrace-prefix     don't search for libbabeltrace in includedir and libdir
+  --with-xxhash           use libxxhash for hashing (faster) (auto/yes/no)
+  --with-libxxhash-prefix[=DIR]  search for libxxhash in DIR/include and DIR/lib
+  --without-libxxhash-prefix     don't search for libxxhash in includedir and libdir
 
 Some influential environment variables:
   CC          C compiler command
@@ -2501,6 +2520,73 @@ fi
   as_fn_set_status $ac_retval
 
 } # ac_fn_cxx_try_link
+
+# ac_fn_cxx_check_func LINENO FUNC VAR
+# ------------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_cxx_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_cxx_check_func
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
@@ -6542,10 +6628,6 @@ fi
 
 . $srcdir/configure.host
 
-# Add in the common host objects.
-. $srcdir/gdbsupport/common.host
-gdb_host_obs="$gdb_host_obs $common_host_obs"
-
 # Accumulate some settings from configure.tgt over all enabled targets
 
 TARGET_OBS=
 
   have_libpython=no
   if test "${have_python_config}" = yes; then
-    # Determine the Python version by extracting "-lpython<version>"
-    # part of the python_libs. <version> is usually X.Y with X and Y
-    # being decimal numbers, but can also be XY (seen on Windows).
-    #
-    # The extraction is performed using sed with a regular expression.
-    # Initially, the regexp used was using the '?' quantifier to make
-    # the dot in the version number optional.  Unfortunately, this
-    # does not work with non-GNU versions of sed because, because of
-    # what looks like a limitation (the '?' quantifier does not work
-    # with back-references).  We work around this limitation by using
-    # the '*' quantifier instead.  It means that, in theory, we might
-    # match unexpected version strings such as "-lpython2..7", but
-    # this seems unlikely in practice.  And even if that happens,
-    # an error will be triggered later on, when checking that version
-    # number.
-    python_version=`echo " ${python_libs} " \
-                         | sed -e 's,^.* -l\(python[0-9]*[.]*[0-9]*\).*$,\1,'`
-    case "${python_version}" in
-    python*)
-
-  version=${python_version}
+
 
   new_CPPFLAGS=${python_includes}
   new_LIBS=${python_libs}
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${version}" >&5
-$as_echo_n "checking for ${version}... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python" >&5
+$as_echo_n "checking for python... " >&6; }
   save_CPPFLAGS=$CPPFLAGS
   save_LIBS=$LIBS
   CPPFLAGS="$CPPFLAGS $new_CPPFLAGS"
@@ -10473,7 +10535,7 @@ Py_Initialize ();
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  have_libpython=${version}
+  have_libpython=yes
                   found_usable_python=yes
                   PYTHON_CPPFLAGS=$new_CPPFLAGS
                   PYTHON_LIBS=$new_LIBS
@@ -10485,20 +10547,14 @@ rm -f core conftest.err conftest.$ac_objext \
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_python}" >&5
 $as_echo "${found_usable_python}" >&6; }
 
-      ;;
-    *)
-      as_fn_error $? "unable to determine python version from ${python_libs}" "$LINENO" 5
-      ;;
-    esac
   elif test "${have_python_config}" != failed; then
     if test "${have_libpython}" = no; then
 
-  version=python2.7
 
   new_CPPFLAGS=${python_includes}
   new_LIBS="-lpython2.7 ${python_libs}"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${version}" >&5
-$as_echo_n "checking for ${version}... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python" >&5
+$as_echo_n "checking for python... " >&6; }
   save_CPPFLAGS=$CPPFLAGS
   save_LIBS=$LIBS
   CPPFLAGS="$CPPFLAGS $new_CPPFLAGS"
@@ -10516,7 +10572,7 @@ Py_Initialize ();
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  have_libpython=${version}
+  have_libpython=yes
                   found_usable_python=yes
                   PYTHON_CPPFLAGS=$new_CPPFLAGS
                   PYTHON_LIBS=$new_LIBS
@@ -10531,12 +10587,11 @@ $as_echo "${found_usable_python}" >&6; }
     fi
     if test "${have_libpython}" = no; then
 
-  version=python2.6
 
   new_CPPFLAGS=${python_includes}
   new_LIBS="-lpython2.6 ${python_libs}"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${version}" >&5
-$as_echo_n "checking for ${version}... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python" >&5
+$as_echo_n "checking for python... " >&6; }
   save_CPPFLAGS=$CPPFLAGS
   save_LIBS=$LIBS
   CPPFLAGS="$CPPFLAGS $new_CPPFLAGS"
@@ -10554,7 +10609,7 @@ Py_Initialize ();
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  have_libpython=${version}
+  have_libpython=yes
                   found_usable_python=yes
                   PYTHON_CPPFLAGS=$new_CPPFLAGS
                   PYTHON_LIBS=$new_LIBS
@@ -10568,15 +10623,6 @@ $as_echo "${found_usable_python}" >&6; }
 
     fi
   fi
-  if test "${have_libpython}" = python2.7 -o "${have_libpython}" = python27; then
-
-$as_echo "#define HAVE_LIBPYTHON2_7 1" >>confdefs.h
-
-  elif test "${have_libpython}" = python2.6 -o "${have_libpython}" = python26; then
-
-$as_echo "#define HAVE_LIBPYTHON2_6 1" >>confdefs.h
-
-  fi
 
   if test "${have_libpython}" = no; then
     case "${with_python}" in
@@ -10691,34 +10737,6 @@ $as_echo "${PYTHON_CFLAGS}" >&6; }
            fi
            ;;
   esac
-
-  # Note that "python -m threading" cannot be used to check for
-  # threading support due to a bug in Python 2.7.3
-  # (http://bugs.python.org/issue15567).
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether python supports threads" >&5
-$as_echo_n "checking whether python supports threads... " >&6; }
-  saved_CPPFLAGS="${CPPFLAGS}"
-  CPPFLAGS="${PYTHON_CPPFLAGS}"
-  # Note that the test is reversed so that python_has_threads=yes on
-  # unexpected failures.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <Python.h>
-#ifdef WITH_THREAD
-# error
-#endif
-
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  python_has_threads=no
-else
-  python_has_threads=yes
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${python_has_threads}" >&5
-$as_echo "${python_has_threads}" >&6; }
-  CPPFLAGS="${saved_CPPFLAGS}"
 else
   # Even if Python support is not compiled in, we need to have this file
   # included so that the "python" command, et.al., still exists.
@@ -13120,7 +13138,7 @@ fi
 for ac_func in getauxval getrusage getuid getgid \
                pipe poll pread pread64 pwrite resize_term \
                sbrk getpgid setpgid setpgrp setsid \
-               sigaction sigprocmask sigsetmask socketpair \
+               sigaction sigsetmask socketpair \
                ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
                setrlimit getrlimit posix_madvise waitpid \
                ptrace64 sigaltstack setns use_default_colors
@@ -13180,6 +13198,75 @@ _ACEOF
 
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
@@ -13529,7 +13616,8 @@ fi
 done
 
 
-  for ac_func in fdwalk getrlimit pipe pipe2 socketpair sigaction
+  for ac_func in fdwalk getrlimit pipe pipe2 socketpair sigaction \
+                 sigprocmask
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
 done
 
 
-  ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
+  ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
 if test "x$ac_cv_have_decl_strstr" = xyes; then :
   ac_have_decl=1
 else
@@ -13564,2201 +13642,2956 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5
-$as_echo_n "checking for sigsetjmp... " >&6; }
-if ${gdb_cv_func_sigsetjmp+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  # Check for std::thread.  This does not work on some platforms, like
+  # mingw and DJGPP.
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
-#include <setjmp.h>
 
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on Tru64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
+        ax_pthread_save_CC="$CC"
+        ax_pthread_save_CFLAGS="$CFLAGS"
+        ax_pthread_save_LIBS="$LIBS"
+        if test "x$PTHREAD_CC" != "x"; then :
+  CC="$PTHREAD_CC"
+fi
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5
+$as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; }
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_join ();
 int
 main ()
 {
-sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
+return pthread_join ();
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_func_sigsetjmp=yes
-else
-  gdb_cv_func_sigsetjmp=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if ac_fn_c_try_link "$LINENO"; then :
+  ax_pthread_ok=yes
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_sigsetjmp" >&5
-$as_echo "$gdb_cv_func_sigsetjmp" >&6; }
-if test $gdb_cv_func_sigsetjmp = yes; then
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+$as_echo "$ax_pthread_ok" >&6; }
+        if test "x$ax_pthread_ok" = "xno"; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        CC="$ax_pthread_save_CC"
+        CFLAGS="$ax_pthread_save_CFLAGS"
+        LIBS="$ax_pthread_save_LIBS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
+#           (Note: HP C rejects this with "bad form for `-t' option")
+# -pthreads: Solaris/gcc (Note: HP C also rejects)
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads and
+#      -D_REENTRANT too), HP C (must be checked before -lpthread, which
+#      is present but should not be used directly; and before -mthreads,
+#      because the compiler interprets this as "-mt" + "-hreads")
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
 
-$as_echo "#define HAVE_SIGSETJMP 1" >>confdefs.h
+case $host_os in
 
-fi
+        freebsd*)
 
+        # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+        # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
 
-# Check the return and argument types of ptrace.
+        ax_pthread_flags="-kthread lthread $ax_pthread_flags"
+        ;;
 
+        hpux*)
+
+        # From the cc(1) man page: "[-mt] Sets various -D flags to enable
+        # multi-threading and also sets -lpthread."
+
+        ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
+        ;;
+
+        openedition*)
+
+        # IBM z/OS requires a feature-test macro to be defined in order to
+        # enable POSIX threads at all, so give the user a hint if this is
+        # not set. (We don't define these ourselves, as they can affect
+        # other portions of the system API in unpredictable ways.)
+
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#            if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
+             AX_PTHREAD_ZOS_MISSING
+#            endif
 
-for ac_header in sys/ptrace.h ptrace.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5
+$as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;}
+fi
+rm -f conftest*
+
+        ;;
+
+        solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed. (N.B.: The stubs are missing
+        # pthread_cleanup_push, or rather a function called by this macro,
+        # so we could check for that, but who knows whether they'll stub
+        # that too in a future libc.)  So we'll check first for the
+        # standard Solaris way of linking pthreads (-mt -lpthread).
+
+        ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
+        ;;
+esac
 
+# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
+
+if test "x$GCC" = "xyes"; then :
+  ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"
 fi
 
-done
+# The presence of a feature test macro requesting re-entrant function
+# definitions is, on some systems, a strong hint that pthreads support is
+# correctly enabled
 
+case $host_os in
+        darwin* | hpux* | linux* | osf* | solaris*)
+        ax_pthread_check_macro="_REENTRANT"
+        ;;
 
-gdb_ptrace_headers='
-#include <sys/types.h>
-#if HAVE_SYS_PTRACE_H
-# include <sys/ptrace.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-'
-# There is no point in checking if we don't have a prototype.
-ac_fn_c_check_decl "$LINENO" "ptrace" "ac_cv_have_decl_ptrace" "$gdb_ptrace_headers
-"
-if test "x$ac_cv_have_decl_ptrace" = xyes; then :
-  ac_have_decl=1
+        aix*)
+        ax_pthread_check_macro="_THREAD_SAFE"
+        ;;
+
+        *)
+        ax_pthread_check_macro="--"
+        ;;
+esac
+if test "x$ax_pthread_check_macro" = "x--"; then :
+  ax_pthread_check_cond=0
 else
-  ac_have_decl=0
+  ax_pthread_check_cond="!defined($ax_pthread_check_macro)"
 fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_PTRACE $ac_have_decl
-_ACEOF
-if test $ac_have_decl = 1; then :
+# Are we compiling with Clang?
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5
+$as_echo_n "checking whether $CC is Clang... " >&6; }
+if ${ax_cv_PTHREAD_CLANG+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
+  ax_cv_PTHREAD_CLANG=no
+     # Note that Autoconf sets GCC=yes for Clang as well as GCC
+     if test "x$GCC" = "xyes"; then
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
+#            if defined(__clang__) && defined(__llvm__)
+             AX_PTHREAD_CC_IS_CLANG
+#            endif
 
-  : ${gdb_cv_func_ptrace_ret='int'}
-  : ${gdb_cv_func_ptrace_args='int,int,long,long'}
-
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1; then :
+  ax_cv_PTHREAD_CLANG=yes
 fi
+rm -f conftest*
 
-# Check return type.  Varargs (used on GNU/Linux) conflict with the
-# empty argument list, so check for that explicitly.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of ptrace" >&5
-$as_echo_n "checking return type of ptrace... " >&6; }
-if ${gdb_cv_func_ptrace_ret+:} false; then :
+     fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5
+$as_echo "$ax_cv_PTHREAD_CLANG" >&6; }
+ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
+
+ax_pthread_clang_warning=no
+
+# Clang needs special handling, because older versions handle the -pthread
+# option in a rather... idiosyncratic way
+
+if test "x$ax_pthread_clang" = "xyes"; then
+
+        # Clang takes -pthread; it has never supported any other flag
+
+        # (Note 1: This will need to be revisited if a system that Clang
+        # supports has POSIX threads in a separate library.  This tends not
+        # to be the way of modern systems, but it's conceivable.)
+
+        # (Note 2: On some systems, notably Darwin, -pthread is not needed
+        # to get POSIX threads support; the API is always present and
+        # active.  We could reasonably leave PTHREAD_CFLAGS empty.  But
+        # -pthread does define _REENTRANT, and while the Darwin headers
+        # ignore this macro, third-party headers might not.)
+
+        PTHREAD_CFLAGS="-pthread"
+        PTHREAD_LIBS=
+
+        ax_pthread_ok=yes
+
+        # However, older versions of Clang make a point of warning the user
+        # that, in an invocation where only linking and no compilation is
+        # taking place, the -pthread option has no effect ("argument unused
+        # during compilation").  They expect -pthread to be passed in only
+        # when source code is being compiled.
+        #
+        # Problem is, this is at odds with the way Automake and most other
+        # C build frameworks function, which is that the same flags used in
+        # compilation (CFLAGS) are also used in linking.  Many systems
+        # supported by AX_PTHREAD require exactly this for POSIX threads
+        # support, and in fact it is often not straightforward to specify a
+        # flag that is used only in the compilation phase and not in
+        # linking.  Such a scenario is extremely rare in practice.
+        #
+        # Even though use of the -pthread flag in linking would only print
+        # a warning, this can be a nuisance for well-run software projects
+        # that build with -Werror.  So if the active version of Clang has
+        # this misfeature, we search for an option to squash it.
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5
+$as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; }
+if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
+             # Create an alternate version of $ac_link that compiles and
+             # links in two steps (.c -> .o, .o -> exe) instead of one
+             # (.c -> exe), because the warning occurs only in the second
+             # step
+             ax_pthread_save_ac_link="$ac_link"
+             ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
+             ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
+             ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
+             ax_pthread_save_CFLAGS="$CFLAGS"
+             for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
+                if test "x$ax_pthread_try" = "xunknown"; then :
+  break
+fi
+                CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
+                ac_link="$ax_pthread_save_ac_link"
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$gdb_ptrace_headers
+int main(void){return 0;}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_link="$ax_pthread_2step_ac_link"
+                     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void){return 0;}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+             done
+             ac_link="$ax_pthread_save_ac_link"
+             CFLAGS="$ax_pthread_save_CFLAGS"
+             if test "x$ax_pthread_try" = "x"; then :
+  ax_pthread_try=no
+fi
+             ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5
+$as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; }
+
+        case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
+                no | unknown) ;;
+                *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
+        esac
+
+fi # $ax_pthread_clang = yes
+
+if test "x$ax_pthread_ok" = "xno"; then
+for ax_pthread_try_flag in $ax_pthread_flags; do
+
+        case $ax_pthread_try_flag in
+                none)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
+$as_echo_n "checking whether pthreads work without any flags... " >&6; }
+                ;;
+
+                -mt,pthread)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5
+$as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; }
+                PTHREAD_CFLAGS="-mt"
+                PTHREAD_LIBS="-lpthread"
+                ;;
+
+                -*)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5
+$as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; }
+                PTHREAD_CFLAGS="$ax_pthread_try_flag"
+                ;;
+
+                pthread-config)
+                # Extract the first word of "pthread-config", so it can be a program name with args.
+set dummy pthread-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ax_pthread_config+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ax_pthread_config"; then
+  ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ax_pthread_config="yes"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
+fi
+fi
+ax_pthread_config=$ac_cv_prog_ax_pthread_config
+if test -n "$ax_pthread_config"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
+$as_echo "$ax_pthread_config" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+                if test "x$ax_pthread_config" = "xno"; then :
+  continue
+fi
+                PTHREAD_CFLAGS="`pthread-config --cflags`"
+                PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+                ;;
+
+                *)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5
+$as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; }
+                PTHREAD_LIBS="-l$ax_pthread_try_flag"
+                ;;
+        esac
+
+        ax_pthread_save_CFLAGS="$CFLAGS"
+        ax_pthread_save_LIBS="$LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+#                       if $ax_pthread_check_cond
+#                        error "$ax_pthread_check_macro must be defined"
+#                       endif
+                        static void routine(void *a) { a = 0; }
+                        static void *start_routine(void *a) { return a; }
 int
 main ()
 {
-extern long ptrace (enum __ptrace_request, ...);
+pthread_t th; pthread_attr_t attr;
+                        pthread_create(&th, 0, start_routine, 0);
+                        pthread_join(th, 0);
+                        pthread_attr_init(&attr);
+                        pthread_cleanup_push(routine, 0);
+                        pthread_cleanup_pop(0) /* ; */
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_func_ptrace_ret='long'
+if ac_fn_c_try_link "$LINENO"; then :
+  ax_pthread_ok=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+        CFLAGS="$ax_pthread_save_CFLAGS"
+        LIBS="$ax_pthread_save_LIBS"
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+$as_echo "$ax_pthread_ok" >&6; }
+        if test "x$ax_pthread_ok" = "xyes"; then :
+  break
+fi
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ax_pthread_ok" = "xyes"; then
+        ax_pthread_save_CFLAGS="$CFLAGS"
+        ax_pthread_save_LIBS="$LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
+$as_echo_n "checking for joinable pthread attribute... " >&6; }
+if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ax_cv_PTHREAD_JOINABLE_ATTR=unknown
+             for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+                 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$gdb_ptrace_headers
+#include <pthread.h>
 int
 main ()
 {
-extern int ptrace ();
+int attr = $ax_pthread_attr; return attr /* ; */
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_func_ptrace_ret='int'
-else
-  gdb_cv_func_ptrace_ret='long'
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if ac_fn_c_try_link "$LINENO"; then :
+  ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+             done
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_ret" >&5
-$as_echo "$gdb_cv_func_ptrace_ret" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5
+$as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; }
+        if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
+               test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
+               test "x$ax_pthread_joinable_attr_defined" != "xyes"; then :
 
 cat >>confdefs.h <<_ACEOF
-#define PTRACE_TYPE_RET $gdb_cv_func_ptrace_ret
+#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR
 _ACEOF
 
-# Check argument types.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for ptrace" >&5
-$as_echo_n "checking types of arguments for ptrace... " >&6; }
-if ${gdb_cv_func_ptrace_args+:} false; then :
+               ax_pthread_joinable_attr_defined=yes
+
+fi
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5
+$as_echo_n "checking whether more special flags are required for pthreads... " >&6; }
+if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then :
   $as_echo_n "(cached) " >&6
 else
+  ax_cv_PTHREAD_SPECIAL_FLAGS=no
+             case $host_os in
+             solaris*)
+             ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
+             ;;
+             esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5
+$as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; }
+        if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
+               test "x$ax_pthread_special_flags_added" != "xyes"; then :
+  PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
+               ax_pthread_special_flags_added=yes
+fi
 
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5
+$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; }
+if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$gdb_ptrace_headers
+#include <pthread.h>
 int
 main ()
 {
-extern long ptrace (enum __ptrace_request, ...);
+int i = PTHREAD_PRIO_INHERIT;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_func_ptrace_args='enum __ptrace_request,int,long,long'
+if ac_fn_c_try_link "$LINENO"; then :
+  ax_cv_PTHREAD_PRIO_INHERIT=yes
 else
+  ax_cv_PTHREAD_PRIO_INHERIT=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
-for gdb_arg1 in 'int' 'long'; do
- for gdb_arg2 in 'pid_t' 'int' 'long'; do
-  for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
-   for gdb_arg4 in 'int' 'long' 'void *'; do
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$gdb_ptrace_headers
-int
-main ()
-{
-
-extern $gdb_cv_func_ptrace_ret
-  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4";
-    break 4;
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    for gdb_arg5 in 'int *' 'int' 'long'; do
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$gdb_ptrace_headers
-int
-main ()
-{
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
+$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; }
+        if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
+               test "x$ax_pthread_prio_inherit_defined" != "xyes"; then :
 
-extern $gdb_cv_func_ptrace_ret
-  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
+$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+               ax_pthread_prio_inherit_defined=yes
 
-gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
-    break 5;
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    done
-   done
-  done
- done
+
+        CFLAGS="$ax_pthread_save_CFLAGS"
+        LIBS="$ax_pthread_save_LIBS"
+
+        # More AIX lossage: compile with *_r variant
+        if test "x$GCC" != "xyes"; then
+            case $host_os in
+                aix*)
+                case "x/$CC" in #(
+  x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) :
+    #handle absolute path differently from PATH based program lookup
+                     case "x$CC" in #(
+  x/*) :
+    if as_fn_executable_p ${CC}_r; then :
+  PTHREAD_CC="${CC}_r"
+fi ;; #(
+  *) :
+    for ac_prog in ${CC}_r
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PTHREAD_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$PTHREAD_CC"; then
+  ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_PTHREAD_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
-# Provide a safe default value.
-: ${gdb_cv_func_ptrace_args='int,int,long,long'}
+  done
+IFS=$as_save_IFS
 
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_args" >&5
-$as_echo "$gdb_cv_func_ptrace_args" >&6; }
-ac_save_IFS=$IFS; IFS=','
-set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'`
-IFS=$ac_save_IFS
-shift
+PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
+if test -n "$PTHREAD_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
+$as_echo "$PTHREAD_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-cat >>confdefs.h <<_ACEOF
-#define PTRACE_TYPE_ARG1 $1
-_ACEOF
 
+  test -n "$PTHREAD_CC" && break
+done
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+ ;;
+esac ;; #(
+  *) :
+     ;;
+esac
+                ;;
+            esac
+        fi
+fi
 
-cat >>confdefs.h <<_ACEOF
-#define PTRACE_TYPE_ARG3 $3
-_ACEOF
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
 
 
-cat >>confdefs.h <<_ACEOF
-#define PTRACE_TYPE_ARG4 $4
-_ACEOF
 
-if test -n "$5"; then
 
-cat >>confdefs.h <<_ACEOF
-#define PTRACE_TYPE_ARG5 $5
-_ACEOF
 
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test "x$ax_pthread_ok" = "xyes"; then
+        threads=yes
+        :
+else
+        ax_pthread_ok=no
+        threads=no
 fi
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
-if test "$cross_compiling" = no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5
-$as_echo_n "checking whether setpgrp takes no argument... " >&6; }
-if ${ac_cv_func_setpgrp_void+:} false; then :
+  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
+$as_echo_n "checking for std::thread... " >&6; }
+if ${gdb_cv_cxx_std_thread+:} false; then :
   $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  as_fn_error $? "cannot check setpgrp when cross compiling" "$LINENO" 5
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
+#include <thread>
+      void callback() { }
 int
 main ()
 {
-/* If this system has a BSD-style setpgrp which takes arguments,
-  setpgrp(1, 1) will fail with ESRCH and return -1, in that case
-  exit successfully. */
-  return setpgrp (1,1) != -1;
+std::thread t(callback);
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_setpgrp_void=no
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  gdb_cv_cxx_std_thread=yes
 else
-  ac_cv_func_setpgrp_void=yes
+  gdb_cv_cxx_std_thread=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_cxx_std_thread" >&5
+$as_echo "$gdb_cv_cxx_std_thread" >&6; }
+
+    # This check must be here, while LIBS includes any necessary
+    # threading library.
+    for ac_func in pthread_sigmask pthread_setname_np
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5
-$as_echo "$ac_cv_func_setpgrp_void" >&6; }
-if test $ac_cv_func_setpgrp_void = yes; then
+done
 
-$as_echo "#define SETPGRP_VOID 1" >>confdefs.h
 
-fi
+    LIBS="$save_LIBS"
+    CXXFLAGS="$save_CXXFLAGS"
+  fi
+  if test $gdb_cv_cxx_std_thread = yes; then
 
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5
-$as_echo_n "checking whether setpgrp takes no argument... " >&6; }
-if ${ac_cv_func_setpgrp_void+:} false; then :
+$as_echo "#define CXX_STD_THREAD 1" >>confdefs.h
+
+  fi
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5
+$as_echo_n "checking for sigsetjmp... " >&6; }
+if ${gdb_cv_func_sigsetjmp+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <unistd.h>
+#include <setjmp.h>
 
 int
 main ()
 {
-
-  if (setpgrp(1,1) == -1)
-    exit (0);
-  else
-    exit (1);
-
+sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_func_setpgrp_void=no
+  gdb_cv_func_sigsetjmp=yes
 else
-  ac_cv_func_setpgrp_void=yes
+  gdb_cv_func_sigsetjmp=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5
-$as_echo "$ac_cv_func_setpgrp_void" >&6; }
-if test $ac_cv_func_setpgrp_void = yes; then
-  $as_echo "#define SETPGRP_VOID 1" >>confdefs.h
-
-fi
-fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_sigsetjmp" >&5
+$as_echo "$gdb_cv_func_sigsetjmp" >&6; }
+if test $gdb_cv_func_sigsetjmp = yes; then
 
-# Assume we'll default to using the included libiberty regex.
-gdb_use_included_regex=yes
+$as_echo "#define HAVE_SIGSETJMP 1" >>confdefs.h
 
-# However, if the system regex is GNU regex, then default to *not*
-# using the included regex.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU regex" >&5
-$as_echo_n "checking for GNU regex... " >&6; }
-if ${gdb_cv_have_gnu_regex+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <gnu-versions.h>
-int
-main ()
-{
-#define REGEX_INTERFACE_VERSION 1
-#if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION
-# error "Version mismatch"
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_have_gnu_regex=yes
-else
-  gdb_cv_have_gnu_regex=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_gnu_regex" >&5
-$as_echo "$gdb_cv_have_gnu_regex" >&6; }
-if test $gdb_cv_have_gnu_regex = yes; then
-  gdb_use_included_regex=no
 fi
 
 
-# Check whether --with-included-regex was given.
-if test "${with_included_regex+set}" = set; then :
-  withval=$with_included_regex; gdb_with_regex=$withval
-else
-  gdb_with_regex=$gdb_use_included_regex
-fi
+# Check the return and argument types of ptrace.
 
-if test "$gdb_with_regex" = yes; then
 
-$as_echo "#define USE_INCLUDED_REGEX 1" >>confdefs.h
+for ac_header in sys/ptrace.h ptrace.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
 fi
 
-# Check if <sys/proc.h> defines `struct thread' with a td_pcb member.
-ac_fn_c_check_member "$LINENO" "struct thread" "td_pcb" "ac_cv_member_struct_thread_td_pcb" "#include <sys/param.h>
-#include <sys/proc.h>
+done
 
+
+gdb_ptrace_headers='
+#include <sys/types.h>
+#if HAVE_SYS_PTRACE_H
+# include <sys/ptrace.h>
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+'
+# There is no point in checking if we don't have a prototype.
+ac_fn_c_check_decl "$LINENO" "ptrace" "ac_cv_have_decl_ptrace" "$gdb_ptrace_headers
 "
-if test "x$ac_cv_member_struct_thread_td_pcb" = xyes; then :
+if test "x$ac_cv_have_decl_ptrace" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_THREAD_TD_PCB 1
+#define HAVE_DECL_PTRACE $ac_have_decl
 _ACEOF
+if test $ac_have_decl = 1; then :
+
+else
 
+  : ${gdb_cv_func_ptrace_ret='int'}
+  : ${gdb_cv_func_ptrace_args='int,int,long,long'}
 
 fi
 
-
-# See if <sys/lwp.h> defines `struct lwp`.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct lwp" >&5
-$as_echo_n "checking for struct lwp... " >&6; }
-if ${gdb_cv_struct_lwp+:} false; then :
+# Check return type.  Varargs (used on GNU/Linux) conflict with the
+# empty argument list, so check for that explicitly.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of ptrace" >&5
+$as_echo_n "checking return type of ptrace... " >&6; }
+if ${gdb_cv_func_ptrace_ret+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/param.h>
-#define _KMEMUSER
-#include <sys/lwp.h>
+$gdb_ptrace_headers
 int
 main ()
 {
-struct lwp l;
+extern long ptrace (enum __ptrace_request, ...);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_struct_lwp=yes
-else
-  gdb_cv_struct_lwp=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_struct_lwp" >&5
-$as_echo "$gdb_cv_struct_lwp" >&6; }
-if test $gdb_cv_struct_lwp = yes; then
-
-$as_echo "#define HAVE_STRUCT_LWP 1" >>confdefs.h
-
-fi
-
-# See if <machine/reg.h> degines `struct reg'.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct reg in machine/reg.h" >&5
-$as_echo_n "checking for struct reg in machine/reg.h... " >&6; }
-if ${gdb_cv_struct_reg+:} false; then :
-  $as_echo_n "(cached) " >&6
+  gdb_cv_func_ptrace_ret='long'
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <machine/reg.h>
+$gdb_ptrace_headers
 int
 main ()
 {
-struct reg r;
+extern int ptrace ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_struct_reg=yes
+  gdb_cv_func_ptrace_ret='int'
 else
-  gdb_cv_struct_reg=no
+  gdb_cv_func_ptrace_ret='long'
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_struct_reg" >&5
-$as_echo "$gdb_cv_struct_reg" >&6; }
-if test $gdb_cv_struct_reg = yes; then
-
-$as_echo "#define HAVE_STRUCT_REG 1" >>confdefs.h
-
-fi
-
-# See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
-# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
-ac_fn_c_check_member "$LINENO" "struct reg" "r_fs" "ac_cv_member_struct_reg_r_fs" "#include <sys/types.h>
-#include <machine/reg.h>
-"
-if test "x$ac_cv_member_struct_reg_r_fs" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_REG_R_FS 1
-_ACEOF
-
-
-fi
-ac_fn_c_check_member "$LINENO" "struct reg" "r_gs" "ac_cv_member_struct_reg_r_gs" "#include <sys/types.h>
-#include <machine/reg.h>
-"
-if test "x$ac_cv_member_struct_reg_r_gs" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_REG_R_GS 1
-_ACEOF
-
-
-fi
-
-
-# See if <sys/user.h> supports the %fs_base and %gs_bas amd64 segment registers.
-# Older amd64 Linux's don't have the fs_base and gs_base members of
-# `struct user_regs_struct'.
-ac_fn_c_check_member "$LINENO" "struct user_regs_struct" "fs_base" "ac_cv_member_struct_user_regs_struct_fs_base" "#include <sys/types.h>
-#include <sys/user.h>
-"
-if test "x$ac_cv_member_struct_user_regs_struct_fs_base" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE 1
-_ACEOF
-
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-ac_fn_c_check_member "$LINENO" "struct user_regs_struct" "gs_base" "ac_cv_member_struct_user_regs_struct_gs_base" "#include <sys/types.h>
-#include <sys/user.h>
-"
-if test "x$ac_cv_member_struct_user_regs_struct_gs_base" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_ret" >&5
+$as_echo "$gdb_cv_func_ptrace_ret" >&6; }
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_USER_REGS_STRUCT_GS_BASE 1
+#define PTRACE_TYPE_RET $gdb_cv_func_ptrace_ret
 _ACEOF
 
-
-fi
-
-
-# See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTRACE_GETREGS" >&5
-$as_echo_n "checking for PTRACE_GETREGS... " >&6; }
-if ${gdb_cv_have_ptrace_getregs+:} false; then :
+# Check argument types.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for ptrace" >&5
+$as_echo_n "checking types of arguments for ptrace... " >&6; }
+if ${gdb_cv_func_ptrace_args+:} false; then :
   $as_echo_n "(cached) " >&6
 else
+
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/ptrace.h>
+$gdb_ptrace_headers
 int
 main ()
 {
-PTRACE_GETREGS;
+extern long ptrace (enum __ptrace_request, ...);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_have_ptrace_getregs=yes
+  gdb_cv_func_ptrace_args='enum __ptrace_request,int,long,long'
 else
-  gdb_cv_have_ptrace_getregs=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_ptrace_getregs" >&5
-$as_echo "$gdb_cv_have_ptrace_getregs" >&6; }
-if test $gdb_cv_have_ptrace_getregs = yes; then
-
-$as_echo "#define HAVE_PTRACE_GETREGS 1" >>confdefs.h
-
-fi
 
-# See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTRACE_GETFPXREGS" >&5
-$as_echo_n "checking for PTRACE_GETFPXREGS... " >&6; }
-if ${gdb_cv_have_ptrace_getfpxregs+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+for gdb_arg1 in 'int' 'long'; do
+ for gdb_arg2 in 'pid_t' 'int' 'long'; do
+  for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
+   for gdb_arg4 in 'int' 'long' 'void *'; do
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/ptrace.h>
+$gdb_ptrace_headers
 int
 main ()
 {
-PTRACE_GETFPXREGS;
+
+extern $gdb_cv_func_ptrace_ret
+  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_have_ptrace_getfpxregs=yes
-else
-  gdb_cv_have_ptrace_getfpxregs=no
+  gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4";
+    break 4;
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_ptrace_getfpxregs" >&5
-$as_echo "$gdb_cv_have_ptrace_getfpxregs" >&6; }
-if test $gdb_cv_have_ptrace_getfpxregs = yes; then
-
-$as_echo "#define HAVE_PTRACE_GETFPXREGS 1" >>confdefs.h
-
-fi
-
-# See if <sys/ptrace.h> provides the PT_GETDBREGS request.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PT_GETDBREGS" >&5
-$as_echo_n "checking for PT_GETDBREGS... " >&6; }
-if ${gdb_cv_have_pt_getdbregs+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    for gdb_arg5 in 'int *' 'int' 'long'; do
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/ptrace.h>
+$gdb_ptrace_headers
 int
 main ()
 {
-PT_GETDBREGS;
+
+extern $gdb_cv_func_ptrace_ret
+  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_have_pt_getdbregs=yes
-else
-  gdb_cv_have_pt_getdbregs=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_pt_getdbregs" >&5
-$as_echo "$gdb_cv_have_pt_getdbregs" >&6; }
-if test $gdb_cv_have_pt_getdbregs = yes; then
-
-$as_echo "#define HAVE_PT_GETDBREGS 1" >>confdefs.h
 
+gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
+    break 5;
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    done
+   done
+  done
+ done
+done
+# Provide a safe default value.
+: ${gdb_cv_func_ptrace_args='int,int,long,long'}
 
-# See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PT_GETXMMREGS" >&5
-$as_echo_n "checking for PT_GETXMMREGS... " >&6; }
-if ${gdb_cv_have_pt_getxmmregs+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/ptrace.h>
-int
-main ()
-{
-PT_GETXMMREGS;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_have_pt_getxmmregs=yes
-else
-  gdb_cv_have_pt_getxmmregs=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_args" >&5
+$as_echo "$gdb_cv_func_ptrace_args" >&6; }
+ac_save_IFS=$IFS; IFS=','
+set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'`
+IFS=$ac_save_IFS
+shift
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_pt_getxmmregs" >&5
-$as_echo "$gdb_cv_have_pt_getxmmregs" >&6; }
-if test $gdb_cv_have_pt_getxmmregs = yes; then
-
-$as_echo "#define HAVE_PT_GETXMMREGS 1" >>confdefs.h
-
-fi
+cat >>confdefs.h <<_ACEOF
+#define PTRACE_TYPE_ARG1 $1
+_ACEOF
 
-# See if <sys/ptrace.h> supports LWP names on FreeBSD
-# Older FreeBSD versions don't have the pl_tdname member of
-# `struct ptrace_lwpinfo'.
-ac_fn_c_check_member "$LINENO" "struct ptrace_lwpinfo" "pl_tdname" "ac_cv_member_struct_ptrace_lwpinfo_pl_tdname" "#include <sys/ptrace.h>
-"
-if test "x$ac_cv_member_struct_ptrace_lwpinfo_pl_tdname" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME 1
+#define PTRACE_TYPE_ARG3 $3
 _ACEOF
 
 
-fi
-
+cat >>confdefs.h <<_ACEOF
+#define PTRACE_TYPE_ARG4 $4
+_ACEOF
 
-# See if <sys/ptrace.h> supports syscall fields on FreeBSD.  The
-# pl_syscall_code member of `struct ptrace_lwpinfo' was added in
-# FreeBSD 10.3.
-ac_fn_c_check_member "$LINENO" "struct ptrace_lwpinfo" "pl_syscall_code" "ac_cv_member_struct_ptrace_lwpinfo_pl_syscall_code" "#include <sys/ptrace.h>
-"
-if test "x$ac_cv_member_struct_ptrace_lwpinfo_pl_syscall_code" = xyes; then :
+if test -n "$5"; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE 1
+#define PTRACE_TYPE_ARG5 $5
 _ACEOF
 
-
 fi
 
 
-if test "$ac_cv_header_sys_procfs_h" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gregset_t in sys/procfs.h" >&5
-$as_echo_n "checking for gregset_t in sys/procfs.h... " >&6; }
- if ${bfd_cv_have_sys_procfs_type_gregset_t+:} false; then :
+if test "$cross_compiling" = no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5
+$as_echo_n "checking whether setpgrp takes no argument... " >&6; }
+if ${ac_cv_func_setpgrp_void+:} false; then :
   $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  as_fn_error $? "cannot check setpgrp when cross compiling" "$LINENO" 5
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#define _SYSCALL32
-/* Needed for new procfs interface on sparc-solaris.  */
-#define _STRUCTURED_PROC 1
-#include <sys/procfs.h>
+$ac_includes_default
 int
 main ()
 {
-gregset_t avar
+/* If this system has a BSD-style setpgrp which takes arguments,
+  setpgrp(1, 1) will fail with ESRCH and return -1, in that case
+  exit successfully. */
+  return setpgrp (1,1) != -1;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  bfd_cv_have_sys_procfs_type_gregset_t=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_setpgrp_void=no
 else
-  bfd_cv_have_sys_procfs_type_gregset_t=no
-
+  ac_cv_func_setpgrp_void=yes
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
- if test $bfd_cv_have_sys_procfs_type_gregset_t = yes; then
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5
+$as_echo "$ac_cv_func_setpgrp_void" >&6; }
+if test $ac_cv_func_setpgrp_void = yes; then
 
-$as_echo "#define HAVE_GREGSET_T 1" >>confdefs.h
+$as_echo "#define SETPGRP_VOID 1" >>confdefs.h
 
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_gregset_t" >&5
-$as_echo "$bfd_cv_have_sys_procfs_type_gregset_t" >&6; }
+fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpregset_t in sys/procfs.h" >&5
-$as_echo_n "checking for fpregset_t in sys/procfs.h... " >&6; }
- if ${bfd_cv_have_sys_procfs_type_fpregset_t+:} false; then :
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5
+$as_echo_n "checking whether setpgrp takes no argument... " >&6; }
+if ${ac_cv_func_setpgrp_void+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#define _SYSCALL32
-/* Needed for new procfs interface on sparc-solaris.  */
-#define _STRUCTURED_PROC 1
-#include <sys/procfs.h>
+#include <unistd.h>
+
 int
 main ()
 {
-fpregset_t avar
+
+  if (setpgrp(1,1) == -1)
+    exit (0);
+  else
+    exit (1);
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  bfd_cv_have_sys_procfs_type_fpregset_t=yes
+  ac_cv_func_setpgrp_void=no
 else
-  bfd_cv_have_sys_procfs_type_fpregset_t=no
-
+  ac_cv_func_setpgrp_void=yes
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5
+$as_echo "$ac_cv_func_setpgrp_void" >&6; }
+if test $ac_cv_func_setpgrp_void = yes; then
+  $as_echo "#define SETPGRP_VOID 1" >>confdefs.h
 
- if test $bfd_cv_have_sys_procfs_type_fpregset_t = yes; then
-
-$as_echo "#define HAVE_FPREGSET_T 1" >>confdefs.h
+fi
+fi
 
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_fpregset_t" >&5
-$as_echo "$bfd_cv_have_sys_procfs_type_fpregset_t" >&6; }
+# Assume we'll default to using the included libiberty regex.
+gdb_use_included_regex=yes
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset_t in sys/procfs.h" >&5
-$as_echo_n "checking for prgregset_t in sys/procfs.h... " >&6; }
- if ${bfd_cv_have_sys_procfs_type_prgregset_t+:} false; then :
+# However, if the system regex is GNU regex, then default to *not*
+# using the included regex.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU regex" >&5
+$as_echo_n "checking for GNU regex... " >&6; }
+if ${gdb_cv_have_gnu_regex+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#define _SYSCALL32
-/* Needed for new procfs interface on sparc-solaris.  */
-#define _STRUCTURED_PROC 1
-#include <sys/procfs.h>
+#include <gnu-versions.h>
 int
 main ()
 {
-prgregset_t avar
+#define REGEX_INTERFACE_VERSION 1
+#if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION
+# error "Version mismatch"
+#endif
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  bfd_cv_have_sys_procfs_type_prgregset_t=yes
+  gdb_cv_have_gnu_regex=yes
 else
-  bfd_cv_have_sys_procfs_type_prgregset_t=no
-
+  gdb_cv_have_gnu_regex=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_gnu_regex" >&5
+$as_echo "$gdb_cv_have_gnu_regex" >&6; }
+if test $gdb_cv_have_gnu_regex = yes; then
+  gdb_use_included_regex=no
+fi
 
- if test $bfd_cv_have_sys_procfs_type_prgregset_t = yes; then
 
-$as_echo "#define HAVE_PRGREGSET_T 1" >>confdefs.h
+# Check whether --with-included-regex was given.
+if test "${with_included_regex+set}" = set; then :
+  withval=$with_included_regex; gdb_with_regex=$withval
+else
+  gdb_with_regex=$gdb_use_included_regex
+fi
 
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset_t" >&5
-$as_echo "$bfd_cv_have_sys_procfs_type_prgregset_t" >&6; }
+if test "$gdb_with_regex" = yes; then
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prfpregset_t in sys/procfs.h" >&5
-$as_echo_n "checking for prfpregset_t in sys/procfs.h... " >&6; }
- if ${bfd_cv_have_sys_procfs_type_prfpregset_t+:} false; then :
+$as_echo "#define USE_INCLUDED_REGEX 1" >>confdefs.h
+
+fi
+
+# Check if <sys/proc.h> defines `struct thread' with a td_pcb member.
+ac_fn_c_check_member "$LINENO" "struct thread" "td_pcb" "ac_cv_member_struct_thread_td_pcb" "#include <sys/param.h>
+#include <sys/proc.h>
+
+"
+if test "x$ac_cv_member_struct_thread_td_pcb" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_THREAD_TD_PCB 1
+_ACEOF
+
+
+fi
+
+
+# See if <sys/lwp.h> defines `struct lwp`.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct lwp" >&5
+$as_echo_n "checking for struct lwp... " >&6; }
+if ${gdb_cv_struct_lwp+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#define _SYSCALL32
-/* Needed for new procfs interface on sparc-solaris.  */
-#define _STRUCTURED_PROC 1
-#include <sys/procfs.h>
+#include <sys/param.h>
+#define _KMEMUSER
+#include <sys/lwp.h>
 int
 main ()
 {
-prfpregset_t avar
+struct lwp l;
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  bfd_cv_have_sys_procfs_type_prfpregset_t=yes
+  gdb_cv_struct_lwp=yes
 else
-  bfd_cv_have_sys_procfs_type_prfpregset_t=no
-
+  gdb_cv_struct_lwp=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_struct_lwp" >&5
+$as_echo "$gdb_cv_struct_lwp" >&6; }
+if test $gdb_cv_struct_lwp = yes; then
 
- if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
-
-$as_echo "#define HAVE_PRFPREGSET_T 1" >>confdefs.h
+$as_echo "#define HAVE_STRUCT_LWP 1" >>confdefs.h
 
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prfpregset_t" >&5
-$as_echo "$bfd_cv_have_sys_procfs_type_prfpregset_t" >&6; }
+fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset32_t in sys/procfs.h" >&5
-$as_echo_n "checking for prgregset32_t in sys/procfs.h... " >&6; }
- if ${bfd_cv_have_sys_procfs_type_prgregset32_t+:} false; then :
+# See if <machine/reg.h> degines `struct reg'.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct reg in machine/reg.h" >&5
+$as_echo_n "checking for struct reg in machine/reg.h... " >&6; }
+if ${gdb_cv_struct_reg+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#define _SYSCALL32
-/* Needed for new procfs interface on sparc-solaris.  */
-#define _STRUCTURED_PROC 1
-#include <sys/procfs.h>
+#include <sys/types.h>
+#include <machine/reg.h>
 int
 main ()
 {
-prgregset32_t avar
+struct reg r;
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  bfd_cv_have_sys_procfs_type_prgregset32_t=yes
+  gdb_cv_struct_reg=yes
 else
-  bfd_cv_have_sys_procfs_type_prgregset32_t=no
-
+  gdb_cv_struct_reg=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_struct_reg" >&5
+$as_echo "$gdb_cv_struct_reg" >&6; }
+if test $gdb_cv_struct_reg = yes; then
 
- if test $bfd_cv_have_sys_procfs_type_prgregset32_t = yes; then
+$as_echo "#define HAVE_STRUCT_REG 1" >>confdefs.h
 
-$as_echo "#define HAVE_PRGREGSET32_T 1" >>confdefs.h
+fi
 
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset32_t" >&5
-$as_echo "$bfd_cv_have_sys_procfs_type_prgregset32_t" >&6; }
+# See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
+# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
+ac_fn_c_check_member "$LINENO" "struct reg" "r_fs" "ac_cv_member_struct_reg_r_fs" "#include <sys/types.h>
+#include <machine/reg.h>
+"
+if test "x$ac_cv_member_struct_reg_r_fs" = xyes; then :
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpid_t in sys/procfs.h" >&5
-$as_echo_n "checking for lwpid_t in sys/procfs.h... " >&6; }
- if ${bfd_cv_have_sys_procfs_type_lwpid_t+:} false; then :
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_REG_R_FS 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct reg" "r_gs" "ac_cv_member_struct_reg_r_gs" "#include <sys/types.h>
+#include <machine/reg.h>
+"
+if test "x$ac_cv_member_struct_reg_r_gs" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_REG_R_GS 1
+_ACEOF
+
+
+fi
+
+
+# See if <sys/user.h> supports the %fs_base and %gs_bas amd64 segment registers.
+# Older amd64 Linux's don't have the fs_base and gs_base members of
+# `struct user_regs_struct'.
+ac_fn_c_check_member "$LINENO" "struct user_regs_struct" "fs_base" "ac_cv_member_struct_user_regs_struct_fs_base" "#include <sys/types.h>
+#include <sys/user.h>
+"
+if test "x$ac_cv_member_struct_user_regs_struct_fs_base" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct user_regs_struct" "gs_base" "ac_cv_member_struct_user_regs_struct_gs_base" "#include <sys/types.h>
+#include <sys/user.h>
+"
+if test "x$ac_cv_member_struct_user_regs_struct_gs_base" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_USER_REGS_STRUCT_GS_BASE 1
+_ACEOF
+
+
+fi
+
+
+# See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTRACE_GETREGS" >&5
+$as_echo_n "checking for PTRACE_GETREGS... " >&6; }
+if ${gdb_cv_have_ptrace_getregs+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#define _SYSCALL32
-/* Needed for new procfs interface on sparc-solaris.  */
-#define _STRUCTURED_PROC 1
-#include <sys/procfs.h>
+#include <sys/ptrace.h>
 int
 main ()
 {
-lwpid_t avar
+PTRACE_GETREGS;
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  bfd_cv_have_sys_procfs_type_lwpid_t=yes
+  gdb_cv_have_ptrace_getregs=yes
 else
-  bfd_cv_have_sys_procfs_type_lwpid_t=no
-
+  gdb_cv_have_ptrace_getregs=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
- if test $bfd_cv_have_sys_procfs_type_lwpid_t = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_ptrace_getregs" >&5
+$as_echo "$gdb_cv_have_ptrace_getregs" >&6; }
+if test $gdb_cv_have_ptrace_getregs = yes; then
 
-$as_echo "#define HAVE_LWPID_T 1" >>confdefs.h
+$as_echo "#define HAVE_PTRACE_GETREGS 1" >>confdefs.h
 
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_lwpid_t" >&5
-$as_echo "$bfd_cv_have_sys_procfs_type_lwpid_t" >&6; }
+fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psaddr_t in sys/procfs.h" >&5
-$as_echo_n "checking for psaddr_t in sys/procfs.h... " >&6; }
- if ${bfd_cv_have_sys_procfs_type_psaddr_t+:} false; then :
+# See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTRACE_GETFPXREGS" >&5
+$as_echo_n "checking for PTRACE_GETFPXREGS... " >&6; }
+if ${gdb_cv_have_ptrace_getfpxregs+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#define _SYSCALL32
-/* Needed for new procfs interface on sparc-solaris.  */
-#define _STRUCTURED_PROC 1
-#include <sys/procfs.h>
+#include <sys/ptrace.h>
 int
 main ()
 {
-psaddr_t avar
+PTRACE_GETFPXREGS;
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  bfd_cv_have_sys_procfs_type_psaddr_t=yes
+  gdb_cv_have_ptrace_getfpxregs=yes
 else
-  bfd_cv_have_sys_procfs_type_psaddr_t=no
-
+  gdb_cv_have_ptrace_getfpxregs=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
- if test $bfd_cv_have_sys_procfs_type_psaddr_t = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_ptrace_getfpxregs" >&5
+$as_echo "$gdb_cv_have_ptrace_getfpxregs" >&6; }
+if test $gdb_cv_have_ptrace_getfpxregs = yes; then
 
-$as_echo "#define HAVE_PSADDR_T 1" >>confdefs.h
+$as_echo "#define HAVE_PTRACE_GETFPXREGS 1" >>confdefs.h
 
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_psaddr_t" >&5
-$as_echo "$bfd_cv_have_sys_procfs_type_psaddr_t" >&6; }
+fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_fpregset_t in sys/procfs.h" >&5
-$as_echo_n "checking for elf_fpregset_t in sys/procfs.h... " >&6; }
- if ${bfd_cv_have_sys_procfs_type_elf_fpregset_t+:} false; then :
+# See if <sys/ptrace.h> provides the PT_GETDBREGS request.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PT_GETDBREGS" >&5
+$as_echo_n "checking for PT_GETDBREGS... " >&6; }
+if ${gdb_cv_have_pt_getdbregs+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#define _SYSCALL32
-/* Needed for new procfs interface on sparc-solaris.  */
-#define _STRUCTURED_PROC 1
-#include <sys/procfs.h>
+#include <sys/types.h>
+#include <sys/ptrace.h>
 int
 main ()
 {
-elf_fpregset_t avar
+PT_GETDBREGS;
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  bfd_cv_have_sys_procfs_type_elf_fpregset_t=yes
+  gdb_cv_have_pt_getdbregs=yes
 else
-  bfd_cv_have_sys_procfs_type_elf_fpregset_t=no
-
+  gdb_cv_have_pt_getdbregs=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
- if test $bfd_cv_have_sys_procfs_type_elf_fpregset_t = yes; then
-
-$as_echo "#define HAVE_ELF_FPREGSET_T 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_pt_getdbregs" >&5
+$as_echo "$gdb_cv_have_pt_getdbregs" >&6; }
+if test $gdb_cv_have_pt_getdbregs = yes; then
 
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&5
-$as_echo "$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6; }
+$as_echo "#define HAVE_PT_GETDBREGS 1" >>confdefs.h
 
 fi
 
-# Check if the compiler supports the `long long' type.
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long support in compiler" >&5
-$as_echo_n "checking for long long support in compiler... " >&6; }
-if ${gdb_cv_c_long_long+:} false; then :
+# See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PT_GETXMMREGS" >&5
+$as_echo_n "checking for PT_GETXMMREGS... " >&6; }
+if ${gdb_cv_have_pt_getxmmregs+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-extern long long foo;
+#include <sys/types.h>
+#include <sys/ptrace.h>
 int
 main ()
 {
-switch (foo & 2) { case 0: return 1; }
+PT_GETXMMREGS;
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_c_long_long=yes
+  gdb_cv_have_pt_getxmmregs=yes
 else
-  gdb_cv_c_long_long=no
+  gdb_cv_have_pt_getxmmregs=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_c_long_long" >&5
-$as_echo "$gdb_cv_c_long_long" >&6; }
-if test $gdb_cv_c_long_long != yes; then
-  # libdecnumber requires long long.
-  as_fn_error $? "Compiler must support long long for GDB." "$LINENO" 5
-fi
 
-# Check if the compiler and runtime support printing long longs.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_pt_getxmmregs" >&5
+$as_echo "$gdb_cv_have_pt_getxmmregs" >&6; }
+if test $gdb_cv_have_pt_getxmmregs = yes; then
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long support in printf" >&5
-$as_echo_n "checking for long long support in printf... " >&6; }
-if ${gdb_cv_printf_has_long_long+:} false; then :
+$as_echo "#define HAVE_PT_GETXMMREGS 1" >>confdefs.h
+
+fi
+
+# See if <sys/ptrace.h> supports LWP names on FreeBSD
+# Older FreeBSD versions don't have the pl_tdname member of
+# `struct ptrace_lwpinfo'.
+ac_fn_c_check_member "$LINENO" "struct ptrace_lwpinfo" "pl_tdname" "ac_cv_member_struct_ptrace_lwpinfo_pl_tdname" "#include <sys/ptrace.h>
+"
+if test "x$ac_cv_member_struct_ptrace_lwpinfo_pl_tdname" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME 1
+_ACEOF
+
+
+fi
+
+
+# See if <sys/ptrace.h> supports syscall fields on FreeBSD.  The
+# pl_syscall_code member of `struct ptrace_lwpinfo' was added in
+# FreeBSD 10.3.
+ac_fn_c_check_member "$LINENO" "struct ptrace_lwpinfo" "pl_syscall_code" "ac_cv_member_struct_ptrace_lwpinfo_pl_syscall_code" "#include <sys/ptrace.h>
+"
+if test "x$ac_cv_member_struct_ptrace_lwpinfo_pl_syscall_code" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE 1
+_ACEOF
+
+
+fi
+
+
+if test "$ac_cv_header_sys_procfs_h" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gregset_t in sys/procfs.h" >&5
+$as_echo_n "checking for gregset_t in sys/procfs.h... " >&6; }
+ if ${bfd_cv_have_sys_procfs_type_gregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  gdb_cv_printf_has_long_long=no
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
+
+#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris.  */
+#define _STRUCTURED_PROC 1
+#include <sys/procfs.h>
 int
 main ()
 {
-char buf[32];
-  long long l = 0;
-  l = (l << 16) + 0x0123;
-  l = (l << 16) + 0x4567;
-  l = (l << 16) + 0x89ab;
-  l = (l << 16) + 0xcdef;
-  sprintf (buf, "0x%016llx", l);
-  return (strcmp ("0x0123456789abcdef", buf));
+gregset_t avar
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gdb_cv_printf_has_long_long=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  bfd_cv_have_sys_procfs_type_gregset_t=yes
 else
-  gdb_cv_printf_has_long_long=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+  bfd_cv_have_sys_procfs_type_gregset_t=no
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_printf_has_long_long" >&5
-$as_echo "$gdb_cv_printf_has_long_long" >&6; }
-if test $gdb_cv_printf_has_long_long = yes; then
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
-$as_echo "#define PRINTF_HAS_LONG_LONG 1" >>confdefs.h
+ if test $bfd_cv_have_sys_procfs_type_gregset_t = yes; then
 
-fi
+$as_echo "#define HAVE_GREGSET_T 1" >>confdefs.h
 
-# Check if the compiler and runtime support printing decfloats.
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_gregset_t" >&5
+$as_echo "$bfd_cv_have_sys_procfs_type_gregset_t" >&6; }
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for decfloat support in printf" >&5
-$as_echo_n "checking for decfloat support in printf... " >&6; }
-if ${gdb_cv_printf_has_decfloat+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpregset_t in sys/procfs.h" >&5
+$as_echo_n "checking for fpregset_t in sys/procfs.h... " >&6; }
+ if ${bfd_cv_have_sys_procfs_type_fpregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  gdb_cv_printf_has_decfloat=no
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
+
+#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris.  */
+#define _STRUCTURED_PROC 1
+#include <sys/procfs.h>
 int
 main ()
 {
-char buf[64];
-  _Decimal32 d32 = 1.2345df;
-  _Decimal64 d64 = 1.2345dd;
-  _Decimal128 d128 = 1.2345dl;
-  sprintf (buf, "Decimal32: %H\nDecimal64: %D\nDecimal128: %DD", d32, d64, d128);
-  return (strcmp ("Decimal32: 1.2345\nDecimal64: 1.2345\nDecimal128: 1.2345", buf));
+fpregset_t avar
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gdb_cv_printf_has_decfloat=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  bfd_cv_have_sys_procfs_type_fpregset_t=yes
 else
-  gdb_cv_printf_has_decfloat=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+  bfd_cv_have_sys_procfs_type_fpregset_t=no
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_printf_has_decfloat" >&5
-$as_echo "$gdb_cv_printf_has_decfloat" >&6; }
-if test $gdb_cv_printf_has_decfloat = yes; then
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
-$as_echo "#define PRINTF_HAS_DECFLOAT 1" >>confdefs.h
+ if test $bfd_cv_have_sys_procfs_type_fpregset_t = yes; then
 
-fi
+$as_echo "#define HAVE_FPREGSET_T 1" >>confdefs.h
 
-# Check if the compiler supports the `long double' type.  We can't use
-# AC_C_LONG_DOUBLE because that one does additional checks on the
-# constants defined in <float.h> that fail on some systems,
-# e.g. FreeBSD/i386 4.7 and OpenBSD/i386 3.6.
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_fpregset_t" >&5
+$as_echo "$bfd_cv_have_sys_procfs_type_fpregset_t" >&6; }
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support in compiler" >&5
-$as_echo_n "checking for long double support in compiler... " >&6; }
-if ${gdb_cv_c_long_double+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset_t in sys/procfs.h" >&5
+$as_echo_n "checking for prgregset_t in sys/procfs.h... " >&6; }
+ if ${bfd_cv_have_sys_procfs_type_prgregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-long double foo;
+
+#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris.  */
+#define _STRUCTURED_PROC 1
+#include <sys/procfs.h>
+int
+main ()
+{
+prgregset_t avar
+  ;
+  return 0;
+}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_c_long_double=yes
+  bfd_cv_have_sys_procfs_type_prgregset_t=yes
 else
-  gdb_cv_c_long_double=no
+  bfd_cv_have_sys_procfs_type_prgregset_t=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_c_long_double" >&5
-$as_echo "$gdb_cv_c_long_double" >&6; }
-if test $gdb_cv_c_long_double = yes; then
 
-$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
+ if test $bfd_cv_have_sys_procfs_type_prgregset_t = yes; then
 
-fi
+$as_echo "#define HAVE_PRGREGSET_T 1" >>confdefs.h
 
-# Check if the compiler and runtime support printing long doubles.
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset_t" >&5
+$as_echo "$bfd_cv_have_sys_procfs_type_prgregset_t" >&6; }
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support in printf" >&5
-$as_echo_n "checking for long double support in printf... " >&6; }
-if ${gdb_cv_printf_has_long_double+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prfpregset_t in sys/procfs.h" >&5
+$as_echo_n "checking for prfpregset_t in sys/procfs.h... " >&6; }
+ if ${bfd_cv_have_sys_procfs_type_prfpregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  gdb_cv_printf_has_long_double=no
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
+
+#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris.  */
+#define _STRUCTURED_PROC 1
+#include <sys/procfs.h>
 int
 main ()
 {
-char buf[16];
-  long double f = 3.141592653;
-  sprintf (buf, "%Lg", f);
-  return (strncmp ("3.14159", buf, 7));
+prfpregset_t avar
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gdb_cv_printf_has_long_double=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  bfd_cv_have_sys_procfs_type_prfpregset_t=yes
 else
-  gdb_cv_printf_has_long_double=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+  bfd_cv_have_sys_procfs_type_prfpregset_t=no
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_printf_has_long_double" >&5
-$as_echo "$gdb_cv_printf_has_long_double" >&6; }
-if test $gdb_cv_printf_has_long_double = yes; then
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
-$as_echo "#define PRINTF_HAS_LONG_DOUBLE 1" >>confdefs.h
+ if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
 
-fi
+$as_echo "#define HAVE_PRFPREGSET_T 1" >>confdefs.h
 
-# Check if the compiler and runtime support scanning long doubles.
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prfpregset_t" >&5
+$as_echo "$bfd_cv_have_sys_procfs_type_prfpregset_t" >&6; }
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support in scanf" >&5
-$as_echo_n "checking for long double support in scanf... " >&6; }
-if ${gdb_cv_scanf_has_long_double+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset32_t in sys/procfs.h" >&5
+$as_echo_n "checking for prgregset32_t in sys/procfs.h... " >&6; }
+ if ${bfd_cv_have_sys_procfs_type_prgregset32_t+:} false; then :
   $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  gdb_cv_scanf_has_long_double=no
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdio.h>
+
+#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris.  */
+#define _STRUCTURED_PROC 1
+#include <sys/procfs.h>
 int
 main ()
 {
-char *buf = "3.141592653";
-  long double f = 0;
-  sscanf (buf, "%Lg", &f);
-  return !(f > 3.14159 && f < 3.14160);
+prgregset32_t avar
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gdb_cv_scanf_has_long_double=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  bfd_cv_have_sys_procfs_type_prgregset32_t=yes
 else
-  gdb_cv_scanf_has_long_double=no
+  bfd_cv_have_sys_procfs_type_prgregset32_t=no
+
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_scanf_has_long_double" >&5
-$as_echo "$gdb_cv_scanf_has_long_double" >&6; }
-if test $gdb_cv_scanf_has_long_double = yes; then
+ if test $bfd_cv_have_sys_procfs_type_prgregset32_t = yes; then
 
-$as_echo "#define SCANF_HAS_LONG_DOUBLE 1" >>confdefs.h
+$as_echo "#define HAVE_PRGREGSET32_T 1" >>confdefs.h
 
-fi
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset32_t" >&5
+$as_echo "$bfd_cv_have_sys_procfs_type_prgregset32_t" >&6; }
 
-case ${host_os} in
-aix*)
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -bbigtoc option" >&5
-$as_echo_n "checking for -bbigtoc option... " >&6; }
-if ${gdb_cv_bigtoc+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpid_t in sys/procfs.h" >&5
+$as_echo_n "checking for lwpid_t in sys/procfs.h... " >&6; }
+ if ${bfd_cv_have_sys_procfs_type_lwpid_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-
-    SAVE_LDFLAGS=$LDFLAGS
-
-    case $GCC in
-    yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
-    *) gdb_cv_bigtoc=-bbigtoc ;;
-    esac
-
-    LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris.  */
+#define _STRUCTURED_PROC 1
+#include <sys/procfs.h>
 int
 main ()
 {
-int i;
+lwpid_t avar
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
+if ac_fn_c_try_compile "$LINENO"; then :
+  bfd_cv_have_sys_procfs_type_lwpid_t=yes
 else
-  gdb_cv_bigtoc=
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    LDFLAGS="${SAVE_LDFLAGS}"
+  bfd_cv_have_sys_procfs_type_lwpid_t=no
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_bigtoc" >&5
-$as_echo "$gdb_cv_bigtoc" >&6; }
-  CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}"
-  ;;
-esac
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the dynamic export flag" >&5
-$as_echo_n "checking for the dynamic export flag... " >&6; }
-dynamic_list=false
-if test "${gdb_native}" = yes; then
-   # The dynamically loaded libthread_db needs access to symbols in the gdb
-   # executable.  Older GNU ld supports --export-dynamic but --dynamic-list
-   # may not be supported there.
-   old_LDFLAGS="$LDFLAGS"
-   # Older GNU ld supports --export-dynamic but --dynamic-list it does not.
-   RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list"
-   LDFLAGS="$LDFLAGS $RDYNAMIC"
-   if test "${have_libpython}" = no; then
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+ if test $bfd_cv_have_sys_procfs_type_lwpid_t = yes; then
 
-int
-main ()
-{
+$as_echo "#define HAVE_LWPID_T 1" >>confdefs.h
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  dynamic_list=true
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-   else
-     # Workaround http://bugs.python.org/issue4434 where static
-     # libpythonX.Y.a would get its symbols required for
-     # pythonX.Y/lib-dynload/*.so modules hidden by -Wl,--dynamic-list.
-     # Problem does not happen for the recommended libpythonX.Y.so linkage.
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_lwpid_t" >&5
+$as_echo "$bfd_cv_have_sys_procfs_type_lwpid_t" >&6; }
 
-     # Note the workaround for Python
-     # http://bugs.python.org/issue10112 earlier has removed
-     # -export-dynamic from PYTHON_LIBS.  That's exactly what we want
-     # here too, as otherwise it'd make this -Wl,--dynamic-list test
-     # always pass.
-     old_CFLAGS="$CFLAGS"
-     CFLAGS="$CFLAGS $PYTHON_CFLAGS"
-     old_LIBS="$LIBS"
-     LIBS="$LIBS $PYTHON_LIBS"
-     old_CPPFLAGS="$CPPFLAGS"
-     CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
-     if test "$cross_compiling" = yes; then :
-  true
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psaddr_t in sys/procfs.h" >&5
+$as_echo_n "checking for psaddr_t in sys/procfs.h... " >&6; }
+ if ${bfd_cv_have_sys_procfs_type_psaddr_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include "Python.h"
+
+#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris.  */
+#define _STRUCTURED_PROC 1
+#include <sys/procfs.h>
 int
 main ()
 {
-int err;
-          Py_Initialize ();
-          err = PyRun_SimpleString ("import itertools\n");
-          Py_Finalize ();
-          return err == 0 ? 0 : 1;
+psaddr_t avar
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  dynamic_list=true
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+if ac_fn_c_try_compile "$LINENO"; then :
+  bfd_cv_have_sys_procfs_type_psaddr_t=yes
+else
+  bfd_cv_have_sys_procfs_type_psaddr_t=no
 
-     LIBS="$old_LIBS"
-     CFLAGS="$old_CFLAGS"
-     CPPFLAGS="$old_CPPFLAGS"
-   fi
-   LDFLAGS="$old_LDFLAGS"
 fi
-if $dynamic_list; then
-  found="-Wl,--dynamic-list"
-  RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'
-else
-  found="-rdynamic"
-  RDYNAMIC="-rdynamic"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5
-$as_echo "$found" >&6; }
+ if test $bfd_cv_have_sys_procfs_type_psaddr_t = yes; then
 
+$as_echo "#define HAVE_PSADDR_T 1" >>confdefs.h
 
-if test ${build} = ${host} -a ${host} = ${target} ; then
-   case ${host_os} in
-   aix*)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AiX thread debugging library" >&5
-$as_echo_n "checking for AiX thread debugging library... " >&6; }
-      if ${gdb_cv_have_aix_thread_debug+:} false; then :
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_psaddr_t" >&5
+$as_echo "$bfd_cv_have_sys_procfs_type_psaddr_t" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_fpregset_t in sys/procfs.h" >&5
+$as_echo_n "checking for elf_fpregset_t in sys/procfs.h... " >&6; }
+ if ${bfd_cv_have_sys_procfs_type_elf_fpregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/pthdebug.h>
+
+#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris.  */
+#define _STRUCTURED_PROC 1
+#include <sys/procfs.h>
 int
 main ()
 {
-#ifndef PTHDB_VERSION_3
-                                    #error
-                                    #endif
+elf_fpregset_t avar
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_have_aix_thread_debug=yes
+  bfd_cv_have_sys_procfs_type_elf_fpregset_t=yes
 else
-  gdb_cv_have_aix_thread_debug=no
+  bfd_cv_have_sys_procfs_type_elf_fpregset_t=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_aix_thread_debug" >&5
-$as_echo "$gdb_cv_have_aix_thread_debug" >&6; }
-      if test $gdb_cv_have_aix_thread_debug = yes; then
-         CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c"
-         CONFIG_OBS="${CONFIG_OBS} aix-thread.o"
-         LIBS="$LIBS -lpthdebug"
-
-         # Older versions of AIX do not provide the declaration for
-         # the getthrds function (it appears that it was introduced
-         # with AIX 6.x).
-         ac_fn_c_check_decl "$LINENO" "getthrds" "ac_cv_have_decl_getthrds" "#include <procinfo.h>
-"
-if test "x$ac_cv_have_decl_getthrds" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+ if test $bfd_cv_have_sys_procfs_type_elf_fpregset_t = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETTHRDS $ac_have_decl
-_ACEOF
+$as_echo "#define HAVE_ELF_FPREGSET_T 1" >>confdefs.h
 
     fi
-      ;;
-   esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&5
+$as_echo "$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6; }
 
 fi
 
-if test "x$ac_cv_header_thread_db_h" = "xyes"; then
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <thread_db.h> has TD_NOTALLOC" >&5
-$as_echo_n "checking whether <thread_db.h> has TD_NOTALLOC... " >&6; }
-if ${gdb_cv_thread_db_h_has_td_notalloc+:} false; then :
+# Check if the compiler supports the `long long' type.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long support in compiler" >&5
+$as_echo_n "checking for long long support in compiler... " >&6; }
+if ${gdb_cv_c_long_long+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <thread_db.h>
+extern long long foo;
 int
 main ()
 {
-int i = TD_NOTALLOC;
+switch (foo & 2) { case 0: return 1; }
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_thread_db_h_has_td_notalloc=yes
+  gdb_cv_c_long_long=yes
 else
-  gdb_cv_thread_db_h_has_td_notalloc=no
-
+  gdb_cv_c_long_long=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_thread_db_h_has_td_notalloc" >&5
-$as_echo "$gdb_cv_thread_db_h_has_td_notalloc" >&6; }
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <thread_db.h> has TD_VERSION" >&5
-$as_echo_n "checking whether <thread_db.h> has TD_VERSION... " >&6; }
-if ${gdb_cv_thread_db_h_has_td_version+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_c_long_long" >&5
+$as_echo "$gdb_cv_c_long_long" >&6; }
+if test $gdb_cv_c_long_long != yes; then
+  # libdecnumber requires long long.
+  as_fn_error $? "Compiler must support long long for GDB." "$LINENO" 5
+fi
+
+# Check if the compiler and runtime support printing long longs.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long support in printf" >&5
+$as_echo_n "checking for long long support in printf... " >&6; }
+if ${gdb_cv_printf_has_long_long+:} false; then :
   $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  gdb_cv_printf_has_long_long=no
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <thread_db.h>
+$ac_includes_default
 int
 main ()
 {
-int i = TD_VERSION;
+char buf[32];
+  long long l = 0;
+  l = (l << 16) + 0x0123;
+  l = (l << 16) + 0x4567;
+  l = (l << 16) + 0x89ab;
+  l = (l << 16) + 0xcdef;
+  sprintf (buf, "0x%016llx", l);
+  return (strcmp ("0x0123456789abcdef", buf));
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_thread_db_h_has_td_version=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  gdb_cv_printf_has_long_long=yes
 else
-  gdb_cv_thread_db_h_has_td_version=no
+  gdb_cv_printf_has_long_long=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_printf_has_long_long" >&5
+$as_echo "$gdb_cv_printf_has_long_long" >&6; }
+if test $gdb_cv_printf_has_long_long = yes; then
+
+$as_echo "#define PRINTF_HAS_LONG_LONG 1" >>confdefs.h
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_thread_db_h_has_td_version" >&5
-$as_echo "$gdb_cv_thread_db_h_has_td_version" >&6; }
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <thread_db.h> has TD_NOTLS" >&5
-$as_echo_n "checking whether <thread_db.h> has TD_NOTLS... " >&6; }
-if ${gdb_cv_thread_db_h_has_td_notls+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <thread_db.h>
+
+# Check if the compiler and runtime support printing decfloats.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for decfloat support in printf" >&5
+$as_echo_n "checking for decfloat support in printf... " >&6; }
+if ${gdb_cv_printf_has_decfloat+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  gdb_cv_printf_has_decfloat=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
 int
 main ()
 {
-int i = TD_NOTLS;
+char buf[64];
+  _Decimal32 d32 = 1.2345df;
+  _Decimal64 d64 = 1.2345dd;
+  _Decimal128 d128 = 1.2345dl;
+  sprintf (buf, "Decimal32: %H\nDecimal64: %D\nDecimal128: %DD", d32, d64, d128);
+  return (strcmp ("Decimal32: 1.2345\nDecimal64: 1.2345\nDecimal128: 1.2345", buf));
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_thread_db_h_has_td_notls=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  gdb_cv_printf_has_decfloat=yes
 else
-  gdb_cv_thread_db_h_has_td_notls=no
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
+  gdb_cv_printf_has_decfloat=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_thread_db_h_has_td_notls" >&5
-$as_echo "$gdb_cv_thread_db_h_has_td_notls" >&6; }
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then
-
-$as_echo "#define THREAD_DB_HAS_TD_NOTALLOC 1" >>confdefs.h
 
 fi
-if test "x$gdb_cv_thread_db_h_has_td_version" = "xyes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_printf_has_decfloat" >&5
+$as_echo "$gdb_cv_printf_has_decfloat" >&6; }
+if test $gdb_cv_printf_has_decfloat = yes; then
 
-$as_echo "#define THREAD_DB_HAS_TD_VERSION 1" >>confdefs.h
+$as_echo "#define PRINTF_HAS_DECFLOAT 1" >>confdefs.h
 
 fi
-if test "x$gdb_cv_thread_db_h_has_td_notls" = "xyes"; then
-
-$as_echo "#define THREAD_DB_HAS_TD_NOTLS 1" >>confdefs.h
 
-fi
+# Check if the compiler supports the `long double' type.  We can't use
+# AC_C_LONG_DOUBLE because that one does additional checks on the
+# constants defined in <float.h> that fail on some systems,
+# e.g. FreeBSD/i386 4.7 and OpenBSD/i386 3.6.
 
-ac_fn_c_check_decl "$LINENO" "ADDR_NO_RANDOMIZE" "ac_cv_have_decl_ADDR_NO_RANDOMIZE" "#include <sys/personality.h>
-"
-if test "x$ac_cv_have_decl_ADDR_NO_RANDOMIZE" = xyes; then :
-  ac_have_decl=1
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support in compiler" >&5
+$as_echo_n "checking for long double support in compiler... " >&6; }
+if ${gdb_cv_c_long_double+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_have_decl=0
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+long double foo;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_c_long_double=yes
+else
+  gdb_cv_c_long_double=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_c_long_double" >&5
+$as_echo "$gdb_cv_c_long_double" >&6; }
+if test $gdb_cv_c_long_double = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ADDR_NO_RANDOMIZE $ac_have_decl
-_ACEOF
+$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
 
+fi
 
-if test "$cross_compiling" = yes; then :
+# Check if the compiler and runtime support printing long doubles.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support in printf" >&5
+$as_echo_n "checking for long double support in printf... " >&6; }
+if ${gdb_cv_printf_has_long_double+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  gdb_cv_printf_has_long_double=no
+else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/personality.h>
+$ac_includes_default
 int
 main ()
 {
-
-#      if !HAVE_DECL_ADDR_NO_RANDOMIZE
-#       define ADDR_NO_RANDOMIZE 0x0040000
-#      endif
-       /* Test the flag could be set and stays set.  */
-       personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE);
-       if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE))
-          return 1
+char buf[16];
+  long double f = 3.141592653;
+  sprintf (buf, "%Lg", f);
+  return (strncmp ("3.14159", buf, 7));
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  have_personality=true
+if ac_fn_c_try_run "$LINENO"; then :
+  gdb_cv_printf_has_long_double=yes
 else
-  have_personality=false
+  gdb_cv_printf_has_long_double=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_printf_has_long_double" >&5
+$as_echo "$gdb_cv_printf_has_long_double" >&6; }
+if test $gdb_cv_printf_has_long_double = yes; then
+
+$as_echo "#define PRINTF_HAS_LONG_DOUBLE 1" >>confdefs.h
+
+fi
+
+# Check if the compiler and runtime support scanning long doubles.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support in scanf" >&5
+$as_echo_n "checking for long double support in scanf... " >&6; }
+if ${gdb_cv_scanf_has_long_double+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  gdb_cv_scanf_has_long_double=no
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/personality.h>
+#include <stdio.h>
 int
 main ()
 {
-
-#      if !HAVE_DECL_ADDR_NO_RANDOMIZE
-#       define ADDR_NO_RANDOMIZE 0x0040000
-#      endif
-       /* Test the flag could be set and stays set.  */
-       personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE);
-       if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE))
-          return 1
+char *buf = "3.141592653";
+  long double f = 0;
+  sscanf (buf, "%Lg", &f);
+  return !(f > 3.14159 && f < 3.14160);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  have_personality=true
+  gdb_cv_scanf_has_long_double=yes
 else
-  have_personality=false
+  gdb_cv_scanf_has_long_double=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-if $have_personality
-then
-
-$as_echo "#define HAVE_PERSONALITY 1" >>confdefs.h
-
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_scanf_has_long_double" >&5
+$as_echo "$gdb_cv_scanf_has_long_double" >&6; }
+if test $gdb_cv_scanf_has_long_double = yes; then
 
-case $host_os in
-  go32* | *djgpp*)
-    gdbinit=gdb.ini
-    ;;
-  *)
-    gdbinit=.gdbinit
-    ;;
-esac
-
-cat >>confdefs.h <<_ACEOF
-#define GDBINIT "$gdbinit"
-_ACEOF
-
-
+$as_echo "#define SCANF_HAS_LONG_DOUBLE 1" >>confdefs.h
 
-# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
-# except that the argument to --with-sysroot is optional.
-# --with-sysroot (or --with-sysroot=yes) sets the default sysroot path.
-if test "x$with_sysroot" = xyes; then
-  with_sysroot="${exec_prefix}/${target_alias}/sys-root"
 fi
 
-# Check whether --with-sysroot was given.
-if test "${with_sysroot+set}" = set; then :
-  withval=$with_sysroot; TARGET_SYSTEM_ROOT=$withval
+case ${host_os} in
+aix*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -bbigtoc option" >&5
+$as_echo_n "checking for -bbigtoc option... " >&6; }
+if ${gdb_cv_bigtoc+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  TARGET_SYSTEM_ROOT=
-fi
-
-
-  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
-  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-  ac_define_dir=`eval echo $TARGET_SYSTEM_ROOT`
-  ac_define_dir=`eval echo $ac_define_dir`
-
-cat >>confdefs.h <<_ACEOF
-#define TARGET_SYSTEM_ROOT "$ac_define_dir"
-_ACEOF
-
 
+    SAVE_LDFLAGS=$LDFLAGS
 
+    case $GCC in
+    yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
+    *) gdb_cv_bigtoc=-bbigtoc ;;
+    esac
 
-  if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
-     if test "x$prefix" = xNONE; then
-       test_prefix=/usr/local
-     else
-       test_prefix=$prefix
-     fi
-  else
-     test_prefix=$exec_prefix
-  fi
-  value=0
-  case ${ac_define_dir} in
-     "${test_prefix}"|"${test_prefix}/"*|\
-       '${exec_prefix}'|'${exec_prefix}/'*)
-     value=1
-     ;;
-  esac
+    LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-cat >>confdefs.h <<_ACEOF
-#define TARGET_SYSTEM_ROOT_RELOCATABLE $value
+int
+main ()
+{
+int i;
+  ;
+  return 0;
+}
 _ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
 
-
-
-
-
-# Check whether --with-system-gdbinit was given.
-if test "${with_system_gdbinit+set}" = set; then :
-  withval=$with_system_gdbinit;
-    SYSTEM_GDBINIT=$withval
 else
-  SYSTEM_GDBINIT=
+  gdb_cv_bigtoc=
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS="${SAVE_LDFLAGS}"
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_bigtoc" >&5
+$as_echo "$gdb_cv_bigtoc" >&6; }
+  CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}"
+  ;;
+esac
 
-  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
-  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-  ac_define_dir=`eval echo $SYSTEM_GDBINIT`
-  ac_define_dir=`eval echo $ac_define_dir`
-
-cat >>confdefs.h <<_ACEOF
-#define SYSTEM_GDBINIT "$ac_define_dir"
-_ACEOF
-
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the dynamic export flag" >&5
+$as_echo_n "checking for the dynamic export flag... " >&6; }
+dynamic_list=false
+if test "${gdb_native}" = yes; then
+   # The dynamically loaded libthread_db needs access to symbols in the gdb
+   # executable.  Older GNU ld supports --export-dynamic but --dynamic-list
+   # may not be supported there.
+   old_LDFLAGS="$LDFLAGS"
+   # Older GNU ld supports --export-dynamic but --dynamic-list it does not.
+   RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list"
+   LDFLAGS="$LDFLAGS $RDYNAMIC"
+   if test "${have_libpython}" = no; then
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-  if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
-     if test "x$prefix" = xNONE; then
-       test_prefix=/usr/local
-     else
-       test_prefix=$prefix
-     fi
-  else
-     test_prefix=$exec_prefix
-  fi
-  value=0
-  case ${ac_define_dir} in
-     "${test_prefix}"|"${test_prefix}/"*|\
-       '${exec_prefix}'|'${exec_prefix}/'*)
-     value=1
-     ;;
-  esac
+int
+main ()
+{
 
-cat >>confdefs.h <<_ACEOF
-#define SYSTEM_GDBINIT_RELOCATABLE $value
+  ;
+  return 0;
+}
 _ACEOF
-
-
-
-
-
-# Check whether --enable-werror was given.
-if test "${enable_werror+set}" = set; then :
-  enableval=$enable_werror; case "${enableval}" in
-     yes | y) ERROR_ON_WARNING="yes" ;;
-     no | n)  ERROR_ON_WARNING="no" ;;
-     *) as_fn_error $? "bad value ${enableval} for --enable-werror" "$LINENO" 5 ;;
-   esac
+if ac_fn_c_try_link "$LINENO"; then :
+  dynamic_list=true
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+   else
+     # Workaround http://bugs.python.org/issue4434 where static
+     # libpythonX.Y.a would get its symbols required for
+     # pythonX.Y/lib-dynload/*.so modules hidden by -Wl,--dynamic-list.
+     # Problem does not happen for the recommended libpythonX.Y.so linkage.
 
-
-# Enable -Werror by default when using gcc.  Turn it off for releases.
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then
-    ERROR_ON_WARNING=yes
+     # Note the workaround for Python
+     # http://bugs.python.org/issue10112 earlier has removed
+     # -export-dynamic from PYTHON_LIBS.  That's exactly what we want
+     # here too, as otherwise it'd make this -Wl,--dynamic-list test
+     # always pass.
+     old_CFLAGS="$CFLAGS"
+     CFLAGS="$CFLAGS $PYTHON_CFLAGS"
+     old_LIBS="$LIBS"
+     LIBS="$LIBS $PYTHON_LIBS"
+     old_CPPFLAGS="$CPPFLAGS"
+     CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
+     if test "$cross_compiling" = yes; then :
+  true
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include "Python.h"
+int
+main ()
+{
+int err;
+          Py_Initialize ();
+          err = PyRun_SimpleString ("import itertools\n");
+          Py_Finalize ();
+          return err == 0 ? 0 : 1;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  dynamic_list=true
 fi
-
-WERROR_CFLAGS=""
-if test "${ERROR_ON_WARNING}" = yes ; then
-    WERROR_CFLAGS="-Werror"
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-# The options we'll try to enable.
-build_warnings="-Wall -Wpointer-arith \
--Wno-unused -Wunused-value -Wunused-variable -Wunused-function \
--Wno-switch -Wno-char-subscripts \
--Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable \
--Wno-sign-compare -Wno-error=maybe-uninitialized \
--Wno-mismatched-tags \
--Wno-error=deprecated-register \
--Wsuggest-override \
--Wimplicit-fallthrough=3 \
--Wduplicated-cond \
--Wshadow=local \
--Wdeprecated-copy \
--Wdeprecated-copy-dtor \
--Wredundant-move"
-
-case "${host}" in
-  *-*-mingw32*)
-    # Enable -Wno-format by default when using gcc on mingw since many
-    # GCC versions complain about %I64.
-    build_warnings="$build_warnings -Wno-format" ;;
-  *-*-solaris*)
-    # Solaris 11.4 <python2.7/ceval.h> uses #pragma no_inline that GCC
-    # doesn't understand.
-    build_warnings="$build_warnings -Wno-unknown-pragmas"
-    # Solaris 11 <unistd.h> marks vfork deprecated.
-    build_warnings="$build_warnings -Wno-deprecated-declarations" ;;
-  *)
-    # Note that gcc requires -Wformat for -Wformat-nonliteral to work,
-    # but there's a special case for this below.
-    build_warnings="$build_warnings -Wformat-nonliteral" ;;
-esac
-
-# Check whether --enable-build-warnings was given.
-if test "${enable_build_warnings+set}" = set; then :
-  enableval=$enable_build_warnings; case "${enableval}" in
-  yes) ;;
-  no)  build_warnings="-w";;
-  ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
-        build_warnings="${build_warnings} ${t}";;
-  *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
-        build_warnings="${t} ${build_warnings}";;
-  *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
-esac
-if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
-  echo "Setting compiler warning flags = $build_warnings" 6>&1
-fi
-fi
-# Check whether --enable-gdb-build-warnings was given.
-if test "${enable_gdb_build_warnings+set}" = set; then :
-  enableval=$enable_gdb_build_warnings; case "${enableval}" in
-  yes) ;;
-  no)  build_warnings="-w";;
-  ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
-        build_warnings="${build_warnings} ${t}";;
-  *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
-        build_warnings="${t} ${build_warnings}";;
-  *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
-esac
-if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
-  echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1
+     LIBS="$old_LIBS"
+     CFLAGS="$old_CFLAGS"
+     CPPFLAGS="$old_CPPFLAGS"
+   fi
+   LDFLAGS="$old_LDFLAGS"
 fi
+if $dynamic_list; then
+  found="-Wl,--dynamic-list"
+  RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'
+else
+  found="-rdynamic"
+  RDYNAMIC="-rdynamic"
 fi
 
-# The set of warnings supported by a C++ compiler is not the same as
-# of the C compiler.
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5
+$as_echo "$found" >&6; }
 
-WARN_CFLAGS=""
-if test "x${build_warnings}" != x -a "x$GCC" = xyes
-then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler warning flags" >&5
-$as_echo_n "checking compiler warning flags... " >&6; }
-    # 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'` ;;
-        -Wformat-nonliteral)
-               # gcc requires -Wformat before -Wformat-nonliteral
-               # will work, so stick them together.
-               w="-Wformat $w"
-               wtest="$w"
-               ;;
-       *)
-               wtest=$w ;;
-       esac
 
-       case $w in
-       -Werr*) WERROR_CFLAGS=-Werror ;;
-       *)
-           # Check whether GCC accepts it.
-           saved_CFLAGS="$CFLAGS"
-           CFLAGS="$CFLAGS -Werror $wtest"
-           saved_CXXFLAGS="$CXXFLAGS"
-           CXXFLAGS="$CXXFLAGS -Werror $wtest"
-           if test "x$w" = "x-Wunused-variable"; then
-             # Check for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38958,
-             # fixed in GCC 4.9.  This test is derived from the gdb
-             # source code that triggered this bug in GCC.
-             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+if test ${build} = ${host} -a ${host} = ${target} ; then
+   case ${host_os} in
+   aix*)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AiX thread debugging library" >&5
+$as_echo_n "checking for AiX thread debugging library... " >&6; }
+      if ${gdb_cv_have_aix_thread_debug+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-struct scoped_restore_base {};
-                 struct scoped_restore_tmpl : public scoped_restore_base {
-                  ~scoped_restore_tmpl() {}
-                };
+#include <sys/pthdebug.h>
 int
 main ()
 {
-const scoped_restore_base &b = scoped_restore_tmpl();
+#ifndef PTHDB_VERSION_3
+                                    #error
+                                    #endif
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  WARN_CFLAGS="${WARN_CFLAGS} $w"
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_have_aix_thread_debug=yes
+else
+  gdb_cv_have_aix_thread_debug=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-           else
-             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+fi
 
-int
-main ()
-{
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_aix_thread_debug" >&5
+$as_echo "$gdb_cv_have_aix_thread_debug" >&6; }
+      if test $gdb_cv_have_aix_thread_debug = yes; then
+         CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c"
+         CONFIG_OBS="${CONFIG_OBS} aix-thread.o"
+         LIBS="$LIBS -lpthdebug"
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  WARN_CFLAGS="${WARN_CFLAGS} $w"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-           fi
-           CFLAGS="$saved_CFLAGS"
-           CXXFLAGS="$saved_CXXFLAGS"
-       esac
-    done
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WARN_CFLAGS} ${WERROR_CFLAGS}" >&5
-$as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; }
+         # Older versions of AIX do not provide the declaration for
+         # the getthrds function (it appears that it was introduced
+         # with AIX 6.x).
+         ac_fn_c_check_decl "$LINENO" "getthrds" "ac_cv_have_decl_getthrds" "#include <procinfo.h>
+"
+if test "x$ac_cv_have_decl_getthrds" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
 fi
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETTHRDS $ac_have_decl
+_ACEOF
 
+      fi
+      ;;
+   esac
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
+fi
 
-# Check whether --enable-ubsan was given.
-if test "${enable_ubsan+set}" = set; then :
-  enableval=$enable_ubsan;
+if test "x$ac_cv_header_thread_db_h" = "xyes"; then
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <thread_db.h> has TD_NOTALLOC" >&5
+$as_echo_n "checking whether <thread_db.h> has TD_NOTALLOC... " >&6; }
+if ${gdb_cv_thread_db_h_has_td_notalloc+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  enable_ubsan=no
-fi
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <thread_db.h>
+int
+main ()
+{
+int i = TD_NOTALLOC;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_thread_db_h_has_td_notalloc=yes
+else
+  gdb_cv_thread_db_h_has_td_notalloc=no
 
-if test "x$enable_ubsan" = xauto; then
-  if $development; then
-    enable_ubsan=yes
-  fi
 fi
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-if test "x$enable_ubsan" = xyes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -fsanitize=undefined is accepted" >&5
-$as_echo_n "checking whether -fsanitize=undefined is accepted... " >&6; }
-  saved_CXXFLAGS="$CXXFLAGS"
-  CXXFLAGS="$CXXFLAGS -fsanitize=undefined -fno-sanitize-recover=undefined"
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_thread_db_h_has_td_notalloc" >&5
+$as_echo "$gdb_cv_thread_db_h_has_td_notalloc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <thread_db.h> has TD_VERSION" >&5
+$as_echo_n "checking whether <thread_db.h> has TD_VERSION... " >&6; }
+if ${gdb_cv_thread_db_h_has_td_version+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
+#include <thread_db.h>
 int
 main ()
 {
-
+int i = TD_VERSION;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  enable_ubsan=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_thread_db_h_has_td_version=yes
 else
-  enable_ubsan=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  CXXFLAGS="$saved_CXXFLAGS"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_ubsan" >&5
-$as_echo "$enable_ubsan" >&6; }
-  if test "x$enable_ubsan" = xyes; then
-    WARN_CFLAGS="$WARN_CFLAGS -fsanitize=undefined -fno-sanitize-recover=undefined"
-    CONFIG_LDFLAGS="$CONFIG_LDFLAGS -fsanitize=undefined"
-  fi
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
+  gdb_cv_thread_db_h_has_td_version=no
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-# In the Cygwin environment, we need some additional flags.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cygwin" >&5
-$as_echo_n "checking for cygwin... " >&6; }
-if ${gdb_cv_os_cygwin+:} false; then :
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_thread_db_h_has_td_version" >&5
+$as_echo "$gdb_cv_thread_db_h_has_td_version" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <thread_db.h> has TD_NOTLS" >&5
+$as_echo_n "checking whether <thread_db.h> has TD_NOTLS... " >&6; }
+if ${gdb_cv_thread_db_h_has_td_notls+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#if defined (__CYGWIN__) || defined (__CYGWIN32__)
-lose
-#endif
+#include <thread_db.h>
+int
+main ()
+{
+int i = TD_NOTLS;
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "^lose$" >/dev/null 2>&1; then :
-  gdb_cv_os_cygwin=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_thread_db_h_has_td_notls=yes
 else
-  gdb_cv_os_cygwin=no
+  gdb_cv_thread_db_h_has_td_notls=no
+
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_os_cygwin" >&5
-$as_echo "$gdb_cv_os_cygwin" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_thread_db_h_has_td_notls" >&5
+$as_echo "$gdb_cv_thread_db_h_has_td_notls" >&6; }
+fi
+if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then
 
+$as_echo "#define THREAD_DB_HAS_TD_NOTALLOC 1" >>confdefs.h
 
-SER_HARDWIRE="ser-base.o ser-unix.o ser-pipe.o ser-tcp.o"
-case ${host} in
-  *go32* ) SER_HARDWIRE=ser-go32.o ;;
-  *djgpp* ) SER_HARDWIRE=ser-go32.o ;;
-  *mingw32*) SER_HARDWIRE="ser-base.o ser-tcp.o ser-mingw.o" ;;
-  *) SER_HARDWIRE="$SER_HARDWIRE ser-uds.o" ;;
-esac
+fi
+if test "x$gdb_cv_thread_db_h_has_td_version" = "xyes"; then
 
+$as_echo "#define THREAD_DB_HAS_TD_VERSION 1" >>confdefs.h
 
-# libreadline needs libuser32.a in a cygwin environment
-WIN32LIBS=
-if test x$gdb_cv_os_cygwin = xyes; then
-    WIN32LIBS="-luser32"
-    case "${target}" in
-       *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
-       ;;
-    esac
 fi
+if test "x$gdb_cv_thread_db_h_has_td_notls" = "xyes"; then
 
-# The ser-tcp.c module requires sockets.
-case ${host} in
-  *mingw32*)
+$as_echo "#define THREAD_DB_HAS_TD_NOTLS 1" >>confdefs.h
 
-$as_echo "#define USE_WIN32API 1" >>confdefs.h
+fi
 
-    WIN32LIBS="$WIN32LIBS -lws2_32"
-    ;;
-esac
+ac_fn_c_check_decl "$LINENO" "ADDR_NO_RANDOMIZE" "ac_cv_have_decl_ADDR_NO_RANDOMIZE" "#include <sys/personality.h>
+"
+if test "x$ac_cv_have_decl_ADDR_NO_RANDOMIZE" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ADDR_NO_RANDOMIZE $ac_have_decl
+_ACEOF
 
-# Add ELF support to GDB, but only if BFD includes ELF support.
 
-  OLD_CFLAGS=$CFLAGS
-  OLD_LDFLAGS=$LDFLAGS
-  OLD_LIBS=$LIBS
-  # Put the old CFLAGS/LDFLAGS last, in case the user's (C|LD)FLAGS
-  # points somewhere with bfd, with -I/foo/lib and -L/foo/lib.  We
-  # always want our bfd.
-  CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS"
-  ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'`
-  LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
-  intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
-  LIBS="-lbfd -liberty -lz $intl $LIBS"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF support in BFD" >&5
-$as_echo_n "checking for ELF support in BFD... " >&6; }
-if ${gdb_cv_var_elf+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+if test "$cross_compiling" = yes; then :
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdlib.h>
-  #include "bfd.h"
-  #include "elf-bfd.h"
-
+#include <sys/personality.h>
 int
 main ()
 {
-return bfd_get_elf_phdr_upper_bound (NULL);
+
+#      if !HAVE_DECL_ADDR_NO_RANDOMIZE
+#       define ADDR_NO_RANDOMIZE 0x0040000
+#      endif
+       /* Test the flag could be set and stays set.  */
+       personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE);
+       if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE))
+          return 1
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  gdb_cv_var_elf=yes
+  have_personality=true
 else
-  gdb_cv_var_elf=no
+  have_personality=false
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_var_elf" >&5
-$as_echo "$gdb_cv_var_elf" >&6; }
-  CFLAGS=$OLD_CFLAGS
-  LDFLAGS=$OLD_LDFLAGS
-  LIBS=$OLD_LIBS
-if test $gdb_cv_var_elf = yes; then
-  CONFIG_OBS="$CONFIG_OBS elfread.o stap-probe.o dtrace-probe.o"
-
-$as_echo "#define HAVE_ELF 1" >>confdefs.h
-
-  # -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>.
-  if test "$plugins" = "yes"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
-$as_echo_n "checking for library containing dlopen... " >&6; }
-if ${ac_cv_search_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
 else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
+#include <sys/personality.h>
 int
 main ()
 {
-return dlopen ();
+
+#      if !HAVE_DECL_ADDR_NO_RANDOMIZE
+#       define ADDR_NO_RANDOMIZE 0x0040000
+#      endif
+       /* Test the flag could be set and stays set.  */
+       personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE);
+       if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE))
+          return 1
   ;
   return 0;
 }
 _ACEOF
-for ac_lib in '' dl; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_dlopen=$ac_res
+if ac_fn_c_try_run "$LINENO"; then :
+  have_personality=true
+else
+  have_personality=false
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_dlopen+:} false; then :
-  break
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-done
-if ${ac_cv_search_dlopen+:} false; then :
 
-else
-  ac_cv_search_dlopen=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+if $have_personality
+then
+
+$as_echo "#define HAVE_PERSONALITY 1" >>confdefs.h
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
-$as_echo "$ac_cv_search_dlopen" >&6; }
-ac_res=$ac_cv_search_dlopen
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
+case $host_os in
+  go32* | *djgpp*)
+    gdbinit=gdb.ini
+    ;;
+  *)
+    gdbinit=.gdbinit
+    ;;
+esac
+
+cat >>confdefs.h <<_ACEOF
+#define GDBINIT "$gdbinit"
+_ACEOF
+
+
+
+# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
+# except that the argument to --with-sysroot is optional.
+# --with-sysroot (or --with-sysroot=yes) sets the default sysroot path.
+if test "x$with_sysroot" = xyes; then
+  with_sysroot="${exec_prefix}/${target_alias}/sys-root"
 fi
 
-  fi
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+  withval=$with_sysroot; TARGET_SYSTEM_ROOT=$withval
+else
+  TARGET_SYSTEM_ROOT=
 fi
 
-# Add macho support to GDB, but only if BFD includes it.
 
-  OLD_CFLAGS=$CFLAGS
-  OLD_LDFLAGS=$LDFLAGS
-  OLD_LIBS=$LIBS
-  # Put the old CFLAGS/LDFLAGS last, in case the user's (C|LD)FLAGS
-  # points somewhere with bfd, with -I/foo/lib and -L/foo/lib.  We
-  # always want our bfd.
-  CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS"
-  ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'`
-  LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
-  intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
-  LIBS="-lbfd -liberty -lz $intl $LIBS"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mach-O support in BFD" >&5
-$as_echo_n "checking for Mach-O support in BFD... " >&6; }
-if ${gdb_cv_var_macho+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-  #include "bfd.h"
-  #include "mach-o.h"
+  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+  ac_define_dir=`eval echo $TARGET_SYSTEM_ROOT`
+  ac_define_dir=`eval echo $ac_define_dir`
 
-int
-main ()
-{
-return bfd_mach_o_lookup_command (NULL, 0, NULL);
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define TARGET_SYSTEM_ROOT "$ac_define_dir"
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gdb_cv_var_macho=yes
-else
-  gdb_cv_var_macho=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_var_macho" >&5
-$as_echo "$gdb_cv_var_macho" >&6; }
-  CFLAGS=$OLD_CFLAGS
-  LDFLAGS=$OLD_LDFLAGS
-  LIBS=$OLD_LIBS
-if test $gdb_cv_var_macho = yes; then
-  CONFIG_OBS="$CONFIG_OBS machoread.o"
-fi
 
-# Add any host-specific objects to GDB.
-CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}"
 
-# If building on ELF, look for lzma support for embedded compressed debug info.
-if test $gdb_cv_var_elf = yes; then
 
-# Check whether --with-lzma was given.
-if test "${with_lzma+set}" = set; then :
-  withval=$with_lzma;
+
+  if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
+     if test "x$prefix" = xNONE; then
+       test_prefix=/usr/local
+     else
+       test_prefix=$prefix
+     fi
+  else
+     test_prefix=$exec_prefix
+  fi
+  value=0
+  case ${ac_define_dir} in
+     "${test_prefix}"|"${test_prefix}/"*|\
+       '${exec_prefix}'|'${exec_prefix}/'*)
+     value=1
+     ;;
+  esac
+
+cat >>confdefs.h <<_ACEOF
+#define TARGET_SYSTEM_ROOT_RELOCATABLE $value
+_ACEOF
+
+
+
+
+
+# Check whether --with-system-gdbinit was given.
+if test "${with_system_gdbinit+set}" = set; then :
+  withval=$with_system_gdbinit;
+    SYSTEM_GDBINIT=$withval
 else
-  with_lzma=auto
+  SYSTEM_GDBINIT=
 fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use lzma" >&5
-$as_echo_n "checking whether to use lzma... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_lzma" >&5
-$as_echo "$with_lzma" >&6; }
 
-  if test "${with_lzma}" != no; then
+  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+  ac_define_dir=`eval echo $SYSTEM_GDBINIT`
+  ac_define_dir=`eval echo $ac_define_dir`
 
+cat >>confdefs.h <<_ACEOF
+#define SYSTEM_GDBINIT "$ac_define_dir"
+_ACEOF
 
 
 
 
+  if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
+     if test "x$prefix" = xNONE; then
+       test_prefix=/usr/local
+     else
+       test_prefix=$prefix
+     fi
+  else
+     test_prefix=$exec_prefix
+  fi
+  value=0
+  case ${ac_define_dir} in
+     "${test_prefix}"|"${test_prefix}/"*|\
+       '${exec_prefix}'|'${exec_prefix}/'*)
+     value=1
+     ;;
+  esac
 
+cat >>confdefs.h <<_ACEOF
+#define SYSTEM_GDBINIT_RELOCATABLE $value
+_ACEOF
 
 
-    use_additional=yes
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
 
-    eval additional_includedir=\"$includedir\"
-    eval additional_libdir=\"$libdir\"
 
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
+# Check whether --with-system-gdbinit-dir was given.
+if test "${with_system_gdbinit_dir+set}" = set; then :
+  withval=$with_system_gdbinit_dir;
+    SYSTEM_GDBINIT_DIR=$withval
+else
+  SYSTEM_GDBINIT_DIR=
+fi
 
 
-# Check whether --with-liblzma-prefix was given.
-if test "${with_liblzma_prefix+set}" = set; then :
-  withval=$with_liblzma_prefix;
-    if test "X$withval" = "Xno"; then
-      use_additional=no
-    else
-      if test "X$withval" = "X"; then
+  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+  ac_define_dir=`eval echo $SYSTEM_GDBINIT_DIR`
+  ac_define_dir=`eval echo $ac_define_dir`
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
+cat >>confdefs.h <<_ACEOF
+#define SYSTEM_GDBINIT_DIR "$ac_define_dir"
+_ACEOF
 
-          eval additional_includedir=\"$includedir\"
-          eval additional_libdir=\"$libdir\"
 
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
 
-      else
-        additional_includedir="$withval/include"
-        additional_libdir="$withval/lib"
-      fi
-    fi
 
-fi
+  if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
+     if test "x$prefix" = xNONE; then
+       test_prefix=/usr/local
+     else
+       test_prefix=$prefix
+     fi
+  else
+     test_prefix=$exec_prefix
+  fi
+  value=0
+  case ${ac_define_dir} in
+     "${test_prefix}"|"${test_prefix}/"*|\
+       '${exec_prefix}'|'${exec_prefix}/'*)
+     value=1
+     ;;
+  esac
+
+cat >>confdefs.h <<_ACEOF
+#define SYSTEM_GDBINIT_DIR_RELOCATABLE $value
+_ACEOF
+
+
+
+
+
+# Check whether --enable-werror was given.
+if test "${enable_werror+set}" = set; then :
+  enableval=$enable_werror; case "${enableval}" in
+     yes | y) ERROR_ON_WARNING="yes" ;;
+     no | n)  ERROR_ON_WARNING="no" ;;
+     *) as_fn_error $? "bad value ${enableval} for --enable-werror" "$LINENO" 5 ;;
+   esac
+fi
+
+
+# Enable -Werror by default when using gcc.  Turn it off for releases.
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then
+    ERROR_ON_WARNING=yes
+fi
+
+WERROR_CFLAGS=""
+if test "${ERROR_ON_WARNING}" = yes ; then
+    WERROR_CFLAGS="-Werror"
+fi
+
+# The options we'll try to enable.
+build_warnings="-Wall -Wpointer-arith \
+-Wno-unused -Wunused-value -Wunused-variable -Wunused-function \
+-Wno-switch -Wno-char-subscripts \
+-Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable \
+-Wno-sign-compare -Wno-error=maybe-uninitialized \
+-Wno-mismatched-tags \
+-Wno-error=deprecated-register \
+-Wsuggest-override \
+-Wimplicit-fallthrough=3 \
+-Wduplicated-cond \
+-Wshadow=local \
+-Wdeprecated-copy \
+-Wdeprecated-copy-dtor \
+-Wredundant-move"
+
+case "${host}" in
+  *-*-mingw32*)
+    # Enable -Wno-format by default when using gcc on mingw since many
+    # GCC versions complain about %I64.
+    build_warnings="$build_warnings -Wno-format" ;;
+  *-*-solaris*)
+    # Solaris 11.4 <python2.7/ceval.h> uses #pragma no_inline that GCC
+    # doesn't understand.
+    build_warnings="$build_warnings -Wno-unknown-pragmas"
+    # Solaris 11 <unistd.h> marks vfork deprecated.
+    build_warnings="$build_warnings -Wno-deprecated-declarations" ;;
+  *)
+    # Note that gcc requires -Wformat for -Wformat-nonliteral to work,
+    # but there's a special case for this below.
+    build_warnings="$build_warnings -Wformat-nonliteral" ;;
+esac
+
+# Check whether --enable-build-warnings was given.
+if test "${enable_build_warnings+set}" = set; then :
+  enableval=$enable_build_warnings; case "${enableval}" in
+  yes) ;;
+  no)  build_warnings="-w";;
+  ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
+        build_warnings="${build_warnings} ${t}";;
+  *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
+        build_warnings="${t} ${build_warnings}";;
+  *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+esac
+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
+  echo "Setting compiler warning flags = $build_warnings" 6>&1
+fi
+fi
+# Check whether --enable-gdb-build-warnings was given.
+if test "${enable_gdb_build_warnings+set}" = set; then :
+  enableval=$enable_gdb_build_warnings; case "${enableval}" in
+  yes) ;;
+  no)  build_warnings="-w";;
+  ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
+        build_warnings="${build_warnings} ${t}";;
+  *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
+        build_warnings="${t} ${build_warnings}";;
+  *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+esac
+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
+  echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1
+fi
+fi
+
+# The set of warnings supported by a C++ compiler is not the same as
+# of the C compiler.
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+WARN_CFLAGS=""
+if test "x${build_warnings}" != x -a "x$GCC" = xyes
+then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler warning flags" >&5
+$as_echo_n "checking compiler warning flags... " >&6; }
+    # 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'` ;;
+        -Wformat-nonliteral)
+               # gcc requires -Wformat before -Wformat-nonliteral
+               # will work, so stick them together.
+               w="-Wformat $w"
+               wtest="$w"
+               ;;
+       *)
+               wtest=$w ;;
+       esac
+
+       case $w in
+       -Werr*) WERROR_CFLAGS=-Werror ;;
+       *)
+           # Check whether GCC accepts it.
+           saved_CFLAGS="$CFLAGS"
+           CFLAGS="$CFLAGS -Werror $wtest"
+           saved_CXXFLAGS="$CXXFLAGS"
+           CXXFLAGS="$CXXFLAGS -Werror $wtest"
+           if test "x$w" = "x-Wunused-variable"; then
+             # Check for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38958,
+             # fixed in GCC 4.9.  This test is derived from the gdb
+             # source code that triggered this bug in GCC.
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+struct scoped_restore_base {};
+                 struct scoped_restore_tmpl : public scoped_restore_base {
+                  ~scoped_restore_tmpl() {}
+                };
+int
+main ()
+{
+const scoped_restore_base &b = scoped_restore_tmpl();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  WARN_CFLAGS="${WARN_CFLAGS} $w"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           else
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  WARN_CFLAGS="${WARN_CFLAGS} $w"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           fi
+           CFLAGS="$saved_CFLAGS"
+           CXXFLAGS="$saved_CXXFLAGS"
+       esac
+    done
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WARN_CFLAGS} ${WERROR_CFLAGS}" >&5
+$as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; }
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Check whether --enable-ubsan was given.
+if test "${enable_ubsan+set}" = set; then :
+  enableval=$enable_ubsan;
+else
+  enable_ubsan=no
+fi
+
+if test "x$enable_ubsan" = xauto; then
+  if $development; then
+    enable_ubsan=yes
+  fi
+fi
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+if test "x$enable_ubsan" = xyes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -fsanitize=undefined is accepted" >&5
+$as_echo_n "checking whether -fsanitize=undefined is accepted... " >&6; }
+  saved_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -fsanitize=undefined -fno-sanitize-recover=undefined"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  enable_ubsan=yes
+else
+  enable_ubsan=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  CXXFLAGS="$saved_CXXFLAGS"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_ubsan" >&5
+$as_echo "$enable_ubsan" >&6; }
+  if test "x$enable_ubsan" = xyes; then
+    WARN_CFLAGS="$WARN_CFLAGS -fsanitize=undefined -fno-sanitize-recover=undefined"
+    CONFIG_LDFLAGS="$CONFIG_LDFLAGS -fsanitize=undefined"
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# In the Cygwin environment, we need some additional flags.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cygwin" >&5
+$as_echo_n "checking for cygwin... " >&6; }
+if ${gdb_cv_os_cygwin+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if defined (__CYGWIN__) || defined (__CYGWIN32__)
+lose
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "^lose$" >/dev/null 2>&1; then :
+  gdb_cv_os_cygwin=yes
+else
+  gdb_cv_os_cygwin=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_os_cygwin" >&5
+$as_echo "$gdb_cv_os_cygwin" >&6; }
+
+
+SER_HARDWIRE="ser-base.o ser-unix.o ser-pipe.o ser-tcp.o"
+case ${host} in
+  *go32* ) SER_HARDWIRE=ser-go32.o ;;
+  *djgpp* ) SER_HARDWIRE=ser-go32.o ;;
+  *mingw32*) SER_HARDWIRE="ser-base.o ser-tcp.o ser-mingw.o" ;;
+  *) SER_HARDWIRE="$SER_HARDWIRE ser-uds.o" ;;
+esac
+
+
+# libreadline needs libuser32.a in a cygwin environment
+WIN32LIBS=
+if test x$gdb_cv_os_cygwin = xyes; then
+    WIN32LIBS="-luser32"
+    case "${target}" in
+       *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
+       ;;
+    esac
+fi
+
+# The ser-tcp.c module requires sockets.
+case ${host} in
+  *mingw32*)
+
+$as_echo "#define USE_WIN32API 1" >>confdefs.h
+
+    WIN32LIBS="$WIN32LIBS -lws2_32"
+    ;;
+esac
+
+
+# Add ELF support to GDB, but only if BFD includes ELF support.
+
+  OLD_CFLAGS=$CFLAGS
+  OLD_LDFLAGS=$LDFLAGS
+  OLD_LIBS=$LIBS
+  # Put the old CFLAGS/LDFLAGS last, in case the user's (C|LD)FLAGS
+  # points somewhere with bfd, with -I/foo/lib and -L/foo/lib.  We
+  # always want our bfd.
+  CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS"
+  ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'`
+  LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
+  intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
+  LIBS="-lbfd -liberty -lz $intl $LIBS"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF support in BFD" >&5
+$as_echo_n "checking for ELF support in BFD... " >&6; }
+if ${gdb_cv_var_elf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+  #include "bfd.h"
+  #include "elf-bfd.h"
+
+int
+main ()
+{
+return bfd_get_elf_phdr_upper_bound (NULL);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gdb_cv_var_elf=yes
+else
+  gdb_cv_var_elf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_var_elf" >&5
+$as_echo "$gdb_cv_var_elf" >&6; }
+  CFLAGS=$OLD_CFLAGS
+  LDFLAGS=$OLD_LDFLAGS
+  LIBS=$OLD_LIBS
+if test $gdb_cv_var_elf = yes; then
+  CONFIG_OBS="$CONFIG_OBS elfread.o stap-probe.o dtrace-probe.o"
+
+$as_echo "#define HAVE_ELF 1" >>confdefs.h
+
+  # -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>.
+  if test "$plugins" = "yes"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
+$as_echo_n "checking for library containing dlopen... " >&6; }
+if ${ac_cv_search_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' dl; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_dlopen=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_dlopen+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_dlopen+:} false; then :
+
+else
+  ac_cv_search_dlopen=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
+$as_echo "$ac_cv_search_dlopen" >&6; }
+ac_res=$ac_cv_search_dlopen
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+  fi
+fi
+
+# Add macho support to GDB, but only if BFD includes it.
+
+  OLD_CFLAGS=$CFLAGS
+  OLD_LDFLAGS=$LDFLAGS
+  OLD_LIBS=$LIBS
+  # Put the old CFLAGS/LDFLAGS last, in case the user's (C|LD)FLAGS
+  # points somewhere with bfd, with -I/foo/lib and -L/foo/lib.  We
+  # always want our bfd.
+  CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS"
+  ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'`
+  LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
+  intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
+  LIBS="-lbfd -liberty -lz $intl $LIBS"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mach-O support in BFD" >&5
+$as_echo_n "checking for Mach-O support in BFD... " >&6; }
+if ${gdb_cv_var_macho+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+  #include "bfd.h"
+  #include "mach-o.h"
+
+int
+main ()
+{
+return bfd_mach_o_lookup_command (NULL, 0, NULL);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gdb_cv_var_macho=yes
+else
+  gdb_cv_var_macho=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_var_macho" >&5
+$as_echo "$gdb_cv_var_macho" >&6; }
+  CFLAGS=$OLD_CFLAGS
+  LDFLAGS=$OLD_LDFLAGS
+  LIBS=$OLD_LIBS
+if test $gdb_cv_var_macho = yes; then
+  CONFIG_OBS="$CONFIG_OBS machoread.o"
+fi
+
+# Add any host-specific objects to GDB.
+CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}"
+
+# If building on ELF, look for lzma support for embedded compressed debug info.
+if test $gdb_cv_var_elf = yes; then
+
+# Check whether --with-lzma was given.
+if test "${with_lzma+set}" = set; then :
+  withval=$with_lzma;
+else
+  with_lzma=auto
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use lzma" >&5
+$as_echo_n "checking whether to use lzma... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_lzma" >&5
+$as_echo "$with_lzma" >&6; }
+
+  if test "${with_lzma}" != no; then
+
+
+
+
+
+
+
+
+    use_additional=yes
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+
+# Check whether --with-liblzma-prefix was given.
+if test "${with_liblzma_prefix+set}" = set; then :
+  withval=$with_liblzma_prefix;
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/lib"
+      fi
+    fi
+
+fi
 
       LIBLZMA=
   LTLIBLZMA=
 
 
 
-# List of host floatformats.
+# List of host floatformats.
+
+cat >>confdefs.h <<_ACEOF
+#define GDB_HOST_FLOAT_FORMAT $gdb_host_float_format
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define GDB_HOST_DOUBLE_FORMAT $gdb_host_double_format
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define GDB_HOST_LONG_DOUBLE_FORMAT $gdb_host_long_double_format
+_ACEOF
+
+
+# target_subdir is used by the testsuite to find the target libraries.
+target_subdir=
+if test "${host}" != "${target}"; then
+    target_subdir="${target_alias}/"
+fi
+
+
+# Import nat definitions.
+nat_makefile_frag=/dev/null
+if test "${gdb_native}" = "yes"; then
+  . ${srcdir}/configure.nat
+  nativefile=$NAT_FILE
+fi
+
+
+
+
+
+
+
+
+
+
+
+if test x"${gdb_osabi}" != x ; then
+
+cat >>confdefs.h <<_ACEOF
+#define GDB_OSABI_DEFAULT $gdb_osabi
+_ACEOF
+
+fi
+
+# Check whether --enable-gdbserver was given.
+if test "${enable_gdbserver+set}" = set; then :
+  enableval=$enable_gdbserver; case "${enableval}" in
+  yes| no|auto) ;;
+  *) as_fn_error $? "bad value ${enableval} for --enable-gdbserver option" "$LINENO" 5 ;;
+esac
+else
+  enable_gdbserver=auto
+fi
+
+
+# We only build gdbserver automatically in a native configuration, and
+# only if the user did not explicitly disable its build.
+if test "$gdb_native" = "yes" -a "$enable_gdbserver" != "no"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gdbserver is supported on this host" >&5
+$as_echo_n "checking whether gdbserver is supported on this host... " >&6; }
+  if test "x$build_gdbserver" = xyes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    subdirs="$subdirs gdbserver"
+
+    gdbserver_build_enabled=yes
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  fi
+fi
+
+# If the user explicitly request the gdbserver to be built, verify that
+# we were in fact able to enable it.
+if test "$enable_gdbserver" = "yes" -a "$gdbserver_build_enabled" != "yes"; then
+  as_fn_error $? "Automatic gdbserver build is not supported for this configuration" "$LINENO" 5
+fi
+
+# Check for babeltrace and babeltrace-ctf
+
+# Check whether --with-babeltrace was given.
+if test "${with_babeltrace+set}" = set; then :
+  withval=$with_babeltrace;
+else
+  with_babeltrace=auto
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use babeltrace" >&5
+$as_echo_n "checking whether to use babeltrace... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_babeltrace" >&5
+$as_echo "$with_babeltrace" >&6; }
+
+if test "x$with_babeltrace" = "xno"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: babletrace support disabled; GDB is unable to read CTF data." >&5
+$as_echo "$as_me: WARNING: babletrace support disabled; GDB is unable to read CTF data." >&2;}
+else
+  # Append -Werror to CFLAGS so that configure can catch the warning
+  # "assignment from incompatible pointer type", which is related to
+  # the babeltrace change from 1.0.3 to 1.1.0.  Babeltrace 1.1.0 works
+  # in GDB, while babeltrace 1.0.3 is broken.
+  # AC_LIB_HAVE_LINKFLAGS may modify CPPFLAGS in it, so it should be
+  # safe to save and restore CFLAGS here.
+  saved_CFLAGS=$CFLAGS
+  CFLAGS="$CFLAGS -Werror"
+
+
+
+
+
+
+
+
+    use_additional=yes
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+
+# Check whether --with-libbabeltrace-prefix was given.
+if test "${with_libbabeltrace_prefix+set}" = set; then :
+  withval=$with_libbabeltrace_prefix;
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/lib"
+      fi
+    fi
+
+fi
+
+      LIBBABELTRACE=
+  LTLIBBABELTRACE=
+  INCBABELTRACE=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='babeltrace babeltrace-ctf'
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }$value"
+          else
+                                    :
+          fi
+        else
+                              found_dir=
+          found_la=
+          found_so=
+          found_a=
+          if test $use_additional = yes; then
+            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
+              found_dir="$additional_libdir"
+              found_so="$additional_libdir/lib$name.$shlibext"
+              if test -f "$additional_libdir/lib$name.la"; then
+                found_la="$additional_libdir/lib$name.la"
+              fi
+            else
+              if test -f "$additional_libdir/lib$name.$libext"; then
+                found_dir="$additional_libdir"
+                found_a="$additional_libdir/lib$name.$libext"
+                if test -f "$additional_libdir/lib$name.la"; then
+                  found_la="$additional_libdir/lib$name.la"
+                fi
+              fi
+            fi
+          fi
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIBBABELTRACE; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
+                    found_dir="$dir"
+                    found_so="$dir/lib$name.$shlibext"
+                    if test -f "$dir/lib$name.la"; then
+                      found_la="$dir/lib$name.la"
+                    fi
+                  else
+                    if test -f "$dir/lib$name.$libext"; then
+                      found_dir="$dir"
+                      found_a="$dir/lib$name.$libext"
+                      if test -f "$dir/lib$name.la"; then
+                        found_la="$dir/lib$name.la"
+                      fi
+                    fi
+                  fi
+                  ;;
+              esac
+              if test "X$found_dir" != "X"; then
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+                        LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+                                                        if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+                                LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_so"
+              else
+                                                                                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                                if test "$hardcode_direct" = yes; then
+                                                      LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_so"
+                else
+                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+                                                            LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_so"
+                                                            haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                                                                                haveit=
+                    for x in $LDFLAGS $LIBBABELTRACE; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-L$found_dir"
+                    fi
+                    if test "$hardcode_minus_L" != no; then
+                                                                                        LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_so"
+                    else
+                                                                                                                                                                                LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                                LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_a"
+              else
+                                                LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-L$found_dir -l$name"
+              fi
+            fi
+                        additional_includedir=
+            case "$found_dir" in
+              */lib | */lib/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+                additional_includedir="$basedir/include"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux*) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INCBABELTRACE; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                                            INCBABELTRACE="${INCBABELTRACE}${INCBABELTRACE:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+                        if test -n "$found_la"; then
+                                                        save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+                            for dep in $dependency_libs; do
+                case "$dep" in
+                  -L*)
+                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                                                                                                                                                                if test "X$additional_libdir" != "X/usr/lib"; then
+                      haveit=
+                      if test "X$additional_libdir" = "X/usr/local/lib"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux*) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIBBABELTRACE; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-L$additional_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIBBABELTRACE; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }-L$additional_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                                                                  haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                                                                  haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                                        names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    ;;
+                  *.la)
+                                                                                names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                                        LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$dep"
+                    LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+                                                            LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-l$name"
+            LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$hardcode_libdir_separator"; then
+                        alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+      done
+            acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$flag"
+    else
+            for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+            for found_dir in $ltrpathdirs; do
+      LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }-R$found_dir"
+    done
+  fi
+
+
+        ac_save_CPPFLAGS="$CPPFLAGS"
+
+  for element in $INCBABELTRACE; do
+    haveit=
+    for x in $CPPFLAGS; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+    fi
+  done
 
-cat >>confdefs.h <<_ACEOF
-#define GDB_HOST_FLOAT_FORMAT $gdb_host_float_format
-_ACEOF
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbabeltrace" >&5
+$as_echo_n "checking for libbabeltrace... " >&6; }
+if ${ac_cv_libbabeltrace+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
-cat >>confdefs.h <<_ACEOF
-#define GDB_HOST_DOUBLE_FORMAT $gdb_host_double_format
-_ACEOF
+    ac_save_LIBS="$LIBS"
+    LIBS="$LIBS $LIBBABELTRACE"
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <babeltrace/babeltrace.h>
+                        #include <babeltrace/ctf/events.h>
+                        #include <babeltrace/ctf/iterator.h>
+int
+main ()
+{
+struct bt_iter_pos *pos = bt_iter_get_pos (bt_ctf_get_iter (NULL));
+                       struct bt_ctf_event *event = NULL;
+                       const struct bt_definition *scope;
 
+                       pos->type = BT_SEEK_BEGIN;
+                       bt_iter_set_pos (bt_ctf_get_iter (NULL), pos);
+                       scope = bt_ctf_get_top_level_scope (event,
+                                                          BT_STREAM_EVENT_HEADER);
+                       bt_ctf_get_uint64 (bt_ctf_get_field (event, scope, "id"));
 
-cat >>confdefs.h <<_ACEOF
-#define GDB_HOST_LONG_DOUBLE_FORMAT $gdb_host_long_double_format
+  ;
+  return 0;
+}
 _ACEOF
-
-
-# target_subdir is used by the testsuite to find the target libraries.
-target_subdir=
-if test "${host}" != "${target}"; then
-    target_subdir="${target_alias}/"
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_libbabeltrace=yes
+else
+  ac_cv_libbabeltrace=no
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LIBS="$ac_save_LIBS"
 
-
-# Import nat definitions.
-nat_makefile_frag=/dev/null
-if test "${gdb_native}" = "yes"; then
-  . ${srcdir}/configure.nat
-  nativefile=$NAT_FILE
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libbabeltrace" >&5
+$as_echo "$ac_cv_libbabeltrace" >&6; }
+  if test "$ac_cv_libbabeltrace" = yes; then
+    HAVE_LIBBABELTRACE=yes
 
+$as_echo "#define HAVE_LIBBABELTRACE 1" >>confdefs.h
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libbabeltrace" >&5
+$as_echo_n "checking how to link with libbabeltrace... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBBABELTRACE" >&5
+$as_echo "$LIBBABELTRACE" >&6; }
+  else
+    HAVE_LIBBABELTRACE=no
+            CPPFLAGS="$ac_save_CPPFLAGS"
+    LIBBABELTRACE=
+    LTLIBBABELTRACE=
+  fi
 
 
 
 
 
 
+  CFLAGS=$saved_CFLAGS
 
-
-
-if test x"${gdb_osabi}" != x ; then
-
-cat >>confdefs.h <<_ACEOF
-#define GDB_OSABI_DEFAULT $gdb_osabi
-_ACEOF
-
-fi
-
-# Check whether --enable-gdbserver was given.
-if test "${enable_gdbserver+set}" = set; then :
-  enableval=$enable_gdbserver; case "${enableval}" in
-  yes| no|auto) ;;
-  *) as_fn_error $? "bad value ${enableval} for --enable-gdbserver option" "$LINENO" 5 ;;
-esac
-else
-  enable_gdbserver=auto
-fi
-
-
-# We only build gdbserver automatically in a native configuration, and
-# only if the user did not explicitly disable its build.
-if test "$gdb_native" = "yes" -a "$enable_gdbserver" != "no"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gdbserver is supported on this host" >&5
-$as_echo_n "checking whether gdbserver is supported on this host... " >&6; }
-  if test "x$build_gdbserver" = xyes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-    subdirs="$subdirs gdbserver"
-
-    gdbserver_build_enabled=yes
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  if test "$HAVE_LIBBABELTRACE" != yes; then
+     if test "$with_babeltrace" = yes; then
+       as_fn_error $? "babeltrace is missing or unusable" "$LINENO" 5
+     else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: babeltrace is missing or unusable; GDB is unable to read CTF data." >&5
+$as_echo "$as_me: WARNING: babeltrace is missing or unusable; GDB is unable to read CTF data." >&2;}
+     fi
   fi
 fi
 
-# If the user explicitly request the gdbserver to be built, verify that
-# we were in fact able to enable it.
-if test "$enable_gdbserver" = "yes" -a "$gdbserver_build_enabled" != "yes"; then
-  as_fn_error $? "Automatic gdbserver build is not supported for this configuration" "$LINENO" 5
-fi
-
-# Check for babeltrace and babeltrace-ctf
+# Check for xxhash
 
-# Check whether --with-babeltrace was given.
-if test "${with_babeltrace+set}" = set; then :
-  withval=$with_babeltrace;
+# Check whether --with-xxhash was given.
+if test "${with_xxhash+set}" = set; then :
+  withval=$with_xxhash;
 else
-  with_babeltrace=auto
+  with_xxhash=auto
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use babeltrace" >&5
-$as_echo_n "checking whether to use babeltrace... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_babeltrace" >&5
-$as_echo "$with_babeltrace" >&6; }
 
-if test "x$with_babeltrace" = "xno"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: babletrace support disabled; GDB is unable to read CTF data." >&5
-$as_echo "$as_me: WARNING: babletrace support disabled; GDB is unable to read CTF data." >&2;}
-else
-  # Append -Werror to CFLAGS so that configure can catch the warning
-  # "assignment from incompatible pointer type", which is related to
-  # the babeltrace change from 1.0.3 to 1.1.0.  Babeltrace 1.1.0 works
-  # in GDB, while babeltrace 1.0.3 is broken.
-  # AC_LIB_HAVE_LINKFLAGS may modify CPPFLAGS in it, so it should be
-  # safe to save and restore CFLAGS here.
-  saved_CFLAGS=$CFLAGS
-  CFLAGS="$CFLAGS -Werror"
+if test "x$with_xxhash" != "xno"; then
 
 
 
@@ -17093,9 +18422,9 @@ else
   prefix="$acl_save_prefix"
 
 
-# Check whether --with-libbabeltrace-prefix was given.
-if test "${with_libbabeltrace_prefix+set}" = set; then :
-  withval=$with_libbabeltrace_prefix;
+# Check whether --with-libxxhash-prefix was given.
+if test "${with_libxxhash_prefix+set}" = set; then :
+  withval=$with_libxxhash_prefix;
     if test "X$withval" = "Xno"; then
       use_additional=no
     else
@@ -17120,13 +18449,13 @@ if test "${with_libbabeltrace_prefix+set}" = set; then :
 
 fi
 
-      LIBBABELTRACE=
-  LTLIBBABELTRACE=
-  INCBABELTRACE=
+      LIBXXHASH=
+  LTLIBXXHASH=
+  INCXXHASH=
   rpathdirs=
   ltrpathdirs=
   names_already_handled=
-  names_next_round='babeltrace babeltrace-ctf'
+  names_next_round='xxhash '
   while test -n "$names_next_round"; do
     names_this_round="$names_next_round"
     names_next_round=
@@ -17145,9 +18474,9 @@ fi
         if test -n "$value"; then
           if test "$value" = yes; then
             eval value=\"\$LIB$uppername\"
-            test -z "$value" || LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$value"
+            test -z "$value" || LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$value"
             eval value=\"\$LTLIB$uppername\"
-            test -z "$value" || LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }$value"
+            test -z "$value" || LTLIBXXHASH="${LTLIBXXHASH}${LTLIBXXHASH:+ }$value"
           else
                                     :
           fi
@@ -17174,7 +18503,7 @@ fi
             fi
           fi
           if test "X$found_dir" = "X"; then
-            for x in $LDFLAGS $LTLIBBABELTRACE; do
+            for x in $LDFLAGS $LTLIBXXHASH; do
 
   acl_save_prefix="$prefix"
   prefix="$acl_final_prefix"
             done
           fi
           if test "X$found_dir" != "X"; then
-                        LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }-L$found_dir -l$name"
+                        LTLIBXXHASH="${LTLIBXXHASH}${LTLIBXXHASH:+ }-L$found_dir -l$name"
             if test "X$found_so" != "X"; then
                                                         if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
-                                LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_so"
+                                LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$found_so"
               else
                                                                                 haveit=
                 for x in $ltrpathdirs; do
                   ltrpathdirs="$ltrpathdirs $found_dir"
                 fi
                                 if test "$hardcode_direct" = yes; then
-                                                      LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_so"
+                                                      LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$found_so"
                 else
                   if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
-                                                            LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_so"
+                                                            LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$found_so"
                                                             haveit=
                     for x in $rpathdirs; do
                       if test "X$x" = "X$found_dir"; then
@@ -17242,7 +18571,7 @@ fi
                     fi
                   else
                                                                                 haveit=
-                    for x in $LDFLAGS $LIBBABELTRACE; do
+                    for x in $LDFLAGS $LIBXXHASH; do
 
   acl_save_prefix="$prefix"
   prefix="$acl_final_prefix"
                       fi
                     done
                     if test -z "$haveit"; then
-                      LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-L$found_dir"
+                      LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }-L$found_dir"
                     fi
                     if test "$hardcode_minus_L" != no; then
-                                                                                        LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_so"
+                                                                                        LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$found_so"
                     else
-                                                                                                                                                                                LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-l$name"
+                                                                                                                                                                                LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }-l$name"
                     fi
                   fi
                 fi
               fi
             else
               if test "X$found_a" != "X"; then
-                                LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$found_a"
+                                LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$found_a"
               else
-                                                LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-L$found_dir -l$name"
+                                                LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }-L$found_dir -l$name"
               fi
             fi
                         additional_includedir=
@@ -17293,7 +18622,7 @@ fi
                   fi
                 fi
                 if test -z "$haveit"; then
-                  for x in $CPPFLAGS $INCBABELTRACE; do
+                  for x in $CPPFLAGS $INCXXHASH; do
 
   acl_save_prefix="$prefix"
   prefix="$acl_final_prefix"
@@ -17310,7 +18639,7 @@ fi
                   done
                   if test -z "$haveit"; then
                     if test -d "$additional_includedir"; then
-                                            INCBABELTRACE="${INCBABELTRACE}${INCBABELTRACE:+ }-I$additional_includedir"
+                                            INCXXHASH="${INCXXHASH}${INCXXHASH:+ }-I$additional_includedir"
                     fi
                   fi
                 fi
@@ -17338,7 +18667,7 @@ fi
                       fi
                       if test -z "$haveit"; then
                         haveit=
-                        for x in $LDFLAGS $LIBBABELTRACE; do
+                        for x in $LDFLAGS $LIBXXHASH; do
 
   acl_save_prefix="$prefix"
   prefix="$acl_final_prefix"
                         done
                         if test -z "$haveit"; then
                           if test -d "$additional_libdir"; then
-                                                        LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-L$additional_libdir"
+                                                        LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }-L$additional_libdir"
                           fi
                         fi
                         haveit=
-                        for x in $LDFLAGS $LTLIBBABELTRACE; do
+                        for x in $LDFLAGS $LTLIBXXHASH; do
 
   acl_save_prefix="$prefix"
   prefix="$acl_final_prefix"
@@ -17376,7 +18705,7 @@ fi
                         done
                         if test -z "$haveit"; then
                           if test -d "$additional_libdir"; then
-                                                        LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }-L$additional_libdir"
+                                                        LTLIBXXHASH="${LTLIBXXHASH}${LTLIBXXHASH:+ }-L$additional_libdir"
                           fi
                         fi
                       fi
                                                                                 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
                     ;;
                   *)
-                                        LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$dep"
-                    LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }$dep"
+                                        LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$dep"
+                    LTLIBXXHASH="${LTLIBXXHASH}${LTLIBXXHASH:+ }$dep"
                     ;;
                 esac
               done
             fi
           else
-                                                            LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }-l$name"
-            LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }-l$name"
+                                                            LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }-l$name"
+            LTLIBXXHASH="${LTLIBXXHASH}${LTLIBXXHASH:+ }-l$name"
           fi
         fi
       fi
       libdir="$alldirs"
       eval flag=\"$hardcode_libdir_flag_spec\"
       libdir="$acl_save_libdir"
-      LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$flag"
+      LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$flag"
     else
             for found_dir in $rpathdirs; do
         acl_save_libdir="$libdir"
         libdir="$found_dir"
         eval flag=\"$hardcode_libdir_flag_spec\"
         libdir="$acl_save_libdir"
-        LIBBABELTRACE="${LIBBABELTRACE}${LIBBABELTRACE:+ }$flag"
+        LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$flag"
       done
     fi
   fi
   if test "X$ltrpathdirs" != "X"; then
             for found_dir in $ltrpathdirs; do
-      LTLIBBABELTRACE="${LTLIBBABELTRACE}${LTLIBBABELTRACE:+ }-R$found_dir"
+      LTLIBXXHASH="${LTLIBXXHASH}${LTLIBXXHASH:+ }-R$found_dir"
     done
   fi
 
 
         ac_save_CPPFLAGS="$CPPFLAGS"
 
-  for element in $INCBABELTRACE; do
+  for element in $INCXXHASH; do
     haveit=
     for x in $CPPFLAGS; do
 
   done
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbabeltrace" >&5
-$as_echo_n "checking for libbabeltrace... " >&6; }
-if ${ac_cv_libbabeltrace+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxxhash" >&5
+$as_echo_n "checking for libxxhash... " >&6; }
+if ${ac_cv_libxxhash+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
     ac_save_LIBS="$LIBS"
-    LIBS="$LIBS $LIBBABELTRACE"
+    LIBS="$LIBS $LIBXXHASH"
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <babeltrace/babeltrace.h>
-                        #include <babeltrace/ctf/events.h>
-                        #include <babeltrace/ctf/iterator.h>
+#include <xxhash.h>
 int
 main ()
 {
-struct bt_iter_pos *pos = bt_iter_get_pos (bt_ctf_get_iter (NULL));
-                       struct bt_ctf_event *event = NULL;
-                       const struct bt_definition *scope;
-
-                       pos->type = BT_SEEK_BEGIN;
-                       bt_iter_set_pos (bt_ctf_get_iter (NULL), pos);
-                       scope = bt_ctf_get_top_level_scope (event,
-                                                          BT_STREAM_EVENT_HEADER);
-                       bt_ctf_get_uint64 (bt_ctf_get_field (event, scope, "id"));
+XXH32("foo", 3, 0);
 
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_libbabeltrace=yes
+  ac_cv_libxxhash=yes
 else
-  ac_cv_libbabeltrace=no
+  ac_cv_libxxhash=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
     LIBS="$ac_save_LIBS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libbabeltrace" >&5
-$as_echo "$ac_cv_libbabeltrace" >&6; }
-  if test "$ac_cv_libbabeltrace" = yes; then
-    HAVE_LIBBABELTRACE=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libxxhash" >&5
+$as_echo "$ac_cv_libxxhash" >&6; }
+  if test "$ac_cv_libxxhash" = yes; then
+    HAVE_LIBXXHASH=yes
 
-$as_echo "#define HAVE_LIBBABELTRACE 1" >>confdefs.h
+$as_echo "#define HAVE_LIBXXHASH 1" >>confdefs.h
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libbabeltrace" >&5
-$as_echo_n "checking how to link with libbabeltrace... " >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBBABELTRACE" >&5
-$as_echo "$LIBBABELTRACE" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libxxhash" >&5
+$as_echo_n "checking how to link with libxxhash... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXXHASH" >&5
+$as_echo "$LIBXXHASH" >&6; }
   else
-    HAVE_LIBBABELTRACE=no
+    HAVE_LIBXXHASH=no
             CPPFLAGS="$ac_save_CPPFLAGS"
-    LIBBABELTRACE=
-    LTLIBBABELTRACE=
+    LIBXXHASH=
+    LTLIBXXHASH=
   fi
 
 
@@ -17544,40 +18863,40 @@ $as_echo "$LIBBABELTRACE" >&6; }
 
 
 
-  CFLAGS=$saved_CFLAGS
-
-  if test "$HAVE_LIBBABELTRACE" != yes; then
-     if test "$with_babeltrace" = yes; then
-       as_fn_error $? "babeltrace is missing or unusable" "$LINENO" 5
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: babeltrace is missing or unusable; GDB is unable to read CTF data." >&5
-$as_echo "$as_me: WARNING: babeltrace is missing or unusable; GDB is unable to read CTF data." >&2;}
-     fi
+  if test "$HAVE_LIBXXHASH" != yes; then
+    if test "$with_xxhash" = yes; then
+      as_fn_error $? "xxhash is missing or unusable" "$LINENO" 5
+    fi
+  fi
+  if test "x$with_xxhash" = "xauto"; then
+    with_xxhash="$HAVE_LIBXXHASH"
   fi
 fi
 
-# If nativefile (NAT_FILE) is not set in configure.nat, we link to an
-# empty version.
-
-files=
-links=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use xxhash" >&5
+$as_echo_n "checking whether to use xxhash... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_xxhash" >&5
+$as_echo "$with_xxhash" >&6; }
 
+NM_H=
 rm -f nm.h
 if test "${nativefile}" != ""; then
     case "${nativefile}" in
       nm-*.h ) GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}" ;;
       * ) GDB_NM_FILE="${nativefile}"
     esac
-    files="${files} ${GDB_NM_FILE}"
-    links="${links} nm.h"
+    ac_config_links="$ac_config_links nm.h:$GDB_NM_FILE"
+
 
 cat >>confdefs.h <<_ACEOF
 #define GDB_NM_FILE "${GDB_NM_FILE}"
 _ACEOF
 
+    NM_H=nm.h
 fi
 
 
+
 for ac_prog in xsltproc
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -17631,16 +18950,6 @@ if test "x$USE_MAINTAINER_MODE" = xyes; then
 fi
 
 
-ac_sources="$files"
-ac_dests="$links"
-while test -n "$ac_sources"; do
-  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
-  set $ac_sources; ac_source=$1; shift; ac_sources=$*
-  ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
-done
-ac_config_links="$ac_config_links $ac_config_links_1"
-
-
 
 
 
@@ -18406,6 +19715,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # INIT-COMMANDS
 #
 ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR
+GDB_NM_FILE=$GDB_NM_FILE
 
 _ACEOF
 
@@ -18418,7 +19728,7 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "jit-reader.h") CONFIG_FILES="$CONFIG_FILES jit-reader.h:jit-reader.in" ;;
-    "$ac_config_links_1") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_1" ;;
+    "nm.h") CONFIG_LINKS="$CONFIG_LINKS nm.h:$GDB_NM_FILE" ;;
     "gcore") CONFIG_FILES="$CONFIG_FILES gcore" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "gdb-gdb.gdb") CONFIG_FILES="$CONFIG_FILES gdb-gdb.gdb" ;;
@@ -19051,38 +20361,10 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
 
   case $ac_file$ac_mode in
+    "config.h":H) echo > stamp-h ;;
     "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;;
+    "nm.h":L) echo > stamp-nmh ;;
     "gcore":F) chmod +x gcore ;;
-    "Makefile":F)
-case x$CONFIG_HEADERS in
-xconfig.h:config.in)
-echo > stamp-h ;;
-esac
- ;;
-    "gdb-gdb.gdb":F)
-case x$CONFIG_HEADERS in
-xconfig.h:config.in)
-echo > stamp-h ;;
-esac
- ;;
-    "gdb-gdb.py":F)
-case x$CONFIG_HEADERS in
-xconfig.h:config.in)
-echo > stamp-h ;;
-esac
- ;;
-    "doc/Makefile":F)
-case x$CONFIG_HEADERS in
-xconfig.h:config.in)
-echo > stamp-h ;;
-esac
- ;;
-    "data-directory/Makefile":F)
-case x$CONFIG_HEADERS in
-xconfig.h:config.in)
-echo > stamp-h ;;
-esac
- ;;
 
   esac
 done # for ac_tag
This page took 0.09479 seconds and 4 git commands to generate.