public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdbsupport: move libxxhash configure check to gdbsupport
@ 2023-01-05 19:40 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2023-01-05 19:40 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8b35ed1febd786c7aec34bbd7080c73a7c91bfca

commit 8b35ed1febd786c7aec34bbd7080c73a7c91bfca
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Thu Oct 20 12:47:07 2022 -0400

    gdbsupport: move libxxhash configure check to gdbsupport
    
    The following patch moves the fast_hash function, which uses libxxhash,
    to gdbsupport.  Move the libxxhash configure check to gdbsupport (and
    transitively to gdbserver).
    
    Change-Id: I242499e50c8cd6fe9f51e6e92dc53a1b3daaa96e
    Approved-By: Andrew Burgess <aburgess@redhat.com>

Diff:
---
 gdb/configure          | 5994 ++++++++++++++++++++++++------------------------
 gdb/configure.ac       |   23 -
 gdbserver/config.in    |    3 +
 gdbserver/configure    |  514 +++++
 gdbsupport/Makefile.in |    3 +
 gdbsupport/common.m4   |   24 +
 gdbsupport/config.in   |    3 +
 gdbsupport/configure   |  514 +++++
 8 files changed, 4058 insertions(+), 3020 deletions(-)

diff --git a/gdb/configure b/gdb/configure
index 40dbec7efa4..0591d187f0a 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -638,9 +638,6 @@ GDB_TRANSFORM_NAME
 XSLTPROC
 NM_H
 GDB_NM_FILE
-LTLIBXXHASH
-LIBXXHASH
-HAVE_LIBXXHASH
 CTF_DEPS
 LIBCTF
 LTLIBBABELTRACE
@@ -716,6 +713,9 @@ SYSTEM_GDBINIT
 TARGET_SYSTEM_ROOT
 CONFIG_LDFLAGS
 RDYNAMIC
+LTLIBXXHASH
+LIBXXHASH
+HAVE_LIBXXHASH
 LTLIBIPT
 LIBIPT
 HAVE_LIBIPT
@@ -938,6 +938,9 @@ enable_threading
 with_intel_pt
 with_libipt_prefix
 with_libipt_type
+with_xxhash
+with_libxxhash_prefix
+with_libxxhash_type
 with_sysroot
 with_system_gdbinit
 with_system_gdbinit_dir
@@ -956,10 +959,7 @@ enable_libbacktrace
 with_babeltrace
 with_libbabeltrace_prefix
 with_libbabeltrace_type
-with_xxhash
 enable_libctf
-with_libxxhash_prefix
-with_libxxhash_type
 enable_unit_tests
 '
       ac_precious_vars='build_alias
@@ -1700,6 +1700,10 @@ Optional Packages:
   --with-libipt-prefix[=DIR]  search for libipt in DIR/include and DIR/lib
   --without-libipt-prefix     don't search for libipt in includedir and libdir
   --with-libipt-type=TYPE     type of library to search for (auto/static/shared)
+  --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
+  --with-libxxhash-type=TYPE     type of library to search for (auto/static/shared)
   --with-sysroot[=DIR]    search for usr/lib et al within DIR
   --with-system-gdbinit=PATH
                           automatically load a system-wide gdbinit file
@@ -1717,10 +1721,6 @@ Optional Packages:
   --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-libbabeltrace-type=TYPE     type of library to search for (auto/static/shared)
-  --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
-  --with-libxxhash-type=TYPE     type of library to search for (auto/static/shared)
 
 Some influential environment variables:
   CC          C compiler command
@@ -25975,3669 +25975,3633 @@ $as_echo "$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6; }
 
   fi
 
+    # Check for xxhash
 
-# Check the return and argument types of ptrace.
-
-
-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
-
-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
-'
-
-# 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.  */
- $gdb_ptrace_headers
-int
-main ()
-{
-extern long ptrace (enum __ptrace_request, ...);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_func_ptrace_ret='long'
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$gdb_ptrace_headers
-int
-main ()
-{
-extern int ptrace ();
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_func_ptrace_ret='int'
+# Check whether --with-xxhash was given.
+if test "${with_xxhash+set}" = set; then :
+  withval=$with_xxhash;
 else
-  gdb_cv_func_ptrace_ret='long'
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
+  with_xxhash=auto
 fi
-{ $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 PTRACE_TYPE_RET $gdb_cv_func_ptrace_ret
-_ACEOF
 
+  if test "x$with_xxhash" != "xno"; 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.  */
-$gdb_ptrace_headers
-int
-main ()
-{
-extern long ptrace (enum __ptrace_request, ...);
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_func_ptrace_args='enum __ptrace_request,int,long,long'
-else
-  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 ()
-{
-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_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'}
 
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    use_additional=yes
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_args" >&5
-$as_echo "$gdb_cv_func_ptrace_args" >&6; }
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
 
-ac_save_IFS=$IFS; IFS=','
-set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'`
-IFS=$ac_save_IFS
-shift
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
 
-cat >>confdefs.h <<_ACEOF
-#define PTRACE_TYPE_ARG1 $1
-_ACEOF
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
 
 
-cat >>confdefs.h <<_ACEOF
-#define PTRACE_TYPE_ARG3 $3
-_ACEOF
+# 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
+      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"
 
-cat >>confdefs.h <<_ACEOF
-#define PTRACE_TYPE_ARG4 $4
-_ACEOF
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
 
-if test -n "$5"; then
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
 
-cat >>confdefs.h <<_ACEOF
-#define PTRACE_TYPE_ARG5 $5
-_ACEOF
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/lib"
+      fi
+    fi
 
 fi
 
 
-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.  */
-$ac_includes_default
-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;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_setpgrp_void=no
+# Check whether --with-libxxhash-type was given.
+if test "${with_libxxhash_type+set}" = set; then :
+  withval=$with_libxxhash_type;  with_libxxhash_type=$withval
 else
-  ac_cv_func_setpgrp_void=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
+   with_libxxhash_type=auto
 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
+  lib_type=`eval echo \$with_libxxhash_type`
 
-fi
-
-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.  */
-#include <unistd.h>
-int
-main ()
-{
-if (setpgrp(1,1) == -1)
-	     exit (0);
-	   else
-	     exit (1);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_func_setpgrp_void=no
-else
-  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
-
-fi
-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.  */
-#include <sys/param.h>
-	 #define _KMEMUSER
-	 #include <sys/lwp.h>
-int
-main ()
-{
-struct lwp l;
-
-  ;
-  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
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-	 #include <machine/reg.h>
-int
-main ()
-{
-struct reg r;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_struct_reg=yes
-else
-  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
-
-$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/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.  */
-#include <sys/ptrace.h>
-int
-main ()
-{
-PTRACE_GETREGS;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_have_ptrace_getregs=yes
-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
-/* end confdefs.h.  */
-#include <sys/ptrace.h>
-int
-main ()
-{
-PTRACE_GETFPXREGS;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_have_ptrace_getfpxregs=yes
-else
-  gdb_cv_have_ptrace_getfpxregs=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_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
-/* end confdefs.h.  */
-#include <sys/types.h>
-	 #include <sys/ptrace.h>
-int
-main ()
-{
-PT_GETDBREGS;
-
-  ;
-  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
+      LIBXXHASH=
+  LTLIBXXHASH=
+  INCXXHASH=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='xxhash '
+  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" || LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIBXXHASH="${LTLIBXXHASH}${LTLIBXXHASH:+ }$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" && test x$lib_type != xstatic; 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
+            elif test x$lib_type != xshared; then
+              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 $LTLIBXXHASH; do
 
-fi
+  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"
 
-{ $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
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext" && test x$lib_type != xstatic; 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
+                  elif test x$lib_type != xshared; then
+                    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
+                        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
+                                LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$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
+                                                      LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$found_so"
+                else
+                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+                                                            LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$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 $LIBXXHASH; do
 
-$as_echo "#define HAVE_PT_GETDBREGS 1" >>confdefs.h
+  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"
 
-fi
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }-L$found_dir"
+                    fi
+                    if test "$hardcode_minus_L" != no; then
+                                                                                        LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$found_so"
+                    else
+                                                                                                                                                                                LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                                LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$found_a"
+              else
+                                                LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }-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 $INCXXHASH; do
 
-# 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 :
+  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"
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME 1
-_ACEOF
+                    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
+                                            INCXXHASH="${INCXXHASH}${INCXXHASH:+ }-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 $LIBXXHASH; 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"
 
-fi
+                          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
+                                                        LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }-L$additional_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIBXXHASH; 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"
 
-# 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 "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LTLIBXXHASH="${LTLIBXXHASH}${LTLIBXXHASH:+ }-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$,,'`
+                    ;;
+                  *)
+                                        LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$dep"
+                    LTLIBXXHASH="${LTLIBXXHASH}${LTLIBXXHASH:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+                                                            if test "x$lib_type" = "xauto" || test "x$lib_type" = "xshared"; then
+              LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }-l$name"
+              LTLIBXXHASH="${LTLIBXXHASH}${LTLIBXXHASH:+ }-l$name"
+            else
+              LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }-l:lib$name.$libext"
+              LTLIBXXHASH="${LTLIBXXHASH}${LTLIBXXHASH:+ }-l:lib$name.$libext"
+            fi
+          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"
+      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"
+        LIBXXHASH="${LIBXXHASH}${LIBXXHASH:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+            for found_dir in $ltrpathdirs; do
+      LTLIBXXHASH="${LTLIBXXHASH}${LTLIBXXHASH:+ }-R$found_dir"
+    done
+  fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE 1
-_ACEOF
 
+        ac_save_CPPFLAGS="$CPPFLAGS"
 
-fi
+  for element in $INCXXHASH; 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
 
-# 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 "$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
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+    ac_save_LIBS="$LIBS"
+    LIBS="$LIBS $LIBXXHASH"
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-extern long long foo;
+#include <xxhash.h>
 int
 main ()
 {
-switch (foo & 2) { case 0: return 1; }
+XXH32("foo", 3, 0);
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_c_long_long=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_libxxhash=yes
 else
-  gdb_cv_c_long_long=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_libxxhash=no
 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
+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_libxxhash" >&5
+$as_echo "$ac_cv_libxxhash" >&6; }
+  if test "$ac_cv_libxxhash" = yes; then
+    HAVE_LIBXXHASH=yes
 
-# Check if the compiler and runtime support printing decfloats.
+$as_echo "#define HAVE_LIBXXHASH 1" >>confdefs.h
 
-{ $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 ()
-{
-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_run "$LINENO"; then :
-  gdb_cv_printf_has_decfloat=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
+    { $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_LIBXXHASH=no
+            CPPFLAGS="$ac_save_CPPFLAGS"
+    LIBXXHASH=
+    LTLIBXXHASH=
+  fi
 
-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
 
-$as_echo "#define PRINTF_HAS_DECFLOAT 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.
 
-{ $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
-  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
 
-$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
+    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
 
-fi
+  { $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; }
 
-# 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.  */
-$ac_includes_default
-int
-main ()
-{
-char buf[16];
-  long double f = 3.141592653;
-  sprintf (buf, "%Lg", f);
-  return (strncmp ("3.14159", buf, 7));
-  ;
-  return 0;
-}
+# Check the return and argument types of ptrace.
+
+
+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 ac_fn_c_try_run "$LINENO"; then :
-  gdb_cv_printf_has_long_double=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
 
 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
+done
 
-fi
 
-# Check if the compiler and runtime support scanning long doubles.
+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
+'
 
-{ $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 :
+# 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
-  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>
+ $gdb_ptrace_headers
 int
 main ()
 {
-char *buf = "3.141592653";
-  long double f = 0;
-  sscanf (buf, "%Lg", &f);
-  return !(f > 3.14159 && f < 3.14160);
+extern long ptrace (enum __ptrace_request, ...);
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gdb_cv_scanf_has_long_double=yes
-else
-  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
-
-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
-
-$as_echo "#define SCANF_HAS_LONG_DOUBLE 1" >>confdefs.h
-
-fi
-
-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
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_func_ptrace_ret='long'
 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.  */
-
+$gdb_ptrace_headers
 int
 main ()
 {
-int i;
+extern int ptrace ();
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_func_ptrace_ret='int'
 else
-  gdb_cv_bigtoc=
+  gdb_cv_func_ptrace_ret='long'
 
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-     LDFLAGS="${SAVE_LDFLAGS}"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 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}: result: $gdb_cv_func_ptrace_ret" >&5
+$as_echo "$gdb_cv_func_ptrace_ret" >&6; }
+
+
+cat >>confdefs.h <<_ACEOF
+#define PTRACE_TYPE_RET $gdb_cv_func_ptrace_ret
+_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.  */
 
+# 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.  */
+$gdb_ptrace_headers
 int
 main ()
 {
+extern long ptrace (enum __ptrace_request, ...);
 
   ;
   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.
-
-     # 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
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_func_ptrace_args='enum __ptrace_request,int,long,long'
 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 "Python.h"
+$gdb_ptrace_headers
 int
 main ()
 {
-int err;
-          Py_Initialize ();
-          err = PyRun_SimpleString ("import ctypes\n");
-          Py_Finalize ();
-          return err == 0 ? 0 : 1;
+extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
+
   ;
   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 :
+  gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4";
+		 break 4;
 
-     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
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5
-$as_echo "$found" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether execinfo.h backtrace is available" >&5
-$as_echo_n "checking whether execinfo.h backtrace is available... " >&6; }
-if ${gdb_cv_execinfo_backtrace+:} 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 <execinfo.h>
-
+$gdb_ptrace_headers
 int
 main ()
 {
-
-         int f;
-         void *b[2];
-         f = backtrace (b, 2);
-         backtrace_symbols_fd (b, f, 2);
+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_link "$LINENO"; then :
-  gdb_cv_execinfo_backtrace=yes
-else
-  gdb_cv_execinfo_backtrace=no
+if ac_fn_c_try_compile "$LINENO"; then :
+  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_exeext conftest.$ac_ext
+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'}
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_execinfo_backtrace" >&5
-$as_echo "$gdb_cv_execinfo_backtrace" >&6; }
-if test "$gdb_cv_execinfo_backtrace" = yes; then
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-$as_echo "#define HAVE_EXECINFO_BACKTRACE 1" >>confdefs.h
+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
+
+cat >>confdefs.h <<_ACEOF
+#define PTRACE_TYPE_ARG1 $1
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PTRACE_TYPE_ARG3 $3
+_ACEOF
+
+
+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
 
 fi
 
 
-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 :
+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.  */
-#include <sys/pthdebug.h>
+$ac_includes_default
 int
 main ()
 {
-#ifndef PTHDB_VERSION_3
-	       #error
-	       #endif
-
+/* 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 :
-  gdb_cv_have_aix_thread_debug=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_setpgrp_void=no
 else
-  gdb_cv_have_aix_thread_debug=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
 
-      { $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
+{ $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
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETTHRDS $ac_have_decl
-_ACEOF
-
-      fi
-      ;;
-   esac
+$as_echo "#define SETPGRP_VOID 1" >>confdefs.h
 
 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 :
+
+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.  */
-#include <thread_db.h>
+#include <unistd.h>
 int
 main ()
 {
-int i = TD_NOTALLOC;
+if (setpgrp(1,1) == -1)
+	     exit (0);
+	   else
+	     exit (1);
 
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_thread_db_h_has_td_notalloc=yes
+  ac_cv_func_setpgrp_void=no
 else
-  gdb_cv_thread_db_h_has_td_notalloc=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: $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}: 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
 
-  { $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 :
+fi
+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.  */
-#include <thread_db.h>
+#include <sys/param.h>
+	 #define _KMEMUSER
+	 #include <sys/lwp.h>
 int
 main ()
 {
-int i = TD_VERSION;
+struct lwp l;
 
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_thread_db_h_has_td_version=yes
+  gdb_cv_struct_lwp=yes
 else
-  gdb_cv_thread_db_h_has_td_version=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_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}: result: $gdb_cv_struct_lwp" >&5
+$as_echo "$gdb_cv_struct_lwp" >&6; }
+if test "$gdb_cv_struct_lwp" = yes; then
 
-  { $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 "#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
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <thread_db.h>
+#include <sys/types.h>
+	 #include <machine/reg.h>
 int
 main ()
 {
-int i = TD_NOTLS;
+struct reg r;
 
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_thread_db_h_has_td_notls=yes
+  gdb_cv_struct_reg=yes
 else
-  gdb_cv_thread_db_h_has_td_notls=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_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
-
-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
-
-fi
-if test "x$gdb_cv_thread_db_h_has_td_notls" = "xyes"; then
+{ $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 THREAD_DB_HAS_TD_NOTLS 1" >>confdefs.h
+$as_echo "#define HAVE_STRUCT_REG 1" >>confdefs.h
 
 fi
 
-case $host_os in
-  go32* | *djgpp*)
-    gdbinit=gdb.ini
-    ;;
-  *)
-    gdbinit=.gdbinit
-    ;;
-esac
-
-cat >>confdefs.h <<_ACEOF
-#define GDBINIT "$gdbinit"
-_ACEOF
-
-
+# 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 GDBEARLYINIT ".gdbearlyinit"
+#define HAVE_STRUCT_REG_R_FS 1
 _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
-
-# 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
-
-
-  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`
+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 TARGET_SYSTEM_ROOT "$ac_define_dir"
+#define HAVE_STRUCT_REG_R_GS 1
 _ACEOF
 
 
+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 TARGET_SYSTEM_ROOT_RELOCATABLE $value
+# 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.  */
+#include <sys/ptrace.h>
+int
+main ()
+{
+PTRACE_GETREGS;
+  ;
+  return 0;
+}
 _ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_have_ptrace_getregs=yes
+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
 
-# 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=
 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
+/* end confdefs.h.  */
+#include <sys/ptrace.h>
+int
+main ()
+{
+PTRACE_GETFPXREGS;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_have_ptrace_getfpxregs=yes
+else
+  gdb_cv_have_ptrace_getfpxregs=no
 
-  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`
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-cat >>confdefs.h <<_ACEOF
-#define SYSTEM_GDBINIT "$ac_define_dir"
-_ACEOF
+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
 
-  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
+# 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.  */
+#include <sys/types.h>
+	 #include <sys/ptrace.h>
+int
+main ()
+{
+PT_GETDBREGS;
 
-cat >>confdefs.h <<_ACEOF
-#define SYSTEM_GDBINIT_RELOCATABLE $value
+  ;
+  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
 
-# 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
 
-
-  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`
+# 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 SYSTEM_GDBINIT_DIR "$ac_define_dir"
+#define HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME 1
 _ACEOF
 
 
+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
+# 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 SYSTEM_GDBINIT_DIR_RELOCATABLE $value
+#define HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE 1
 _ACEOF
 
 
+fi
 
 
+# Check if the compiler supports the `long long' type.
 
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking the compiler type" >&5
-$as_echo_n "checking the compiler type... " >&6; }
-if ${gdb_cv_compiler_type+:} false; then :
+{ $as_echo "$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
-  gdb_cv_compiler_type=unknown
-  if test "$gdb_cv_compiler_type" = unknown; then
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
+extern long long foo;
 int
 main ()
 {
-
-                          #if !defined __GNUC__ || defined __clang__
-                          #error not gcc
-                          #endif
-
+switch (foo & 2) { case 0: return 1; }
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gdb_cv_compiler_type=gcc
+  gdb_cv_c_long_long=yes
+else
+  gdb_cv_c_long_long=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  fi
+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
 
-  if test "$gdb_cv_compiler_type" = unknown; then
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.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 ()
 {
-
-                          #ifndef __clang__
-                          #error not clang
-                          #endif
-
+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_compiler_type=clang
+if ac_fn_c_try_run "$LINENO"; then :
+  gdb_cv_printf_has_decfloat=yes
+else
+  gdb_cv_printf_has_decfloat=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  fi
-
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_compiler_type" >&5
-$as_echo "$gdb_cv_compiler_type" >&6; }
 
- GDB_COMPILER_TYPE="$gdb_cv_compiler_type"
+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
 
+$as_echo "#define PRINTF_HAS_DECFLOAT 1" >>confdefs.h
 
-# 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
 
+# 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.
 
-# 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
+{ $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
+  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
-
-WERROR_CFLAGS=""
-if test "${ERROR_ON_WARNING}" = yes ; then
-    WERROR_CFLAGS="-Werror"
+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
 
-# 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 \
--Wmissing-declarations \
--Wstrict-null-sentinel \
-"
+$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
 
-# The -Wmissing-prototypes flag will be accepted by GCC, but results
-# in a warning being printed about the flag not being valid for C++,
-# this is something to do with using ccache, and argument ordering.
-if test "$GDB_COMPILER_TYPE" != gcc; then
-  build_warnings="$build_warnings -Wmissing-prototypes"
 fi
 
-case "${host}" in
-  *-*-mingw32*)
-    # Enable -Wno-format by default when using gcc on mingw since many
-    # 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 if the compiler and runtime support printing long doubles.
 
-# 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
+{ $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.  */
+$ac_includes_default
+int
+main ()
+{
+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_run "$LINENO"; then :
+  gdb_cv_printf_has_long_double=yes
+else
+  gdb_cv_printf_has_long_double=no
 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
+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
 
-# 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 "#define PRINTF_HAS_LONG_DOUBLE 1" >>confdefs.h
 
+fi
 
-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
+# Check if the compiler and runtime support scanning long doubles.
 
-	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
+{ $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.  */
-struct scoped_restore_base {};
-		    struct scoped_restore_tmpl : public scoped_restore_base {
-		      ~scoped_restore_tmpl() {}
-		    };
+#include <stdio.h>
 int
 main ()
 {
-const scoped_restore_base &b = scoped_restore_tmpl();
-
+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_cxx_try_compile "$LINENO"; then :
-  WARN_CFLAGS="${WARN_CFLAGS} $w"
+if ac_fn_c_try_run "$LINENO"; then :
+  gdb_cv_scanf_has_long_double=yes
+else
+  gdb_cv_scanf_has_long_double=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-	    else
-	      cat confdefs.h - <<_ACEOF >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_scanf_has_long_double" >&5
+$as_echo "$gdb_cv_scanf_has_long_double" >&6; }
+if test "$gdb_cv_scanf_has_long_double" = yes; then
+
+$as_echo "#define SCANF_HAS_LONG_DOUBLE 1" >>confdefs.h
+
+fi
+
+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
+  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
 /* end confdefs.h.  */
 
 int
 main ()
 {
-
+int i;
   ;
   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
+if ac_fn_c_try_link "$LINENO"; then :
 
+else
+  gdb_cv_bigtoc=
 
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     LDFLAGS="${SAVE_LDFLAGS}"
 
-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
+{ $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
 
+{ $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.  */
 
+int
+main ()
+{
 
-# Check whether --enable-ubsan was given.
-if test "${enable_ubsan+set}" = set; then :
-  enableval=$enable_ubsan;
+  ;
+  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.
+
+     # 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
-  enable_ubsan=no
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include "Python.h"
+int
+main ()
+{
+int err;
+          Py_Initialize ();
+          err = PyRun_SimpleString ("import ctypes\n");
+          Py_Finalize ();
+          return err == 0 ? 0 : 1;
+  ;
+  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 test "x$enable_ubsan" = xauto; then
-  if $development; then
-    enable_ubsan=yes
-  fi
+     LIBS="$old_LIBS"
+     CFLAGS="$old_CFLAGS"
+     CPPFLAGS="$old_CPPFLAGS"
+   fi
+   LDFLAGS="$old_LDFLAGS"
 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 $dynamic_list; then
+  found="-Wl,--dynamic-list"
+  RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'
+else
+  found="-rdynamic"
+  RDYNAMIC="-rdynamic"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5
+$as_echo "$found" >&6; }
 
-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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether execinfo.h backtrace is available" >&5
+$as_echo_n "checking whether execinfo.h backtrace is available... " >&6; }
+if ${gdb_cv_execinfo_backtrace+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+         #include <execinfo.h>
+
 int
 main ()
 {
 
+         int f;
+         void *b[2];
+         f = backtrace (b, 2);
+         backtrace_symbols_fd (b, f, 2);
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  enable_ubsan=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  gdb_cv_execinfo_backtrace=yes
 else
-  enable_ubsan=no
-
+  gdb_cv_execinfo_backtrace=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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_execinfo_backtrace" >&5
+$as_echo "$gdb_cv_execinfo_backtrace" >&6; }
+if test "$gdb_cv_execinfo_backtrace" = yes; then
 
+$as_echo "#define HAVE_EXECINFO_BACKTRACE 1" >>confdefs.h
 
+fi
 
-# 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 :
+
+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.  */
+#include <sys/pthdebug.h>
+int
+main ()
+{
+#ifndef PTHDB_VERSION_3
+	       #error
+	       #endif
 
-#if defined (__CYGWIN__) || defined (__CYGWIN32__)
-lose
-#endif
+  ;
+  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_have_aix_thread_debug=yes
 else
-  gdb_cv_os_cygwin=no
-fi
-rm -f conftest*
+  gdb_cv_have_aix_thread_debug=no
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_os_cygwin" >&5
-$as_echo "$gdb_cv_os_cygwin" >&6; }
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-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
 
+      { $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"
 
-# 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
+         # 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
 
-# The ser-tcp.c module requires sockets.
-# Note that WIN32APILIBS is set by GDB_AC_COMMON.
-WIN32LIBS="$WIN32LIBS $WIN32APILIBS"
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETTHRDS $ac_have_decl
+_ACEOF
 
-# Add ELF support to GDB, but only if BFD includes ELF support.
+      fi
+      ;;
+   esac
 
-  OLD_CFLAGS=$CFLAGS
-  OLD_LDFLAGS=$LDFLAGS
-  OLD_LIBS=$LIBS
-  OLD_CC=$CC
-  # 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"
-  LDFLAGS="-L../bfd -L../libiberty"
-  intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
-  LIBS="-lbfd -liberty $intl $LIBS"
-  CC="./libtool --quiet --mode=link $CC"
-  { $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 :
+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 :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdlib.h>
-	   #include <string.h>
-	   #include "bfd.h"
-	   #include "elf-bfd.h"
+#include <thread_db.h>
 int
 main ()
 {
-return bfd_get_elf_phdr_upper_bound (NULL);
+int i = TD_NOTALLOC;
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gdb_cv_var_elf=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_thread_db_h_has_td_notalloc=yes
 else
-  gdb_cv_var_elf=no
+  gdb_cv_thread_db_h_has_td_notalloc=no
 
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext 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_var_elf" >&5
-$as_echo "$gdb_cv_var_elf" >&6; }
-  CC=$OLD_CC
-  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 \
-		gcore-elf.o elf-none-tdep.o"
-
-$as_echo "#define HAVE_ELF 1" >>confdefs.h
+{ $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; }
 
-  # -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 "$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
-  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 <thread_db.h>
 int
 main ()
 {
-return dlopen ();
+int i = TD_VERSION;
+
   ;
   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 :
-
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_thread_db_h_has_td_version=yes
 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"
+  gdb_cv_thread_db_h_has_td_version=no
 
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-  fi
 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; }
 
-# Add macho support to GDB, but only if BFD includes it.
-
-  OLD_CFLAGS=$CFLAGS
-  OLD_LDFLAGS=$LDFLAGS
-  OLD_LIBS=$LIBS
-  OLD_CC=$CC
-  # 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"
-  LDFLAGS="-L../bfd -L../libiberty"
-  intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
-  LIBS="-lbfd -liberty $intl $LIBS"
-  CC="./libtool --quiet --mode=link $CC"
-  { $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 "$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 <stdlib.h>
-	   #include <string.h>
-	   #include "bfd.h"
-	   #include "mach-o.h"
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <thread_db.h>
 int
 main ()
 {
-return bfd_mach_o_lookup_command (NULL, 0, NULL);
+int i = TD_NOTLS;
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gdb_cv_var_macho=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_thread_db_h_has_td_notls=yes
 else
-  gdb_cv_var_macho=no
+  gdb_cv_thread_db_h_has_td_notls=no
 
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext 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_var_macho" >&5
-$as_echo "$gdb_cv_var_macho" >&6; }
-  CC=$OLD_CC
-  CFLAGS=$OLD_CFLAGS
-  LDFLAGS=$OLD_LDFLAGS
-  LIBS=$OLD_LIBS
-if test "$gdb_cv_var_macho" = yes; then
-  CONFIG_OBS="$CONFIG_OBS machoread.o"
+{ $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
 
-# 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
+$as_echo "#define THREAD_DB_HAS_TD_NOTALLOC 1" >>confdefs.h
 
-# Check whether --with-lzma was given.
-if test "${with_lzma+set}" = set; then :
-  withval=$with_lzma;
-else
-  with_lzma=auto
 fi
+if test "x$gdb_cv_thread_db_h_has_td_version" = "xyes"; then
 
-  { $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
-
-
-
-
-
-
-
+$as_echo "#define THREAD_DB_HAS_TD_VERSION 1" >>confdefs.h
 
-    use_additional=yes
+fi
+if test "x$gdb_cv_thread_db_h_has_td_notls" = "xyes"; then
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
+$as_echo "#define THREAD_DB_HAS_TD_NOTLS 1" >>confdefs.h
 
-    eval additional_includedir=\"$includedir\"
-    eval additional_libdir=\"$libdir\"
+fi
 
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
+case $host_os in
+  go32* | *djgpp*)
+    gdbinit=gdb.ini
+    ;;
+  *)
+    gdbinit=.gdbinit
+    ;;
+esac
 
+cat >>confdefs.h <<_ACEOF
+#define GDBINIT "$gdbinit"
+_ACEOF
 
-# 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\"
+cat >>confdefs.h <<_ACEOF
+#define GDBEARLYINIT ".gdbearlyinit"
+_ACEOF
 
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
 
-      else
-        additional_includedir="$withval/include"
-        additional_libdir="$withval/lib"
-      fi
-    fi
 
+# 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-liblzma-type was given.
-if test "${with_liblzma_type+set}" = set; then :
-  withval=$with_liblzma_type;  with_liblzma_type=$withval
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+  withval=$with_sysroot; TARGET_SYSTEM_ROOT=$withval
 else
-   with_liblzma_type=auto
+  TARGET_SYSTEM_ROOT=
 fi
 
-  lib_type=`eval echo \$with_liblzma_type`
 
-      LIBLZMA=
-  LTLIBLZMA=
-  INCLZMA=
-  rpathdirs=
-  ltrpathdirs=
-  names_already_handled=
-  names_next_round='lzma '
-  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" || LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$value"
-            eval value=\"\$LTLIB$uppername\"
-            test -z "$value" || LTLIBLZMA="${LTLIBLZMA}${LTLIBLZMA:+ }$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" && test x$lib_type != xstatic; 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
-            elif test x$lib_type != xshared; then
-              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 $LTLIBLZMA; do
+  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`
 
-  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"
+cat >>confdefs.h <<_ACEOF
+#define TARGET_SYSTEM_ROOT "$ac_define_dir"
+_ACEOF
 
-              case "$x" in
-                -L*)
-                  dir=`echo "X$x" | sed -e 's/^X-L//'`
-                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext" && test x$lib_type != xstatic; 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
-                  elif test x$lib_type != xshared; then
-                    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
-                        LTLIBLZMA="${LTLIBLZMA}${LTLIBLZMA:+ }-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
-                                LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$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
-                                                      LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$found_so"
-                else
-                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
-                                                            LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$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 $LIBLZMA; 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
-                      LIBLZMA="${LIBLZMA}${LIBLZMA:+ }-L$found_dir"
-                    fi
-                    if test "$hardcode_minus_L" != no; then
-                                                                                        LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$found_so"
-                    else
-                                                                                                                                                                                LIBLZMA="${LIBLZMA}${LIBLZMA:+ }-l$name"
-                    fi
-                  fi
-                fi
-              fi
-            else
-              if test "X$found_a" != "X"; then
-                                LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$found_a"
-              else
-                                                LIBLZMA="${LIBLZMA}${LIBLZMA:+ }-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$additiona[...]

[diff truncated at 100000 bytes]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-05 19:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-05 19:40 [binutils-gdb] gdbsupport: move libxxhash configure check to gdbsupport Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).