[PATCH v2 0/6] Move gdbsupport to top level

classic Classic list List threaded Threaded
30 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[PATCH v2 0/6] Move gdbsupport to top level

Tom Tromey-2
Here is an update of the series to move gdbsupport to the top level.
This is one step in the bigger projecct to move gdbserver to top
level.

In this patch, gdbsupport is given its own configure script --
however, gdbserver still builds its own copy.  gdb and gdbserver won't
share a gdbsupport library until the final series.

This version of the patch fixes up the problems that Pedro pointed out
in the shared nat/ and target/ code.  In particular, now they can
simply rely on the shared config.h.  This is enforced by ensuring that
the necessary defines are all available; the checker script I used to
find the issues is provided in patch #5.

I wasn't able to send this through the buildbot.  I did test it on
x86-64 Fedora 29.  I also build it using a mingw cross.

If you want to try it, it is on the branch
submit/move-gdbsupport-to-top in my github.

Let me know what you think.

Tom


Reply | Threaded
Open this post in threaded view
|

[PATCH v2 1/6] Consolidate definition of USE_WIN32API

Tom Tromey-2
I noticed that USE_WIN32API is defined separately by gdbserver and
gdb.  However, because it is used by code in gdbsupport, it should be
defined by common.m4.  This approach ensures that the code will
continue to work when it is moved to the top level.

gdb/ChangeLog
2020-01-08  Tom Tromey  <[hidden email]>

        * gdbsupport/common.m4 (GDB_AC_COMMON): Define WIN32APILIBS and
        USE_WIN32API when needed.
        * configure.ac (USE_WIN32API): Don't define.
        (WIN32LIBS): Use WIN32APILIBS.
        * configure: Rebuild.

gdb/gdbserver/ChangeLog
2020-01-08  Tom Tromey  <[hidden email]>

        * configure.ac (LIBS): Use WIN32APILIBS.
        (USE_WIN32API): Don't define.
        * configure: Rebuild.

Change-Id: I40d524d5445ebfb452b36f4d0e102f0b1e1089df
---
 gdb/ChangeLog              |  8 ++++++++
 gdb/configure              | 23 +++++++++++++----------
 gdb/configure.ac           | 13 ++-----------
 gdb/gdbserver/ChangeLog    |  6 ++++++
 gdb/gdbserver/configure    | 19 ++++++++++++-------
 gdb/gdbserver/configure.ac | 11 ++---------
 gdb/gdbsupport/common.m4   | 12 ++++++++++++
 7 files changed, 55 insertions(+), 37 deletions(-)

diff --git a/gdb/configure b/gdb/configure
index b572d414ca5..2c4766028a0 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -688,12 +688,12 @@ TCL_BIN_DIR
 TCL_PATCH_LEVEL
 TCL_VERSION
 WIN32LDAPP
+WIN32LIBS
 GUI_CFLAGS_X
 LIBGUI
 LTLIBLZMA
 LIBLZMA
 HAVE_LIBLZMA
-WIN32LIBS
 SER_HARDWIRE
 WERROR_CFLAGS
 WARN_CFLAGS
@@ -13567,6 +13567,16 @@ _ACEOF
 fi
 
 
+  WIN32APILIBS=
+  case ${host} in
+    *mingw32*)
+
+$as_echo "#define USE_WIN32API 1" >>confdefs.h
+
+      WIN32APILIBS="-lws2_32"
+      ;;
+  esac
+
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
 $as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
@@ -16355,15 +16365,8 @@ if test x"$gdb_cv_os_cygwin" = xyes; then
 fi
 
 # The ser-tcp.c module requires sockets.
-case ${host} in
-  *mingw32*)
-
-$as_echo "#define USE_WIN32API 1" >>confdefs.h
-
-    WIN32LIBS="$WIN32LIBS -lws2_32"
-    ;;
-esac
-
+# Note that WIN32APILIBS is set by GDB_AC_COMMON.
+WIN32LIBS="$WIN32LIBS $WIN32APILIBS"
 
 # Add ELF support to GDB, but only if BFD includes ELF support.
 
diff --git a/gdb/configure.ac b/gdb/configure.ac
index ca0da7980cc..a7b744bf241 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1827,17 +1827,8 @@ if test x"$gdb_cv_os_cygwin" = xyes; then
 fi
 
 # The ser-tcp.c module requires sockets.
-case ${host} in
-  *mingw32*)
-    AC_DEFINE(USE_WIN32API, 1,
-              [Define if we should use the Windows API, instead of the
-       POSIX API.  On Windows, we use the Windows API when
-       building for MinGW, but the POSIX API when building
-       for Cygwin.])
-    WIN32LIBS="$WIN32LIBS -lws2_32"
-    ;;
-esac
-AC_SUBST(WIN32LIBS)
+# Note that WIN32APILIBS is set by GDB_AC_COMMON.
+WIN32LIBS="$WIN32LIBS $WIN32APILIBS"
 
 # Add ELF support to GDB, but only if BFD includes ELF support.
 GDB_AC_CHECK_BFD([for ELF support in BFD], gdb_cv_var_elf,
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 4de751b4491..361c1c4cd94 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -6959,6 +6959,16 @@ _ACEOF
 fi
 
 
+  WIN32APILIBS=
+  case ${host} in
+    *mingw32*)
+
+$as_echo "#define USE_WIN32API 1" >>confdefs.h
+
+      WIN32APILIBS="-lws2_32"
+      ;;
+  esac
+
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
 $as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
@@ -8704,19 +8714,14 @@ esac
 if test "${srv_mingwce}" = "yes"; then
   LIBS="$LIBS -lws2"
 elif test "${srv_mingw}" = "yes"; then
-  LIBS="$LIBS -lws2_32"
+  # WIN32APILIBS is set by GDB_AC_COMMON.
+  LIBS="$LIBS $WIN32APILIBS"
 elif test "${srv_qnx}" = "yes"; then
   LIBS="$LIBS -lsocket"
 elif test "${srv_lynxos}" = "yes"; then
   LIBS="$LIBS -lnetinet"
 fi
 
-if test "${srv_mingw}" = "yes"; then
-
-$as_echo "#define USE_WIN32API 1" >>confdefs.h
-
-fi
-
 if test "${srv_linux_usrregs}" = "yes"; then
 
 $as_echo "#define HAVE_LINUX_USRREGS 1" >>confdefs.h
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 817a861a32b..fab765ea38d 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -248,21 +248,14 @@ esac
 if test "${srv_mingwce}" = "yes"; then
   LIBS="$LIBS -lws2"
 elif test "${srv_mingw}" = "yes"; then
-  LIBS="$LIBS -lws2_32"
+  # WIN32APILIBS is set by GDB_AC_COMMON.
+  LIBS="$LIBS $WIN32APILIBS"
 elif test "${srv_qnx}" = "yes"; then
   LIBS="$LIBS -lsocket"
 elif test "${srv_lynxos}" = "yes"; then
   LIBS="$LIBS -lnetinet"
 fi
 
-if test "${srv_mingw}" = "yes"; then
-  AC_DEFINE(USE_WIN32API, 1,
-    [Define if we should use the Windows API, instead of the
-     POSIX API.  On Windows, we use the Windows API when
-     building for MinGW, but the POSIX API when building
-     for Cygwin.])
-fi
-
 if test "${srv_linux_usrregs}" = "yes"; then
   AC_DEFINE(HAVE_LINUX_USRREGS, 1,
     [Define if the target supports PTRACE_PEEKUSR for register ]
diff --git a/gdb/gdbsupport/common.m4 b/gdb/gdbsupport/common.m4
index c36d84a42be..e49af7c750d 100644
--- a/gdb/gdbsupport/common.m4
+++ b/gdb/gdbsupport/common.m4
@@ -21,6 +21,18 @@ AC_DEFUN([GDB_AC_COMMON], [
   AC_HEADER_STDC
   AC_FUNC_ALLOCA
 
+  WIN32APILIBS=
+  case ${host} in
+    *mingw32*)
+      AC_DEFINE(USE_WIN32API, 1,
+ [Define if we should use the Windows API, instead of the
+ POSIX API.  On Windows, we use the Windows API when
+ building for MinGW, but the POSIX API when building
+ for Cygwin.])
+      WIN32APILIBS="-lws2_32"
+      ;;
+  esac
+
   dnl Note that this requires codeset.m4, which is included
   dnl by the users of common.m4.
   AM_LANGINFO_CODESET
--
2.17.2

Reply | Threaded
Open this post in threaded view
|

[PATCH v2 4/6] Remove use of <config.h> from gdb/nat/

Tom Tromey-2
In reply to this post by Tom Tromey-2
This removes the use of <config.h> from the files in gdb/nat/.

2020-01-08  Tom Tromey  <[hidden email]>

        * nat/linux-btrace.c: Don't include <config.h>.
        * nat/linux-ptrace.c: Don't include <config.h>.
        * nat/x86-linux-dregs.c: Don't include <config.h>.

Change-Id: Ie8c734c54ada848aa020c77ec727704d367eff81
---
 gdb/ChangeLog             | 6 ++++++
 gdb/nat/linux-btrace.c    | 8 --------
 gdb/nat/linux-ptrace.c    | 8 --------
 gdb/nat/x86-linux-dregs.c | 8 --------
 4 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c
index 3a3cd8d235d..03fc85e2ece 100644
--- a/gdb/nat/linux-btrace.c
+++ b/gdb/nat/linux-btrace.c
@@ -20,14 +20,6 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "gdbsupport/common-defs.h"
-
-#undef PACKAGE
-#undef PACKAGE_NAME
-#undef PACKAGE_VERSION
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-
-#include <config.h>
 #include "linux-btrace.h"
 #include "gdbsupport/common-regcache.h"
 #include "gdbsupport/gdb_wait.h"
diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
index 859feb7ca87..5335d690922 100644
--- a/gdb/nat/linux-ptrace.c
+++ b/gdb/nat/linux-ptrace.c
@@ -17,14 +17,6 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "gdbsupport/common-defs.h"
-
-#undef PACKAGE
-#undef PACKAGE_NAME
-#undef PACKAGE_VERSION
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-
-#include <config.h>
 #include "linux-ptrace.h"
 #include "linux-procfs.h"
 #include "linux-waitpid.h"
diff --git a/gdb/nat/x86-linux-dregs.c b/gdb/nat/x86-linux-dregs.c
index 31683aab17c..b5dd71e3c7c 100644
--- a/gdb/nat/x86-linux-dregs.c
+++ b/gdb/nat/x86-linux-dregs.c
@@ -18,14 +18,6 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "gdbsupport/common-defs.h"
-
-#undef PACKAGE
-#undef PACKAGE_NAME
-#undef PACKAGE_VERSION
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-
-#include <config.h>
 #include "nat/gdb_ptrace.h"
 #include <sys/user.h>
 #include "target/waitstatus.h"
--
2.17.2

Reply | Threaded
Open this post in threaded view
|

[PATCH v2 5/6] Add gdbsupport check-defines script

Tom Tromey-2
In reply to this post by Tom Tromey-2
This adds a new script that tries to check that none of the support
code uses defines that are not defined by common.m4.  This check is
necessarily inexact, but this script caught all the issues fixed in
the previous patches.

2020-01-08  Tom Tromey  <[hidden email]>

        * Makefile.in: Rebuild.
        * Makefile.am (check-defines): New target.
        * check-defines.el: New file.

Change-Id: I59450e91394d5e6a7fa59e9ab53c95843c4bacd9
---
 gdbsupport/ChangeLog        |  6 +++
 gdbsupport/Makefile.am      |  4 ++
 gdbsupport/Makefile.in      |  4 ++
 gdbsupport/check-defines.el | 77 +++++++++++++++++++++++++++++++++++++
 4 files changed, 91 insertions(+)
 create mode 100644 gdbsupport/check-defines.el

diff --git a/gdbsupport/Makefile.am b/gdbsupport/Makefile.am
index 48e6079fb9f..1a001a00817 100644
--- a/gdbsupport/Makefile.am
+++ b/gdbsupport/Makefile.am
@@ -68,3 +68,7 @@ libgdbsupport_a_SOURCES = \
     thread-pool.c \
     xml-utils.c \
     $(selftest)
+
+# Double-check that no defines are missing from our configury.
+check-defines:
+ cd $(srcdir) && emacs --script check-defines.el
diff --git a/gdbsupport/Makefile.in b/gdbsupport/Makefile.in
index a2e174d8fc4..5723ae5e97e 100644
--- a/gdbsupport/Makefile.in
+++ b/gdbsupport/Makefile.in
@@ -691,6 +691,10 @@ uninstall-am:
 override CC := $(CXX)
 override CFLAGS := $(CXXFLAGS)
 
+# Double-check that no defines are missing from our configury.
+check-defines:
+ cd $(srcdir) && emacs --script check-defines.el
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/gdbsupport/check-defines.el b/gdbsupport/check-defines.el
new file mode 100644
index 00000000000..b59748f0054
--- /dev/null
+++ b/gdbsupport/check-defines.el
@@ -0,0 +1,77 @@
+;; Verify that preprocessor symbols are defined in config.in.
+
+;; Copyright (C) 2020 Free Software Foundation, Inc.
+;;
+;; This file is part of GDB.
+;;
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;; To use:
+;;   cd gdbsupport
+;;   emacs --script check-defines.el
+
+(require 'cl-lib)
+
+(setq-default case-fold-search nil)
+
+;; The currently recognized macros.
+(defconst check-regexp "\\_<\\(\\(HAVE\\|PTRACE_TYPE\\|SIZEOF\\)_[a-zA-Z0-9_]+\\)\\_>")
+
+(defvar check-seen 0)
+
+;; Whitelist.  These are things that have names like autoconf-created
+;; macros, but that are managed directly in the code.
+(put (intern "HAVE_USEFUL_SBRK") :check-ok t)
+(put (intern "HAVE_SOCKETS") :check-ok t)
+(put (intern "HAVE_F_GETFD") :check-ok t)
+(put (intern "HAVE_IS_TRIVIALLY_COPYABLE") :check-ok t)
+(put (intern "HAVE_IS_TRIVIALLY_CONSTRUCTIBLE") :check-ok t)
+(put (intern "HAVE_DOS_BASED_FILE_SYSTEM") :check-ok t)
+
+(defun check-read-config.in (file)
+  (save-excursion
+    (find-file-read-only file)
+    (goto-char (point-min))
+    (while (re-search-forward "^#undef \\(.+\\)$" nil t)
+      (let ((name (match-string 1)))
+ (put (intern name) :check-ok t)))))
+
+(defun check-one-file (file)
+  (save-excursion
+    (find-file-read-only file)
+    (goto-char (point-min))
+    (while (re-search-forward check-regexp nil t)
+      (let ((name (match-string 1)))
+ (unless (get (intern name) :check-ok)
+  (save-excursion
+    (goto-char (match-beginning 0))
+    (cl-incf check-seen)
+    (message "%s:%d:%d: error: name %s not defined"
+     file
+     (line-number-at-pos)
+     (current-column)
+     name)))))))
+
+(defun check-directory (dir)
+  (dolist (file (directory-files dir t "\\.[ch]$"))
+    (check-one-file file)))
+
+(check-read-config.in "config.in")
+(check-read-config.in "../gnulib/config.in")
+(check-directory ".")
+(check-directory "../gdb/nat")
+(check-directory "../gdb/target")
+
+(when (> check-seen 0)
+  (message "%d errors seen" check-seen))
--
2.17.2

Reply | Threaded
Open this post in threaded view
|

[PATCH v2 6/6] Don't link gdb twice against libiberty

Tom Tromey-2
In reply to this post by Tom Tromey-2
I noticed that gdb includes libiberty twice in its link line.  I don't
think there's a need for this, so this patch removes one of the
references.

2020-01-08  Tom Tromey  <[hidden email]>

        * Makefile.in (CLIBS): Remove second use of $(LIBIBERTY).

Change-Id: I43bb7100660867081f937c67ea70ff751c62bbfb
---
 gdb/ChangeLog   | 4 ++++
 gdb/Makefile.in | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index d0a3fd5ea06..da338dc8a46 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -615,7 +615,7 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(LIBCTF) $(ZLIB) \
  $(XM_CLIBS) $(GDBTKLIBS) \
  @LIBS@ @GUILE_LIBS@ @PYTHON_LIBS@ \
  $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \
- $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) \
+ $(WIN32LIBS) $(LIBGNU) $(LIBICONV) \
  $(LIBMPFR) $(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS)
 CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) $(LIBCTF) \
  $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU) \
--
2.17.2

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Tom Tromey-2
In reply to this post by Tom Tromey-2
>>>>> "Tom" == Tom Tromey <[hidden email]> writes:

Tom> Here is an update of the series to move gdbsupport to the top level.
Tom> This is one step in the bigger projecct to move gdbserver to top
Tom> level.

I see that patches #2 and #3 did not come through.
I think they ran into the size limit.

Here is patch 2.  I'll send patch 3 separately.
Using "git show" makes patch 2 smaller, but I'm also going to edit out
the generated files from both patches.

Tom

commit f68357acdbb40bdd712dc09c3d87b2de2e18aedf
Author: Tom Tromey <[hidden email]>
Date:   Tue Jul 9 08:06:39 2019 -0600

    Move gdbsupport to the top level
   
    This patch moves the gdbsupport directory to the top level.  This is
    the next step in the ongoing project to move gdbserver to the top
    level.
   
    The bulk of this patch was created by "git mv gdb/gdbsupport gdbsupport".
   
    This patch then adds a build system to gdbsupport and wires it into
    the top level.  Then it changes gdb to use the top-level build.
   
    gdbserver, on the other hand, is not yet changed.  It still does its
    own build of gdbsupport.
   
    ChangeLog
    2020-01-08  Tom Tromey  <[hidden email]>
   
            * src-release.sh (GDB_SUPPORT_DIRS): Add gdbsupport.
            * MAINTAINERS: Add gdbsupport.
            * configure: Rebuild.
            * configure.ac (configdirs): Add gdbsupport.
            * gdbsupport: New directory, move from gdb/gdbsupport.
            * Makefile.def (host_modules, dependencies): Add gnulib.
            * Makefile.in: Rebuild.
   
    gdb/ChangeLog
    2020-01-08  Tom Tromey  <[hidden email]>
   
            * nat/x86-linux-dregs.c: Include configh.h.
            * nat/linux-ptrace.c: Include configh.h.
            * nat/linux-btrace.c: Include configh.h.
            * defs.h: Include config.h, bfd.h.
            * configure.ac: Don't source common.host.
            (CONFIG_OBS, CONFIG_SRCS): Remove gdbsupport files.
            * configure: Rebuild.
            * acinclude.m4: Update path.
            * Makefile.in (SUPPORT, LIBSUPPORT, INCSUPPORT): New variables.
            (CONFIG_SRC_SUBDIR): Remove gdbsupport.
            (INTERNAL_CFLAGS_BASE): Add INCSUPPORT.
            (CLIBS): Add LIBSUPPORT.
            (CDEPS): Likewise.
            (COMMON_SFILES): Remove gdbsupport files.
            (HFILES_NO_SRCDIR): Likewise.
            (stamp-version): Update path to create-version.sh.
            (ALLDEPFILES): Remove gdbsupport files.
   
    gdb/gdbserver/ChangeLog
    2020-01-08  Tom Tromey  <[hidden email]>
   
            * server.h: Include config.h.
            * gdbreplay.c: Include config.h.
            * configure: Rebuild.
            * configure.ac: Don't source common.host.
            * acinclude.m4: Update path.
            * Makefile.in (INCSUPPORT): New variable.
            (INCLUDE_CFLAGS): Add INCSUPPORT.
            (SFILES): Update paths.
            (version-generated.c): Update path to create-version.sh.
            (gdbsupport/%-ipa.o, gdbsupport/%.o): Update paths.
   
    gdbsupport/ChangeLog
    2020-01-08  Tom Tromey  <[hidden email]>
   
            * common-defs.h: Add GDBSERVER case.  Update includes.
            * acinclude.m4, aclocal.m4, config.in, configure, configure.ac,
            Makefile.am, Makefile.in, README: New files.
            * Moved from ../gdb/gdbsupport/
   
    Change-Id: I07632e7798635c1bab389bf885971e584fb4bb78

diff --git a/ChangeLog b/ChangeLog
index 00a224473b5..9e3006cf5bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2020-01-08  Tom Tromey  <[hidden email]>
+
+ * src-release.sh (GDB_SUPPORT_DIRS): Add gdbsupport.
+ * MAINTAINERS: Add gdbsupport.
+ * configure: Rebuild.
+ * configure.ac (configdirs): Add gdbsupport.
+ * gdbsupport: New directory, move from gdb/gdbsupport.
+ * Makefile.def (host_modules, dependencies): Add gnulib.
+ * Makefile.in: Rebuild.
+
 2020-01-09  Aaron Merey  <[hidden email]>
 
         * config/debuginfod.m4: New file. Add macro AC_DEBUGINFOD. Adds
diff --git a/MAINTAINERS b/MAINTAINERS
index 4e04918dad8..805f2e3ac43 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -41,7 +41,7 @@ config.guess; config.sub; readline/support/config.{sub,guess}
 depcomp; mkinstalldirs
         Send bug reports and patches to [hidden email].
 
-gdb/; gnulib/; readline/; sim/; GDB's part of include/
+gdb/; gdbsupport/; gnulib/; readline/; sim/; GDB's part of include/
  GDB: http://www.gnu.org/software/gdb/
  Patches to [hidden email].
  See also gdb/MAINTAINERS and sim/MAINTAINERS.
diff --git a/Makefile.def b/Makefile.def
index 311feb9de3b..079fd3e4f16 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -113,6 +113,7 @@ host_modules= { module= zlib; no_install=true; no_check=true;
  bootstrap=true;
         extra_configure_flags='@extra_host_zlib_configure_flags@';};
 host_modules= { module= gnulib; };
+host_modules= { module= gdbsupport; };
 host_modules= { module= gdb; };
 host_modules= { module= expect; };
 host_modules= { module= guile; };
@@ -392,12 +393,14 @@ dependencies = { module=configure-gdb; on=all-intl; };
 dependencies = { module=configure-gdb; on=configure-sim; };
 dependencies = { module=configure-gdb; on=all-bfd; };
 dependencies = { module=configure-gdb; on=all-gnulib; };
+dependencies = { module=configure-gdb; on=all-gdbsupport; };
 // Depend on all-libiconv so that configure checks for iconv
 // functions will work.
 dependencies = { module=configure-gdb; on=all-libiconv; };
 dependencies = { module=all-gdb; on=all-libiberty; };
 dependencies = { module=all-gdb; on=all-libiconv; };
 dependencies = { module=all-gdb; on=all-gnulib; };
+dependencies = { module=all-gdb; on=all-gdbsupport; };
 dependencies = { module=all-gdb; on=all-opcodes; };
 dependencies = { module=all-gdb; on=all-readline; };
 dependencies = { module=all-gdb; on=all-build-bison; };
@@ -412,6 +415,10 @@ dependencies = { module=all-libgui; on=all-tcl; };
 dependencies = { module=all-libgui; on=all-tk; };
 dependencies = { module=all-libgui; on=all-itcl; };
 
+dependencies = { module=configure-gdbsupport; on=configure-bfd; };
+dependencies = { module=configure-gdbsupport; on=configure-gnulib; };
+dependencies = { module=all-gdbsupport; on=all-gnulib; };
+
 // Host modules specific to binutils.
 dependencies = { module=configure-bfd; on=configure-libiberty; hard=true; };
 dependencies = { module=configure-bfd; on=configure-intl; };
diff --git a/configure.ac b/configure.ac
index 544fab3d209..4bd869a63a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2730,12 +2730,12 @@ esac
 CONFIGURE_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-configure-/g`
 INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`
 
-# gdb depends on gnulib, but as nothing else does, only include it if
-# gdb is built.
+# gdb depends on gnulib and gdbsupport, but as nothing else does, only
+# include them if gdb is built.
 if echo " ${configdirs} " | grep " gdb " > /dev/null 2>&1 ; then
-  # The Makefile provides the ordering, so it's enough here to add
-  # gnulib to the list.
-  configdirs="${configdirs} gnulib"
+  # The Makefile provides the ordering, so it's enough here to add to
+  # the list.
+  configdirs="${configdirs} gnulib gdbsupport"
 fi
 
 # Strip out unwanted targets.
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 28f5c21242b..71d41d9f67f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,23 @@
+2020-01-08  Tom Tromey  <[hidden email]>
+
+ * nat/x86-linux-dregs.c: Include configh.h.
+ * nat/linux-ptrace.c: Include configh.h.
+ * nat/linux-btrace.c: Include configh.h.
+ * defs.h: Include config.h, bfd.h.
+ * configure.ac: Don't source common.host.
+ (CONFIG_OBS, CONFIG_SRCS): Remove gdbsupport files.
+ * configure: Rebuild.
+ * acinclude.m4: Update path.
+ * Makefile.in (SUPPORT, LIBSUPPORT, INCSUPPORT): New variables.
+ (CONFIG_SRC_SUBDIR): Remove gdbsupport.
+ (INTERNAL_CFLAGS_BASE): Add INCSUPPORT.
+ (CLIBS): Add LIBSUPPORT.
+ (CDEPS): Likewise.
+ (COMMON_SFILES): Remove gdbsupport files.
+ (HFILES_NO_SRCDIR): Likewise.
+ (stamp-version): Update path to create-version.sh.
+ (ALLDEPFILES): Remove gdbsupport files.
+
 2020-01-08  Tom Tromey  <[hidden email]>
 
  * gdbsupport/common.m4 (GDB_AC_COMMON): Define WIN32APILIBS and
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 6df0f46b5ed..5f63c617d4f 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -238,6 +238,10 @@ GNULIB_BUILDDIR = ../gnulib
 LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a
 INCGNU = -I$(srcdir)/../gnulib/import -I$(GNULIB_BUILDDIR)/import
 
+SUPPORT = ../gdbsupport
+LIBSUPPORT = $(SUPPORT)/libgdbsupport.a
+INCSUPPORT = -I$(srcdir)/.. -I..
+
 #
 # CLI sub directory definitons
 #
@@ -547,7 +551,7 @@ CONFIG_INSTALL = @CONFIG_INSTALL@
 CONFIG_UNINSTALL = @CONFIG_UNINSTALL@
 HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
 
-CONFIG_SRC_SUBDIR = arch cli mi gdbsupport compile tui unittests guile python \
+CONFIG_SRC_SUBDIR = arch cli mi compile tui unittests guile python \
  target nat
 CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
 
@@ -586,8 +590,8 @@ INTERNAL_CFLAGS_BASE = \
  $(CXXFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
  $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) $(ZLIBINC) \
  $(BFD_CFLAGS) $(INCLUDE_CFLAGS) $(LIBDECNUMBER_CFLAGS) \
- $(INTL_CFLAGS) $(INCGNU) $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS) \
- $(SRCHIGH_CFLAGS) $(TOP_CFLAGS) $(PTHREAD_CFLAGS)
+ $(INTL_CFLAGS) $(INCGNU) $(INCSUPPORT) $(ENABLE_CFLAGS) \
+ $(INTERNAL_CPPFLAGS) $(SRCHIGH_CFLAGS) $(TOP_CFLAGS) $(PTHREAD_CFLAGS)
 INTERNAL_WARN_CFLAGS = $(INTERNAL_CFLAGS_BASE) $(GDB_WARN_CFLAGS)
 INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS)
 
@@ -607,14 +611,15 @@ INTERNAL_LDFLAGS = \
 # XM_CLIBS, defined in *config files, have host-dependent libs.
 # LIBIBERTY appears twice on purpose.
 CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(LIBCTF) $(ZLIB) \
-        $(INTL) $(LIBIBERTY) $(LIBDECNUMBER) \
+        $(LIBSUPPORT) $(INTL) $(LIBIBERTY) $(LIBDECNUMBER) \
  $(XM_CLIBS) $(GDBTKLIBS) \
  @LIBS@ @GUILE_LIBS@ @PYTHON_LIBS@ \
  $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \
- $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR) \
- $(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS)
+ $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) \
+ $(LIBMPFR) $(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS)
 CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) $(LIBCTF) \
- $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)
+ $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU) \
+ $(LIBSUPPORT)
 
 DIST = gdb
 
@@ -968,39 +973,6 @@ COMMON_SFILES = \
  cli-out.c \
  coff-pe-read.c \
  coffread.c \
- gdbsupport/agent.c \
- gdbsupport/btrace-common.c \
- gdbsupport/buffer.c \
- gdbsupport/cleanups.c \
- gdbsupport/common-debug.c \
- gdbsupport/common-exceptions.c \
- gdbsupport/common-inferior.c \
- gdbsupport/common-regcache.c \
- gdbsupport/common-utils.c \
- gdbsupport/errors.c \
- gdbsupport/environ.c \
- gdbsupport/fileio.c \
- gdbsupport/filestuff.c \
- gdbsupport/format.c \
- gdbsupport/job-control.c \
- gdbsupport/gdb-dlfcn.c \
- gdbsupport/gdb_tilde_expand.c \
- gdbsupport/gdb_vecs.c \
- gdbsupport/gdb_wait.c \
- gdbsupport/netstuff.c \
- gdbsupport/new-op.c \
- gdbsupport/pathstuff.c \
- gdbsupport/print-utils.c \
- gdbsupport/ptid.c \
- gdbsupport/rsp-low.c \
- gdbsupport/run-time-clock.c \
- gdbsupport/safe-strerror.c \
- gdbsupport/scoped_mmap.c \
- gdbsupport/signals.c \
- gdbsupport/signals-state-save-restore.c \
- gdbsupport/tdesc.c \
- gdbsupport/thread-pool.c \
- gdbsupport/xml-utils.c \
  complaints.c \
  completer.c \
  continuations.c \
@@ -1468,49 +1440,6 @@ HFILES_NO_SRCDIR = \
  cli/cli-setshow.h \
  cli/cli-style.h \
  cli/cli-utils.h \
- gdbsupport/buffer.h \
- gdbsupport/cleanups.h \
- gdbsupport/common-debug.h \
- gdbsupport/common-defs.h \
- gdbsupport/common-exceptions.h \
- gdbsupport/common-gdbthread.h \
- gdbsupport/common-regcache.h \
- gdbsupport/common-types.h \
- gdbsupport/common-utils.h \
- gdbsupport/job-control.h \
- gdbsupport/errors.h \
- gdbsupport/environ.h \
- gdbsupport/fileio.h \
- gdbsupport/format.h \
- gdbsupport/gdb-dlfcn.h \
- gdbsupport/gdb-sigmask.h \
- gdbsupport/gdb_assert.h \
- gdbsupport/gdb_binary_search.h \
- gdbsupport/gdb_tilde_expand.h \
- gdbsupport/gdb_locale.h \
- gdbsupport/gdb_proc_service.h \
- gdbsupport/gdb_setjmp.h \
- gdbsupport/gdb_signals.h \
- gdbsupport/gdb_sys_time.h \
- gdbsupport/gdb_vecs.h \
- gdbsupport/gdb_wait.h \
- gdbsupport/common-inferior.h \
- gdbsupport/netstuff.h \
- gdbsupport/host-defs.h \
- gdbsupport/parallel-for.h \
- gdbsupport/pathstuff.h \
- gdbsupport/print-utils.h \
- gdbsupport/ptid.h \
- gdbsupport/queue.h \
- gdbsupport/rsp-low.h \
- gdbsupport/run-time-clock.h \
- gdbsupport/signals-state-save-restore.h \
- gdbsupport/symbol.h \
- gdbsupport/tdesc.h \
- gdbsupport/thread-pool.h \
- gdbsupport/version.h \
- gdbsupport/x86-xstate.h \
- gdbsupport/xml-utils.h \
  compile/compile.h \
  compile/compile-c.h \
  compile/compile-cplus.h \
@@ -2131,8 +2060,8 @@ $(srcdir)/copying.c: @MAINTAINER_MODE_TRUE@ $(srcdir)/../COPYING3 $(srcdir)/copy
 version.c: stamp-version; @true
 # Note that the obvious names for the temp file are taken by
 # create-version.sh.
-stamp-version: Makefile version.in $(srcdir)/../bfd/version.h $(srcdir)/gdbsupport/create-version.sh
- $(ECHO_GEN) $(SHELL) $(srcdir)/gdbsupport/create-version.sh $(srcdir) \
+stamp-version: Makefile version.in $(srcdir)/../bfd/version.h $(srcdir)/../gdbsupport/create-version.sh
+ $(ECHO_GEN) $(SHELL) $(srcdir)/../gdbsupport/create-version.sh $(srcdir) \
     $(host_alias) $(target_alias) version-t.t
  @$(SHELL) $(srcdir)/../move-if-change version-t.t version.c
  @echo stamp > stamp-version
diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index 11cc0bc2417..d60b2fe19c1 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -63,7 +63,7 @@ m4_include([../config/iconv.m4])
 
 m4_include([../config/zlib.m4])
 
-m4_include([gdbsupport/common.m4])
+m4_include([../gdbsupport/common.m4])
 
 dnl For libiberty_INIT.
 m4_include(libiberty.m4)
diff --git a/gdb/configure.ac b/gdb/configure.ac
index a7b744bf241..ddb9530afd0 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -2215,8 +2215,8 @@ AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "UTF-8",
           [Define to be a string naming the default host character set.])
 
 GDB_AC_SELFTEST([
-  CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_UNITTESTS_OBS) gdbsupport/selftest.o selftest-arch.o"
-  CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_UNITTESTS_SRCS) gdbsupport/selftest.c selftest-arch.c"
+  CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_UNITTESTS_OBS) selftest-arch.o"
+  CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_UNITTESTS_SRCS) selftest-arch.c"
 ])
 
 GDB_AC_TRANSFORM([gdb], [GDB_TRANSFORM_NAME])
diff --git a/gdb/defs.h b/gdb/defs.h
index 567f214b81d..1ad52feb1f8 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -27,6 +27,15 @@
 
 #include "gdbsupport/common-defs.h"
 
+#undef PACKAGE
+#undef PACKAGE_NAME
+#undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+
+#include <config.h>
+#include "bfd.h"
+
 #include <sys/types.h>
 #include <limits.h>
 
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index c3b547528d0..22d10bec484 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,16 @@
+2020-01-08  Tom Tromey  <[hidden email]>
+
+ * server.h: Include config.h.
+ * gdbreplay.c: Include config.h.
+ * configure: Rebuild.
+ * configure.ac: Don't source common.host.
+ * acinclude.m4: Update path.
+ * Makefile.in (INCSUPPORT): New variable.
+ (INCLUDE_CFLAGS): Add INCSUPPORT.
+ (SFILES): Update paths.
+ (version-generated.c): Update path to create-version.sh.
+ (gdbsupport/%-ipa.o, gdbsupport/%.o): Update paths.
+
 2020-01-08  Tom Tromey  <[hidden email]>
 
  * configure.ac (LIBS): Use WIN32APILIBS.
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 1125426778b..9640a2a4447 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -109,6 +109,8 @@ INCGNU = -I$(srcdir)/../../gnulib/import -I$(GNULIB_BUILDDIR)/import
 # so that they are generated before other files are compiled.
 GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@
 
+INCSUPPORT = -I$(srcdir)/../.. -I../..
+
 # All the includes used for CFLAGS and for lint.
 # -I. for config files.
 # -I${srcdir} for our headers.
@@ -120,7 +122,7 @@ GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@
 #
 INCLUDE_CFLAGS = -I. -I${srcdir} \
  -I$(srcdir)/../regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \
- $(INCGNU)
+ $(INCGNU) $(INCSUPPORT)
 
 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
 # from the config/ directory.
@@ -201,32 +203,32 @@ SFILES = \
  $(srcdir)/arch/arm-linux.c \
  $(srcdir)/arch/ppc-linux-common.c \
  $(srcdir)/../alloc.c \
- $(srcdir)/gdbsupport/btrace-common.c \
- $(srcdir)/gdbsupport/buffer.c \
- $(srcdir)/gdbsupport/cleanups.c \
- $(srcdir)/gdbsupport/common-debug.c \
- $(srcdir)/gdbsupport/common-exceptions.c \
- $(srcdir)/gdbsupport/common-inferior.c \
- $(srcdir)/gdbsupport/common-regcache.c \
- $(srcdir)/gdbsupport/common-utils.c \
- $(srcdir)/gdbsupport/errors.c \
- $(srcdir)/gdbsupport/environ.c \
- $(srcdir)/gdbsupport/fileio.c \
- $(srcdir)/gdbsupport/filestuff.c \
- $(srcdir)/gdbsupport/job-control.c \
- $(srcdir)/gdbsupport/gdb-dlfcn.c \
- $(srcdir)/gdbsupport/gdb_tilde_expand.c \
- $(srcdir)/gdbsupport/gdb_vecs.c \
- $(srcdir)/gdbsupport/gdb_wait.c \
- $(srcdir)/gdbsupport/netstuff.c \
- $(srcdir)/gdbsupport/new-op.c \
- $(srcdir)/gdbsupport/pathstuff.c \
- $(srcdir)/gdbsupport/print-utils.c \
- $(srcdir)/gdbsupport/ptid.c \
- $(srcdir)/gdbsupport/rsp-low.c \
- $(srcdir)/gdbsupport/safe-strerror.c \
- $(srcdir)/gdbsupport/tdesc.c \
- $(srcdir)/gdbsupport/xml-utils.c \
+ $(srcdir)/../../gdbsupport/btrace-common.c \
+ $(srcdir)/../../gdbsupport/buffer.c \
+ $(srcdir)/../../gdbsupport/cleanups.c \
+ $(srcdir)/../../gdbsupport/common-debug.c \
+ $(srcdir)/../../gdbsupport/common-exceptions.c \
+ $(srcdir)/../../gdbsupport/common-inferior.c \
+ $(srcdir)/../../gdbsupport/common-regcache.c \
+ $(srcdir)/../../gdbsupport/common-utils.c \
+ $(srcdir)/../../gdbsupport/errors.c \
+ $(srcdir)/../../gdbsupport/environ.c \
+ $(srcdir)/../../gdbsupport/fileio.c \
+ $(srcdir)/../../gdbsupport/filestuff.c \
+ $(srcdir)/../../gdbsupport/job-control.c \
+ $(srcdir)/../../gdbsupport/gdb-dlfcn.c \
+ $(srcdir)/../../gdbsupport/gdb_tilde_expand.c \
+ $(srcdir)/../../gdbsupport/gdb_vecs.c \
+ $(srcdir)/../../gdbsupport/gdb_wait.c \
+ $(srcdir)/../../gdbsupport/netstuff.c \
+ $(srcdir)/../../gdbsupport/new-op.c \
+ $(srcdir)/../../gdbsupport/pathstuff.c \
+ $(srcdir)/../../gdbsupport/print-utils.c \
+ $(srcdir)/../../gdbsupport/ptid.c \
+ $(srcdir)/../../gdbsupport/rsp-low.c \
+ $(srcdir)/../../gdbsupport/safe-strerror.c \
+ $(srcdir)/../../gdbsupport/tdesc.c \
+ $(srcdir)/../../gdbsupport/xml-utils.c \
  $(srcdir)/nat/aarch64-sve-linux-ptrace.c \
  $(srcdir)/nat/linux-btrace.c \
  $(srcdir)/nat/linux-namespaces.c \
@@ -529,8 +531,8 @@ am--refresh:
 
 force:
 
-version-generated.c: Makefile $(srcdir)/../version.in $(srcdir)/../../bfd/version.h $(srcdir)/../gdbsupport/create-version.sh
- $(ECHO_GEN) $(SHELL) $(srcdir)/../gdbsupport/create-version.sh $(srcdir)/.. \
+version-generated.c: Makefile $(srcdir)/../version.in $(srcdir)/../../bfd/version.h $(srcdir)/../../gdbsupport/create-version.sh
+ $(ECHO_GEN) $(SHELL) $(srcdir)/../../gdbsupport/create-version.sh $(srcdir)/.. \
  $(host_alias) $(target_alias) $@
 
 xml-builtin-generated.c: stamp-xml; @true
@@ -588,7 +590,7 @@ arch/%-ipa.o: ../arch/%.c
  $(IPAGENT_COMPILE) $<
  $(POSTCOMPILE)
 
-gdbsupport/%-ipa.o: ../gdbsupport/%.c
+gdbsupport/%-ipa.o: ../../gdbsupport/%.c
  $(IPAGENT_COMPILE) $<
  $(POSTCOMPILE)
 
@@ -621,7 +623,7 @@ arch/%.o: ../arch/%.c
  $(COMPILE) $<
  $(POSTCOMPILE)
 
-gdbsupport/%.o: ../gdbsupport/%.c
+gdbsupport/%.o: ../../gdbsupport/%.c
  $(COMPILE) $<
  $(POSTCOMPILE)
 
diff --git a/gdb/gdbserver/acinclude.m4 b/gdb/gdbserver/acinclude.m4
index 4c18e9b01db..a42f2d5e74a 100644
--- a/gdb/gdbserver/acinclude.m4
+++ b/gdb/gdbserver/acinclude.m4
@@ -18,7 +18,7 @@ m4_include(../../config/lead-dot.m4)
 dnl codeset.m4 is needed for common.m4, but not for
 dnl anything else in gdbserver.
 m4_include(../../config/codeset.m4)
-m4_include(../gdbsupport/common.m4)
+m4_include(../../gdbsupport/common.m4)
 
 dnl For libiberty_INIT.
 m4_include(../libiberty.m4)
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index 3ed18f1f372..263fb0efeac 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -18,6 +18,14 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "gdbsupport/common-defs.h"
+
+#undef PACKAGE
+#undef PACKAGE_NAME
+#undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+
+#include <config.h>
 #include "gdbsupport/version.h"
 
 #if HAVE_SYS_FILE_H
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 0c74f99a161..3c286862349 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -21,6 +21,14 @@
 
 #include "gdbsupport/common-defs.h"
 
+#undef PACKAGE
+#undef PACKAGE_NAME
+#undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+
+#include <config.h>
+
 gdb_static_assert (sizeof (CORE_ADDR) >= sizeof (void *));
 
 #ifdef __MINGW32CE__
diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c
index 03fc85e2ece..3a3cd8d235d 100644
--- a/gdb/nat/linux-btrace.c
+++ b/gdb/nat/linux-btrace.c
@@ -20,6 +20,14 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "gdbsupport/common-defs.h"
+
+#undef PACKAGE
+#undef PACKAGE_NAME
+#undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+
+#include <config.h>
 #include "linux-btrace.h"
 #include "gdbsupport/common-regcache.h"
 #include "gdbsupport/gdb_wait.h"
diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
index 5335d690922..859feb7ca87 100644
--- a/gdb/nat/linux-ptrace.c
+++ b/gdb/nat/linux-ptrace.c
@@ -17,6 +17,14 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "gdbsupport/common-defs.h"
+
+#undef PACKAGE
+#undef PACKAGE_NAME
+#undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+
+#include <config.h>
 #include "linux-ptrace.h"
 #include "linux-procfs.h"
 #include "linux-waitpid.h"
diff --git a/gdb/nat/x86-linux-dregs.c b/gdb/nat/x86-linux-dregs.c
index b5dd71e3c7c..31683aab17c 100644
--- a/gdb/nat/x86-linux-dregs.c
+++ b/gdb/nat/x86-linux-dregs.c
@@ -18,6 +18,14 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "gdbsupport/common-defs.h"
+
+#undef PACKAGE
+#undef PACKAGE_NAME
+#undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+
+#include <config.h>
 #include "nat/gdb_ptrace.h"
 #include <sys/user.h>
 #include "target/waitstatus.h"
diff --git a/gdbsupport/ChangeLog b/gdbsupport/ChangeLog
new file mode 100644
index 00000000000..727b919bb08
--- /dev/null
+++ b/gdbsupport/ChangeLog
@@ -0,0 +1,7 @@
+2020-01-08  Tom Tromey  <[hidden email]>
+
+ * common-defs.h: Add GDBSERVER case.  Update includes.
+ * acinclude.m4, aclocal.m4, config.in, configure, configure.ac,
+ Makefile.am, Makefile.in, README: New files.
+ * Moved from ../gdb/gdbsupport/
+
diff --git a/gdbsupport/Makefile.am b/gdbsupport/Makefile.am
new file mode 100644
index 00000000000..48e6079fb9f
--- /dev/null
+++ b/gdbsupport/Makefile.am
@@ -0,0 +1,70 @@
+## Process this file with automake to generate Makefile.in
+#
+#   Copyright (C) 2020 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+#
+
+AUTOMAKE_OPTIONS = no-dist foreign
+ACLOCAL_AMFLAGS = -I . -I ../config
+
+AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir)/../gdb \
+    -I../gnulib/import -I$(srcdir)/../gnulib/import \
+    -I.. -I$(srcdir)/.. $(INCINTL) -I../bfd -I$(srcdir)/../bfd
+
+override CC := $(CXX)
+override CFLAGS := $(CXXFLAGS)
+
+noinst_LIBRARIES = libgdbsupport.a
+
+if SELFTEST
+selftest = selftest.c
+endif
+
+libgdbsupport_a_SOURCES = \
+    agent.c \
+    btrace-common.c \
+    buffer.c \
+    cleanups.c \
+    common-debug.c \
+    common-exceptions.c \
+    common-inferior.c \
+    common-regcache.c \
+    common-utils.c \
+    environ.c \
+    errors.c \
+    fileio.c \
+    filestuff.c \
+    format.c \
+    gdb-dlfcn.c \
+    gdb_tilde_expand.c \
+    gdb_wait.c \
+    gdb_vecs.c \
+    job-control.c \
+    netstuff.c \
+    new-op.c \
+    pathstuff.c \
+    print-utils.c \
+    ptid.c \
+    rsp-low.c \
+    run-time-clock.c \
+    safe-strerror.c \
+    scoped_mmap.c \
+    signals.c \
+    signals-state-save-restore.c \
+    tdesc.c \
+    thread-pool.c \
+    xml-utils.c \
+    $(selftest)
diff --git a/gdbsupport/README b/gdbsupport/README
new file mode 100644
index 00000000000..257dcea5af9
--- /dev/null
+++ b/gdbsupport/README
@@ -0,0 +1,4 @@
+This is a helper library that is used by gdb and gdbserver.
+
+To send patches, follow the gdb patch submission instructions in
+../gdb/CONTRIBUTE.  For maintainers, see ../gdb/MAINTAINERS.
diff --git a/gdbsupport/acinclude.m4 b/gdbsupport/acinclude.m4
new file mode 100644
index 00000000000..6e20e9cdb0a
--- /dev/null
+++ b/gdbsupport/acinclude.m4
@@ -0,0 +1,5 @@
+m4_include([common.m4])
+m4_include([../config/ax_pthread.m4])
+m4_include([../gdb/ax_cxx_compile_stdcxx.m4])
+m4_include([../gdb/libiberty.m4])
+m4_include([../gdb/selftest.m4])
diff --git a/gdb/gdbsupport/agent.c b/gdbsupport/agent.c
similarity index 100%
rename from gdb/gdbsupport/agent.c
rename to gdbsupport/agent.c
diff --git a/gdb/gdbsupport/agent.h b/gdbsupport/agent.h
similarity index 100%
rename from gdb/gdbsupport/agent.h
rename to gdbsupport/agent.h
diff --git a/gdb/gdbsupport/alt-stack.h b/gdbsupport/alt-stack.h
similarity index 100%
rename from gdb/gdbsupport/alt-stack.h
rename to gdbsupport/alt-stack.h
diff --git a/gdb/gdbsupport/array-view.h b/gdbsupport/array-view.h
similarity index 100%
rename from gdb/gdbsupport/array-view.h
rename to gdbsupport/array-view.h
diff --git a/gdb/gdbsupport/ax.def b/gdbsupport/ax.def
similarity index 100%
rename from gdb/gdbsupport/ax.def
rename to gdbsupport/ax.def
diff --git a/gdb/gdbsupport/block-signals.h b/gdbsupport/block-signals.h
similarity index 100%
rename from gdb/gdbsupport/block-signals.h
rename to gdbsupport/block-signals.h
diff --git a/gdb/gdbsupport/break-common.h b/gdbsupport/break-common.h
similarity index 100%
rename from gdb/gdbsupport/break-common.h
rename to gdbsupport/break-common.h
diff --git a/gdb/gdbsupport/btrace-common.c b/gdbsupport/btrace-common.c
similarity index 100%
rename from gdb/gdbsupport/btrace-common.c
rename to gdbsupport/btrace-common.c
diff --git a/gdb/gdbsupport/btrace-common.h b/gdbsupport/btrace-common.h
similarity index 100%
rename from gdb/gdbsupport/btrace-common.h
rename to gdbsupport/btrace-common.h
diff --git a/gdb/gdbsupport/buffer.c b/gdbsupport/buffer.c
similarity index 100%
rename from gdb/gdbsupport/buffer.c
rename to gdbsupport/buffer.c
diff --git a/gdb/gdbsupport/buffer.h b/gdbsupport/buffer.h
similarity index 100%
rename from gdb/gdbsupport/buffer.h
rename to gdbsupport/buffer.h
diff --git a/gdb/gdbsupport/byte-vector.h b/gdbsupport/byte-vector.h
similarity index 100%
rename from gdb/gdbsupport/byte-vector.h
rename to gdbsupport/byte-vector.h
diff --git a/gdb/gdbsupport/cleanups.c b/gdbsupport/cleanups.c
similarity index 100%
rename from gdb/gdbsupport/cleanups.c
rename to gdbsupport/cleanups.c
diff --git a/gdb/gdbsupport/cleanups.h b/gdbsupport/cleanups.h
similarity index 100%
rename from gdb/gdbsupport/cleanups.h
rename to gdbsupport/cleanups.h
diff --git a/gdb/gdbsupport/common-debug.c b/gdbsupport/common-debug.c
similarity index 100%
rename from gdb/gdbsupport/common-debug.c
rename to gdbsupport/common-debug.c
diff --git a/gdb/gdbsupport/common-debug.h b/gdbsupport/common-debug.h
similarity index 100%
rename from gdb/gdbsupport/common-debug.h
rename to gdbsupport/common-debug.h
diff --git a/gdb/gdbsupport/common-defs.h b/gdbsupport/common-defs.h
similarity index 95%
rename from gdb/gdbsupport/common-defs.h
rename to gdbsupport/common-defs.h
index 214bca1ee17..d823c41607c 100644
--- a/gdb/gdbsupport/common-defs.h
+++ b/gdbsupport/common-defs.h
@@ -20,24 +20,32 @@
 #ifndef COMMON_COMMON_DEFS_H
 #define COMMON_COMMON_DEFS_H
 
-#include "config.h"
+#ifdef GDBSERVER
+
+#include <build-gnulib-gdbserver/config.h>
 
 #undef PACKAGE_NAME
+#undef PACKAGE
 #undef PACKAGE_VERSION
 #undef PACKAGE_STRING
 #undef PACKAGE_TARNAME
 
-#ifdef GDBSERVER
-#include "build-gnulib-gdbserver/config.h"
-#else
-#include "../../gnulib/config.h"
-#endif
+#include <config.h>
+
+#else  /* GDBSERVER */
+
+#include <gdbsupport/support-config.h>
 
 #undef PACKAGE_NAME
+#undef PACKAGE
 #undef PACKAGE_VERSION
 #undef PACKAGE_STRING
 #undef PACKAGE_TARNAME
 
+#include "gnulib/config.h"
+
+#endif /* GDBSERVER */
+
 /* From:
     https://www.gnu.org/software/gnulib/manual/html_node/stdint_002eh.html
 
diff --git a/gdb/gdbsupport/common-exceptions.c b/gdbsupport/common-exceptions.c
similarity index 100%
rename from gdb/gdbsupport/common-exceptions.c
rename to gdbsupport/common-exceptions.c
diff --git a/gdb/gdbsupport/common-exceptions.h b/gdbsupport/common-exceptions.h
similarity index 100%
rename from gdb/gdbsupport/common-exceptions.h
rename to gdbsupport/common-exceptions.h
diff --git a/gdb/gdbsupport/common-gdbthread.h b/gdbsupport/common-gdbthread.h
similarity index 100%
rename from gdb/gdbsupport/common-gdbthread.h
rename to gdbsupport/common-gdbthread.h
diff --git a/gdb/gdbsupport/common-inferior.c b/gdbsupport/common-inferior.c
similarity index 100%
rename from gdb/gdbsupport/common-inferior.c
rename to gdbsupport/common-inferior.c
diff --git a/gdb/gdbsupport/common-inferior.h b/gdbsupport/common-inferior.h
similarity index 100%
rename from gdb/gdbsupport/common-inferior.h
rename to gdbsupport/common-inferior.h
diff --git a/gdb/gdbsupport/common-regcache.c b/gdbsupport/common-regcache.c
similarity index 100%
rename from gdb/gdbsupport/common-regcache.c
rename to gdbsupport/common-regcache.c
diff --git a/gdb/gdbsupport/common-regcache.h b/gdbsupport/common-regcache.h
similarity index 100%
rename from gdb/gdbsupport/common-regcache.h
rename to gdbsupport/common-regcache.h
diff --git a/gdb/gdbsupport/common-types.h b/gdbsupport/common-types.h
similarity index 100%
rename from gdb/gdbsupport/common-types.h
rename to gdbsupport/common-types.h
diff --git a/gdb/gdbsupport/common-utils.c b/gdbsupport/common-utils.c
similarity index 100%
rename from gdb/gdbsupport/common-utils.c
rename to gdbsupport/common-utils.c
diff --git a/gdb/gdbsupport/common-utils.h b/gdbsupport/common-utils.h
similarity index 100%
rename from gdb/gdbsupport/common-utils.h
rename to gdbsupport/common-utils.h
diff --git a/gdb/gdbsupport/common.m4 b/gdbsupport/common.m4
similarity index 100%
rename from gdb/gdbsupport/common.m4
rename to gdbsupport/common.m4
diff --git a/gdbsupport/configure.ac b/gdbsupport/configure.ac
new file mode 100644
index 00000000000..1dfed3cdc51
--- /dev/null
+++ b/gdbsupport/configure.ac
@@ -0,0 +1,63 @@
+dnl Autoconf configure script for GDB support library
+dnl Copyright (C) 2020 Free Software Foundation, Inc.
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT([gdbsupport], 1.0)
+AC_CONFIG_SRCDIR(common-defs.h)
+AC_CONFIG_HEADER(support-config.h:config.in)
+AC_CANONICAL_SYSTEM
+AM_MAINTAINER_MODE
+AC_CONFIG_AUX_DIR(..)
+AM_INIT_AUTOMAKE
+AM_SILENT_RULES([yes])
+
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_RANLIB
+
+AC_USE_SYSTEM_EXTENSIONS
+ACX_LARGEFILE
+AM_PROG_CC_STDC
+
+# We require a C++11 compiler.  Check if one is available, and if
+# necessary, set CXX_DIALECT to some -std=xxx switch.
+AX_CXX_COMPILE_STDCXX(11, , mandatory)
+
+dnl Set up for gettext.
+ZW_GNU_GETTEXT_SISTER_DIR
+
+libiberty_INIT
+GDB_AC_COMMON
+GDB_AC_SELFTEST
+AM_CONDITIONAL(SELFTEST, $enable_unittests)
+
+TARGET_WORD_SIZE=`sed -n 's,#define BFD_ARCH_SIZE \(.*\)$,\1,p' ../bfd/bfd-in3.h`
+AC_DEFINE_UNQUOTED(TARGET_WORD_SIZE, $TARGET_WORD_SIZE,
+   [Define to the word size for the target.])
+
+case ${host} in
+  *mingw32*)
+    AC_DEFINE(USE_WIN32API, 1,
+              [Define if we should use the Windows API, instead of the
+       POSIX API.  On Windows, we use the Windows API when
+       building for MinGW, but the POSIX API when building
+       for Cygwin.])
+    ;;
+esac
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/gdb/gdbsupport/create-version.sh b/gdbsupport/create-version.sh
similarity index 100%
rename from gdb/gdbsupport/create-version.sh
rename to gdbsupport/create-version.sh
diff --git a/gdb/gdbsupport/def-vector.h b/gdbsupport/def-vector.h
similarity index 100%
rename from gdb/gdbsupport/def-vector.h
rename to gdbsupport/def-vector.h
diff --git a/gdb/gdbsupport/default-init-alloc.h b/gdbsupport/default-init-alloc.h
similarity index 100%
rename from gdb/gdbsupport/default-init-alloc.h
rename to gdbsupport/default-init-alloc.h
diff --git a/gdb/gdbsupport/enum-flags.h b/gdbsupport/enum-flags.h
similarity index 100%
rename from gdb/gdbsupport/enum-flags.h
rename to gdbsupport/enum-flags.h
diff --git a/gdb/gdbsupport/environ.c b/gdbsupport/environ.c
similarity index 100%
rename from gdb/gdbsupport/environ.c
rename to gdbsupport/environ.c
diff --git a/gdb/gdbsupport/environ.h b/gdbsupport/environ.h
similarity index 100%
rename from gdb/gdbsupport/environ.h
rename to gdbsupport/environ.h
diff --git a/gdb/gdbsupport/errors.c b/gdbsupport/errors.c
similarity index 100%
rename from gdb/gdbsupport/errors.c
rename to gdbsupport/errors.c
diff --git a/gdb/gdbsupport/errors.h b/gdbsupport/errors.h
similarity index 100%
rename from gdb/gdbsupport/errors.h
rename to gdbsupport/errors.h
diff --git a/gdb/gdbsupport/fileio.c b/gdbsupport/fileio.c
similarity index 100%
rename from gdb/gdbsupport/fileio.c
rename to gdbsupport/fileio.c
diff --git a/gdb/gdbsupport/fileio.h b/gdbsupport/fileio.h
similarity index 100%
rename from gdb/gdbsupport/fileio.h
rename to gdbsupport/fileio.h
diff --git a/gdb/gdbsupport/filestuff.c b/gdbsupport/filestuff.c
similarity index 100%
rename from gdb/gdbsupport/filestuff.c
rename to gdbsupport/filestuff.c
diff --git a/gdb/gdbsupport/filestuff.h b/gdbsupport/filestuff.h
similarity index 100%
rename from gdb/gdbsupport/filestuff.h
rename to gdbsupport/filestuff.h
diff --git a/gdb/gdbsupport/filtered-iterator.h b/gdbsupport/filtered-iterator.h
similarity index 100%
rename from gdb/gdbsupport/filtered-iterator.h
rename to gdbsupport/filtered-iterator.h
diff --git a/gdb/gdbsupport/format.c b/gdbsupport/format.c
similarity index 100%
rename from gdb/gdbsupport/format.c
rename to gdbsupport/format.c
diff --git a/gdb/gdbsupport/format.h b/gdbsupport/format.h
similarity index 100%
rename from gdb/gdbsupport/format.h
rename to gdbsupport/format.h
diff --git a/gdb/gdbsupport/forward-scope-exit.h b/gdbsupport/forward-scope-exit.h
similarity index 100%
rename from gdb/gdbsupport/forward-scope-exit.h
rename to gdbsupport/forward-scope-exit.h
diff --git a/gdb/gdbsupport/function-view.h b/gdbsupport/function-view.h
similarity index 100%
rename from gdb/gdbsupport/function-view.h
rename to gdbsupport/function-view.h
diff --git a/gdb/gdbsupport/gdb-dlfcn.c b/gdbsupport/gdb-dlfcn.c
similarity index 100%
rename from gdb/gdbsupport/gdb-dlfcn.c
rename to gdbsupport/gdb-dlfcn.c
diff --git a/gdb/gdbsupport/gdb-dlfcn.h b/gdbsupport/gdb-dlfcn.h
similarity index 100%
rename from gdb/gdbsupport/gdb-dlfcn.h
rename to gdbsupport/gdb-dlfcn.h
diff --git a/gdb/gdbsupport/gdb-sigmask.h b/gdbsupport/gdb-sigmask.h
similarity index 100%
rename from gdb/gdbsupport/gdb-sigmask.h
rename to gdbsupport/gdb-sigmask.h
diff --git a/gdb/gdbsupport/gdb_assert.h b/gdbsupport/gdb_assert.h
similarity index 100%
rename from gdb/gdbsupport/gdb_assert.h
rename to gdbsupport/gdb_assert.h
diff --git a/gdb/gdbsupport/gdb_binary_search.h b/gdbsupport/gdb_binary_search.h
similarity index 100%
rename from gdb/gdbsupport/gdb_binary_search.h
rename to gdbsupport/gdb_binary_search.h
diff --git a/gdb/gdbsupport/gdb_locale.h b/gdbsupport/gdb_locale.h
similarity index 100%
rename from gdb/gdbsupport/gdb_locale.h
rename to gdbsupport/gdb_locale.h
diff --git a/gdb/gdbsupport/gdb_optional.h b/gdbsupport/gdb_optional.h
similarity index 100%
rename from gdb/gdbsupport/gdb_optional.h
rename to gdbsupport/gdb_optional.h
diff --git a/gdb/gdbsupport/gdb_proc_service.h b/gdbsupport/gdb_proc_service.h
similarity index 100%
rename from gdb/gdbsupport/gdb_proc_service.h
rename to gdbsupport/gdb_proc_service.h
diff --git a/gdb/gdbsupport/gdb_ref_ptr.h b/gdbsupport/gdb_ref_ptr.h
similarity index 100%
rename from gdb/gdbsupport/gdb_ref_ptr.h
rename to gdbsupport/gdb_ref_ptr.h
diff --git a/gdb/gdbsupport/gdb_setjmp.h b/gdbsupport/gdb_setjmp.h
similarity index 100%
rename from gdb/gdbsupport/gdb_setjmp.h
rename to gdbsupport/gdb_setjmp.h
diff --git a/gdb/gdbsupport/gdb_signals.h b/gdbsupport/gdb_signals.h
similarity index 100%
rename from gdb/gdbsupport/gdb_signals.h
rename to gdbsupport/gdb_signals.h
diff --git a/gdb/gdbsupport/gdb_splay_tree.h b/gdbsupport/gdb_splay_tree.h
similarity index 100%
rename from gdb/gdbsupport/gdb_splay_tree.h
rename to gdbsupport/gdb_splay_tree.h
diff --git a/gdb/gdbsupport/gdb_string_view.h b/gdbsupport/gdb_string_view.h
similarity index 100%
rename from gdb/gdbsupport/gdb_string_view.h
rename to gdbsupport/gdb_string_view.h
diff --git a/gdb/gdbsupport/gdb_string_view.tcc b/gdbsupport/gdb_string_view.tcc
similarity index 100%
rename from gdb/gdbsupport/gdb_string_view.tcc
rename to gdbsupport/gdb_string_view.tcc
diff --git a/gdb/gdbsupport/gdb_sys_time.h b/gdbsupport/gdb_sys_time.h
similarity index 100%
rename from gdb/gdbsupport/gdb_sys_time.h
rename to gdbsupport/gdb_sys_time.h
diff --git a/gdb/gdbsupport/gdb_tilde_expand.c b/gdbsupport/gdb_tilde_expand.c
similarity index 100%
rename from gdb/gdbsupport/gdb_tilde_expand.c
rename to gdbsupport/gdb_tilde_expand.c
diff --git a/gdb/gdbsupport/gdb_tilde_expand.h b/gdbsupport/gdb_tilde_expand.h
similarity index 100%
rename from gdb/gdbsupport/gdb_tilde_expand.h
rename to gdbsupport/gdb_tilde_expand.h
diff --git a/gdb/gdbsupport/gdb_unique_ptr.h b/gdbsupport/gdb_unique_ptr.h
similarity index 100%
rename from gdb/gdbsupport/gdb_unique_ptr.h
rename to gdbsupport/gdb_unique_ptr.h
diff --git a/gdb/gdbsupport/gdb_unlinker.h b/gdbsupport/gdb_unlinker.h
similarity index 100%
rename from gdb/gdbsupport/gdb_unlinker.h
rename to gdbsupport/gdb_unlinker.h
diff --git a/gdb/gdbsupport/gdb_vecs.c b/gdbsupport/gdb_vecs.c
similarity index 100%
rename from gdb/gdbsupport/gdb_vecs.c
rename to gdbsupport/gdb_vecs.c
diff --git a/gdb/gdbsupport/gdb_vecs.h b/gdbsupport/gdb_vecs.h
similarity index 100%
rename from gdb/gdbsupport/gdb_vecs.h
rename to gdbsupport/gdb_vecs.h
diff --git a/gdb/gdbsupport/gdb_wait.c b/gdbsupport/gdb_wait.c
similarity index 100%
rename from gdb/gdbsupport/gdb_wait.c
rename to gdbsupport/gdb_wait.c
diff --git a/gdb/gdbsupport/gdb_wait.h b/gdbsupport/gdb_wait.h
similarity index 100%
rename from gdb/gdbsupport/gdb_wait.h
rename to gdbsupport/gdb_wait.h
diff --git a/gdb/gdbsupport/hash_enum.h b/gdbsupport/hash_enum.h
similarity index 100%
rename from gdb/gdbsupport/hash_enum.h
rename to gdbsupport/hash_enum.h
diff --git a/gdb/gdbsupport/host-defs.h b/gdbsupport/host-defs.h
similarity index 100%
rename from gdb/gdbsupport/host-defs.h
rename to gdbsupport/host-defs.h
diff --git a/gdb/gdbsupport/job-control.c b/gdbsupport/job-control.c
similarity index 100%
rename from gdb/gdbsupport/job-control.c
rename to gdbsupport/job-control.c
diff --git a/gdb/gdbsupport/job-control.h b/gdbsupport/job-control.h
similarity index 100%
rename from gdb/gdbsupport/job-control.h
rename to gdbsupport/job-control.h
diff --git a/gdb/gdbsupport/netstuff.c b/gdbsupport/netstuff.c
similarity index 100%
rename from gdb/gdbsupport/netstuff.c
rename to gdbsupport/netstuff.c
diff --git a/gdb/gdbsupport/netstuff.h b/gdbsupport/netstuff.h
similarity index 100%
rename from gdb/gdbsupport/netstuff.h
rename to gdbsupport/netstuff.h
diff --git a/gdb/gdbsupport/new-op.c b/gdbsupport/new-op.c
similarity index 100%
rename from gdb/gdbsupport/new-op.c
rename to gdbsupport/new-op.c
diff --git a/gdb/gdbsupport/next-iterator.h b/gdbsupport/next-iterator.h
similarity index 100%
rename from gdb/gdbsupport/next-iterator.h
rename to gdbsupport/next-iterator.h
diff --git a/gdb/gdbsupport/observable.h b/gdbsupport/observable.h
similarity index 100%
rename from gdb/gdbsupport/observable.h
rename to gdbsupport/observable.h
diff --git a/gdb/gdbsupport/offset-type.h b/gdbsupport/offset-type.h
similarity index 100%
rename from gdb/gdbsupport/offset-type.h
rename to gdbsupport/offset-type.h
diff --git a/gdb/gdbsupport/parallel-for.h b/gdbsupport/parallel-for.h
similarity index 100%
rename from gdb/gdbsupport/parallel-for.h
rename to gdbsupport/parallel-for.h
diff --git a/gdb/gdbsupport/pathstuff.c b/gdbsupport/pathstuff.c
similarity index 100%
rename from gdb/gdbsupport/pathstuff.c
rename to gdbsupport/pathstuff.c
diff --git a/gdb/gdbsupport/pathstuff.h b/gdbsupport/pathstuff.h
similarity index 100%
rename from gdb/gdbsupport/pathstuff.h
rename to gdbsupport/pathstuff.h
diff --git a/gdb/gdbsupport/poison.h b/gdbsupport/poison.h
similarity index 100%
rename from gdb/gdbsupport/poison.h
rename to gdbsupport/poison.h
diff --git a/gdb/gdbsupport/preprocessor.h b/gdbsupport/preprocessor.h
similarity index 100%
rename from gdb/gdbsupport/preprocessor.h
rename to gdbsupport/preprocessor.h
diff --git a/gdb/gdbsupport/print-utils.c b/gdbsupport/print-utils.c
similarity index 100%
rename from gdb/gdbsupport/print-utils.c
rename to gdbsupport/print-utils.c
diff --git a/gdb/gdbsupport/print-utils.h b/gdbsupport/print-utils.h
similarity index 100%
rename from gdb/gdbsupport/print-utils.h
rename to gdbsupport/print-utils.h
diff --git a/gdb/gdbsupport/ptid.c b/gdbsupport/ptid.c
similarity index 100%
rename from gdb/gdbsupport/ptid.c
rename to gdbsupport/ptid.c
diff --git a/gdb/gdbsupport/ptid.h b/gdbsupport/ptid.h
similarity index 100%
rename from gdb/gdbsupport/ptid.h
rename to gdbsupport/ptid.h
diff --git a/gdb/gdbsupport/refcounted-object.h b/gdbsupport/refcounted-object.h
similarity index 100%
rename from gdb/gdbsupport/refcounted-object.h
rename to gdbsupport/refcounted-object.h
diff --git a/gdb/gdbsupport/rsp-low.c b/gdbsupport/rsp-low.c
similarity index 100%
rename from gdb/gdbsupport/rsp-low.c
rename to gdbsupport/rsp-low.c
diff --git a/gdb/gdbsupport/rsp-low.h b/gdbsupport/rsp-low.h
similarity index 100%
rename from gdb/gdbsupport/rsp-low.h
rename to gdbsupport/rsp-low.h
diff --git a/gdb/gdbsupport/run-time-clock.c b/gdbsupport/run-time-clock.c
similarity index 100%
rename from gdb/gdbsupport/run-time-clock.c
rename to gdbsupport/run-time-clock.c
diff --git a/gdb/gdbsupport/run-time-clock.h b/gdbsupport/run-time-clock.h
similarity index 100%
rename from gdb/gdbsupport/run-time-clock.h
rename to gdbsupport/run-time-clock.h
diff --git a/gdb/gdbsupport/safe-iterator.h b/gdbsupport/safe-iterator.h
similarity index 100%
rename from gdb/gdbsupport/safe-iterator.h
rename to gdbsupport/safe-iterator.h
diff --git a/gdb/gdbsupport/safe-strerror.c b/gdbsupport/safe-strerror.c
similarity index 100%
rename from gdb/gdbsupport/safe-strerror.c
rename to gdbsupport/safe-strerror.c
diff --git a/gdb/gdbsupport/scope-exit.h b/gdbsupport/scope-exit.h
similarity index 100%
rename from gdb/gdbsupport/scope-exit.h
rename to gdbsupport/scope-exit.h
diff --git a/gdb/gdbsupport/scoped_fd.h b/gdbsupport/scoped_fd.h
similarity index 100%
rename from gdb/gdbsupport/scoped_fd.h
rename to gdbsupport/scoped_fd.h
diff --git a/gdb/gdbsupport/scoped_mmap.c b/gdbsupport/scoped_mmap.c
similarity index 100%
rename from gdb/gdbsupport/scoped_mmap.c
rename to gdbsupport/scoped_mmap.c
diff --git a/gdb/gdbsupport/scoped_mmap.h b/gdbsupport/scoped_mmap.h
similarity index 100%
rename from gdb/gdbsupport/scoped_mmap.h
rename to gdbsupport/scoped_mmap.h
diff --git a/gdb/gdbsupport/scoped_restore.h b/gdbsupport/scoped_restore.h
similarity index 100%
rename from gdb/gdbsupport/scoped_restore.h
rename to gdbsupport/scoped_restore.h
diff --git a/gdb/gdbsupport/selftest.c b/gdbsupport/selftest.c
similarity index 100%
rename from gdb/gdbsupport/selftest.c
rename to gdbsupport/selftest.c
diff --git a/gdb/gdbsupport/selftest.h b/gdbsupport/selftest.h
similarity index 100%
rename from gdb/gdbsupport/selftest.h
rename to gdbsupport/selftest.h
diff --git a/gdb/gdbsupport/signals-state-save-restore.c b/gdbsupport/signals-state-save-restore.c
similarity index 100%
rename from gdb/gdbsupport/signals-state-save-restore.c
rename to gdbsupport/signals-state-save-restore.c
diff --git a/gdb/gdbsupport/signals-state-save-restore.h b/gdbsupport/signals-state-save-restore.h
similarity index 100%
rename from gdb/gdbsupport/signals-state-save-restore.h
rename to gdbsupport/signals-state-save-restore.h
diff --git a/gdb/gdbsupport/signals.c b/gdbsupport/signals.c
similarity index 100%
rename from gdb/gdbsupport/signals.c
rename to gdbsupport/signals.c
diff --git a/gdb/gdbsupport/symbol.h b/gdbsupport/symbol.h
similarity index 100%
rename from gdb/gdbsupport/symbol.h
rename to gdbsupport/symbol.h
diff --git a/gdb/gdbsupport/tdesc.c b/gdbsupport/tdesc.c
similarity index 100%
rename from gdb/gdbsupport/tdesc.c
rename to gdbsupport/tdesc.c
diff --git a/gdb/gdbsupport/tdesc.h b/gdbsupport/tdesc.h
similarity index 100%
rename from gdb/gdbsupport/tdesc.h
rename to gdbsupport/tdesc.h
diff --git a/gdb/gdbsupport/thread-pool.c b/gdbsupport/thread-pool.c
similarity index 100%
rename from gdb/gdbsupport/thread-pool.c
rename to gdbsupport/thread-pool.c
diff --git a/gdb/gdbsupport/thread-pool.h b/gdbsupport/thread-pool.h
similarity index 100%
rename from gdb/gdbsupport/thread-pool.h
rename to gdbsupport/thread-pool.h
diff --git a/gdb/gdbsupport/traits.h b/gdbsupport/traits.h
similarity index 100%
rename from gdb/gdbsupport/traits.h
rename to gdbsupport/traits.h
diff --git a/gdb/gdbsupport/underlying.h b/gdbsupport/underlying.h
similarity index 100%
rename from gdb/gdbsupport/underlying.h
rename to gdbsupport/underlying.h
diff --git a/gdb/gdbsupport/valid-expr.h b/gdbsupport/valid-expr.h
similarity index 100%
rename from gdb/gdbsupport/valid-expr.h
rename to gdbsupport/valid-expr.h
diff --git a/gdb/gdbsupport/version.h b/gdbsupport/version.h
similarity index 100%
rename from gdb/gdbsupport/version.h
rename to gdbsupport/version.h
diff --git a/gdb/gdbsupport/x86-xstate.h b/gdbsupport/x86-xstate.h
similarity index 100%
rename from gdb/gdbsupport/x86-xstate.h
rename to gdbsupport/x86-xstate.h
diff --git a/gdb/gdbsupport/xml-utils.c b/gdbsupport/xml-utils.c
similarity index 100%
rename from gdb/gdbsupport/xml-utils.c
rename to gdbsupport/xml-utils.c
diff --git a/gdb/gdbsupport/xml-utils.h b/gdbsupport/xml-utils.h
similarity index 100%
rename from gdb/gdbsupport/xml-utils.h
rename to gdbsupport/xml-utils.h
diff --git a/src-release.sh b/src-release.sh
index 275f0f24b5d..92e92ac5d77 100755
--- a/src-release.sh
+++ b/src-release.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-#   Copyright (C) 1990-2018 Free Software Foundation
+#   Copyright (C) 1990-2019 Free Software Foundation
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -315,7 +315,7 @@ gas_release()
     tar_compress $package $tool "$GAS_SUPPORT_DIRS" "$compressors"
 }
 
-GDB_SUPPORT_DIRS="bfd include libiberty libctf opcodes readline sim intl libdecnumber cpu zlib contrib gnulib"
+GDB_SUPPORT_DIRS="bfd include libiberty libctf opcodes readline sim intl libdecnumber cpu zlib contrib gnulib gdbsupport"
 gdb_release()
 {
     compressors=$1
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Tom Tromey-2
>>>>> "Simon" == Simon Marchi <[hidden email]> writes:

Simon> The indentation in common.m4 looks off, starting with:
Simon>   AC_CACHE_CHECK([for sigsetjmp], gdb_cv_func_sigsetjmp

Simon> Starting from this line until the end, I think it should be indented by
Simon> two columns.  It's already wrong today, but what you added also has wrong
Simon> indentation, making it hard to understand that it's all under `GDB_AC_COMMON`.
Simon> Could you fix that?  I don't really mind if it's a patch before or after this
Simon> series.

I will send and check in a patch for that shortly.

Simon> I see that GDB_AC_PTRACE is called in all three configure.ac files.  Should it
Simon> be put in GDB_AC_COMMON?

We don't have a good way to include ptrace.m4 from common.m4.  Maybe the
call could be moved there but the user still has to know to include
ptrace.m4 somewhere.

Tom
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Tom Tromey-2
In reply to this post by Tom Tromey-2
>>>>> "Simon" == Simon Marchi <[hidden email]> writes:

Simon> Other than that, the series LGTM.

I've rebased it and I am going to check it in soon.

You will probably need to do a clean rebuild.

I'll clean up the next patch in the larger move-gdbserver series soon.

Tom
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Pedro Alves-7
In reply to this post by Tom Tromey-2
I'm seeing this on F27 (a clean build from scratch):

~~~~~~~~~~~~~~~~~~~~~~~~~~~
 make[3]: Entering directory '/home/pedro/brno/pedro/gdb/binutils-gdb/build/gdbsupport'
   CC       gdb_tilde_expand.o
 In file included from /home/pedro/gdb/binutils-gdb/src/gdbsupport/../gnulib/import/libc-config.h:33:0,
                  from ../gnulib/import/glob.h:544,
                  from /home/pedro/gdb/binutils-gdb/src/gdbsupport/gdb_tilde_expand.c:22:
 ../bfd/config.h:7:4: error: #error config.h must be #included before system headers
  #  error config.h must be #included before system headers
     ^~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~

libc-config.h, where it includes config.h, says:

~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /* This is intended to be a good-enough substitute for glibc system
    macros like those defined in <sys/cdefs.h>, so that Gnulib code
    shared with glibc can do this as the first #include:
 
      #ifndef _LIBC
      # include <libc-config.h>
      #endif
 
    When compiled as part of glibc this is a no-op; when compiled as
    part of Gnulib this includes Gnulib's <config.h> and defines macros
    that glibc library code would normally assume.  */
 
 #include <config.h>
~~~~~~~~~~~~~~~~~~~~~~~~~~~

So it seems like the issue is that that '#include <config.h>' picks up
bfd's config.h instead of gnulib's by mistake.

Thanks,
Pedro Alves

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Pedro Alves-7
On 1/15/20 2:09 PM, Pedro Alves wrote:

> So it seems like the issue is that that '#include <config.h>' picks up
> bfd's config.h instead of gnulib's by mistake.

I guess that this problem doesn't trigger in the gdb
dir because there we generate config.h under that exact name so
gnulib's libc-config.h ends up picking gdb's config.h instead
of gnulib.c and that ends up harmless.  

In gdbsupport, the config.h file is really named support-config.h,
so that '#include <config.h>' in libc-config.h doesn't pick it
like it would if it had the conventional config.h name.

gnulib's config.h is generated under build/gnulib/ directly,
so adding that to the include path fixes it for me.

Don't know what I think of gnulib headers including <config.h>.
Maybe we should rename gdb's config.h to gdb-config.h too.

From e212b0a4e5d332ddcc4ea12ce51481a3bf90ef34 Mon Sep 17 00:00:00 2001
From: Pedro Alves <[hidden email]>
Date: Wed, 15 Jan 2020 14:12:43 +0000
Subject: [PATCH] Fix gdbsupport build

I'm seeing this on F27 (a clean build from scratch):

~~~~~~~~~~~~~~~~~~~~~~~~~~~
 make[3]: Entering directory '/home/pedro/brno/pedro/gdb/binutils-gdb/build/gdbsupport'
   CC       gdb_tilde_expand.o
 In file included from /home/pedro/gdb/binutils-gdb/src/gdbsupport/../gnulib/import/libc-config.h:33:0,
                  from ../gnulib/import/glob.h:544,
                  from /home/pedro/gdb/binutils-gdb/src/gdbsupport/gdb_tilde_expand.c:22:
 ../bfd/config.h:7:4: error: #error config.h must be #included before system headers
  #  error config.h must be #included before system headers
     ^~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~

libc-config.h, where it includes config.h, says:

~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /* This is intended to be a good-enough substitute for glibc system
    macros like those defined in <sys/cdefs.h>, so that Gnulib code
    shared with glibc can do this as the first #include:

      #ifndef _LIBC
      # include <libc-config.h>
      #endif

    When compiled as part of glibc this is a no-op; when compiled as
    part of Gnulib this includes Gnulib's <config.h> and defines macros
    that glibc library code would normally assume.  */

 #include <config.h>
~~~~~~~~~~~~~~~~~~~~~~~~~~~

The issue is that that '#include <config.h>' picks up bfd's config.h
instead of gnulib's.

I guess that this problem doesn't trigger in the gdb dir because there
we generate config.h under that exact name so gnulib's libc-config.h
ends up picking gdb's config.h instead of gnulib.c and that ends up
harmless.

In gdbsupport, the config.h file is really named support-config.h, so
that '#include <config.h>' in libc-config.h doesn't pick it like it
would if it had the conventional config.h name.

gnulib's config.h is generated under build/gnulib/ directly, so adding
that to the include path fixes it for me.

gdbsupport/ChangeLog:
yyyy-mm-dd  Pedro Alves  <[hidden email]>

        * Makefile.am (AM_CPPFLAGS): Add -I../gnulib.
        * Makefile.in: Regenerate.
---
 gdbsupport/Makefile.am | 2 +-
 gdbsupport/Makefile.in | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdbsupport/Makefile.am b/gdbsupport/Makefile.am
index 1a001a00817..fdf376b2e12 100644
--- a/gdbsupport/Makefile.am
+++ b/gdbsupport/Makefile.am
@@ -21,7 +21,7 @@ AUTOMAKE_OPTIONS = no-dist foreign
 ACLOCAL_AMFLAGS = -I . -I ../config
 
 AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir)/../gdb \
-    -I../gnulib/import -I$(srcdir)/../gnulib/import \
+    -I../gnulib -I../gnulib/import -I$(srcdir)/../gnulib/import \
     -I.. -I$(srcdir)/.. $(INCINTL) -I../bfd -I$(srcdir)/../bfd
 
 override CC := $(CXX)
diff --git a/gdbsupport/Makefile.in b/gdbsupport/Makefile.in
index 5723ae5e97e..c3e6b744ec0 100644
--- a/gdbsupport/Makefile.in
+++ b/gdbsupport/Makefile.in
@@ -347,7 +347,7 @@ top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = no-dist foreign
 ACLOCAL_AMFLAGS = -I . -I ../config
 AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir)/../gdb \
-    -I../gnulib/import -I$(srcdir)/../gnulib/import \
+    -I../gnulib -I../gnulib/import -I$(srcdir)/../gnulib/import \
     -I.. -I$(srcdir)/.. $(INCINTL) -I../bfd -I$(srcdir)/../bfd
 
 noinst_LIBRARIES = libgdbsupport.a

base-commit: aad09917e04b33da463f1703aab8d057cfe3f54e
--
2.14.5

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Pedro Alves-7
On 1/15/20 2:41 PM, Pedro Alves wrote:
> Don't know what I think of gnulib headers including <config.h>.
> Maybe we should rename gdb's config.h to gdb-config.h too.

Hit reply to soon.  I meant to add,

... and then, add a manually-written config.h in the build
dir that does:

 #include <gdbsupport/support-config.h>
 #include <gdb-config.h>

We'd do the same to gdbsupport, add a config.h in its
build dir that does:

 #include "gnulib/config.h"
 #include <support-config.h>

Those config.h files would go in the build dirs so that
they're not picked by other build directories.

With that, any "#include <config.h>" in any header ends up
picking the currently-being-built project's config.h, plus
the dependencies' config.h files.

Just a half-baked thought.  Not sure it's the best idea.

Thanks,
Pedro Alves

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Pedro Alves-7
On 1/15/20 2:55 PM, Pedro Alves wrote:

> On 1/15/20 2:41 PM, Pedro Alves wrote:
>> Don't know what I think of gnulib headers including <config.h>.
>> Maybe we should rename gdb's config.h to gdb-config.h too.
>
> Hit reply to soon.  I meant to add,
>
> ... and then, add a manually-written config.h in the build
> dir that does:
>
>  #include <gdbsupport/support-config.h>
>  #include <gdb-config.h>
>
> We'd do the same to gdbsupport, add a config.h in its
> build dir that does:
>
>  #include "gnulib/config.h"
>  #include <support-config.h>
>
> Those config.h files would go in the build dirs so that
> they're not picked by other build directories.
>
> With that, any "#include <config.h>" in any header ends up
> picking the currently-being-built project's config.h, plus
> the dependencies' config.h files.
>
> Just a half-baked thought.  Not sure it's the best idea.

I tried it and it seems to work OK.  Fixes the build at least.
Still not sure it's the best idea.  WDYT?

The patch is actually quite small, but since I've rename
config.h -> gdb-config.h etc., and _then_ added new config.h
files, git doesn't notice the renames.

I wonder whether there's anything could do to stop gnulib and
gdbsupport's configure from defining PACKAGE_NAME etc. in their
generated config.h files.

From 4a4e9c282747b9ac0b818c81f775be14f138609d Mon Sep 17 00:00:00 2001
From: Pedro Alves <[hidden email]>
Date: Wed, 15 Jan 2020 17:49:01 +0000
Subject: [PATCH] config.h

---
 gdb/Makefile.in                       |   6 +-
 gdb/config.in                         | 812 +---------------------------------
 gdb/configure                         |  10 +-
 gdb/configure.ac                      |   4 +-
 gdb/gdb-config.in                     | 811 +++++++++++++++++++++++++++++++++
 gdb/gdbserver/config.in               | 497 +--------------------
 gdb/gdbserver/configure               |   9 +-
 gdb/gdbserver/configure.ac            |   3 +-
 gdb/gdbserver/gdbserver-config.in     | 496 +++++++++++++++++++++
 gdb/unittests/scoped_fd-selftests.c   |   1 -
 gdb/unittests/scoped_mmap-selftests.c |   1 -
 gdbsupport/common-defs.h              |  24 -
 gdbsupport/config.in                  | 417 +----------------
 gdbsupport/configure                  |  96 ++--
 gdbsupport/configure.ac               |   4 +-
 gdbsupport/support-config.in          | 414 +++++++++++++++++
 16 files changed, 1827 insertions(+), 1778 deletions(-)
 create mode 100644 gdb/gdb-config.in
 create mode 100644 gdb/gdbserver/gdbserver-config.in
 create mode 100644 gdbsupport/support-config.in

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 45d1586e85e..b7e1532c957 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1974,9 +1974,9 @@ gdb-gdb.py: $(srcdir)/gdb-gdb.py.in
 gdb-gdb.gdb: $(srcdir)/gdb-gdb.gdb.in
  $(SHELL) config.status $@
 
-config.h: stamp-h ; @true
-stamp-h: $(srcdir)/config.in config.status
- $(SHELL) config.status config.h
+gdb-config.h: stamp-h ; @true
+stamp-h: $(srcdir)/gdb-config.in config.status
+ $(SHELL) config.status gdb-config.h
 
 nm.h: stamp-nmh ; @true
 stamp-nmh: config.status
diff --git a/gdb/config.in b/gdb/config.in
index cb886ba8e1a..8aad1425690 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -1,811 +1,17 @@
-/* config.in.  Generated from configure.ac by autoheader.  */
+#include "gnulib/config.h"
 
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* Directories from which to load auto-loaded scripts. */
-#undef AUTO_LOAD_DIR
-
-/* Directories safe to hold auto-loaded files. */
-#undef AUTO_LOAD_SAFE_PATH
-
-/* Directory of programs. */
-#undef BINDIR
-
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
-   systems. This function is required for `alloca.c' support on those systems.
-   */
-#undef CRAY_STACKSEG_END
-
-/* Define to 1 if std::thread works. */
-#undef CXX_STD_THREAD
-
-/* Define to 1 if using `alloca.c'. */
-#undef C_ALLOCA
-
-/* look for global separate debug info in this path [LIBDIR/debug] */
-#undef DEBUGDIR
-
-/* Define if the separate-debug-dir directory should be relocated when GDB is
-   moved. */
-#undef DEBUGDIR_RELOCATABLE
-
-/* Define to BFD's default architecture. */
-#undef DEFAULT_BFD_ARCH
-
-/* Define to BFD's default target vector. */
-#undef DEFAULT_BFD_VEC
-
-/* Define to 1 if translation of program messages to the user's native
-   language is requested. */
-#undef ENABLE_NLS
-
-/* The .gdbinit filename. */
-#undef GDBINIT
-
-/* look for global separate data files in this path [DATADIR/gdb] */
-#undef GDB_DATADIR
-
-/* Define if the gdb-datadir directory should be relocated when GDB is moved.
-   */
-#undef GDB_DATADIR_RELOCATABLE
-
-/* Define to be a string naming the default host character set. */
-#undef GDB_DEFAULT_HOST_CHARSET
-
-/* Host double floatformat */
-#undef GDB_HOST_DOUBLE_FORMAT
-
-/* Host float floatformat */
-#undef GDB_HOST_FLOAT_FORMAT
-
-/* Host long double floatformat */
-#undef GDB_HOST_LONG_DOUBLE_FORMAT
-
-/* nativefile */
-#undef GDB_NM_FILE
-
-/* Define to the default OS ABI for this configuration. */
-#undef GDB_OSABI_DEFAULT
-
-/* Define if self-testing features should be enabled */
-#undef GDB_SELF_TEST
-
-/* Define to 1 if you have `alloca', as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
-   */
-#undef HAVE_ALLOCA_H
-
-/* Define to 1 if you have the `btowc' function. */
-#undef HAVE_BTOWC
-
-/* Define to 1 if you have the <cursesX.h> header file. */
-#undef HAVE_CURSESX_H
-
-/* Define to 1 if you have the <curses.h> header file. */
-#undef HAVE_CURSES_H
-
-/* define if the compiler supports basic C++11 syntax */
-#undef HAVE_CXX11
-
-/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
-   you don't. */
-#undef HAVE_DECL_ADDR_NO_RANDOMIZE
-
-/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_ASPRINTF
-
-/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if
-   you don't. */
-#undef HAVE_DECL_BASENAME
-
-/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
-#undef HAVE_DECL_FFS
-
-/* Define to 1 if you have the declaration of `getthrds', and to 0 if you
-   don't. */
-#undef HAVE_DECL_GETTHRDS
-
-/* Define to 1 if you have the declaration of `ptrace', and to 0 if you don't.
-   */
-#undef HAVE_DECL_PTRACE
-
-/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_SNPRINTF
-
-/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
-   */
-#undef HAVE_DECL_STRSTR
-
-/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
-   */
-#undef HAVE_DECL_STRTOL
-
-/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOLL
-
-/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOUL
-
-/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOULL
-
-/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRVERSCMP
-
-/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_VASPRINTF
-
-/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_VSNPRINTF
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define if ELF support should be included. */
-#undef HAVE_ELF
-
-/* Define if <sys/procfs.h> has elf_fpregset_t. */
-#undef HAVE_ELF_FPREGSET_T
-
-/* Define to 1 if you have the <elf_hp.h> header file. */
-#undef HAVE_ELF_HP_H
-
-/* Define to 1 if your system has the etext variable. */
-#undef HAVE_ETEXT
-
-/* Define to 1 if you have the `fdwalk' function. */
-#undef HAVE_FDWALK
-
-/* Define to 1 if you have the `fork' function. */
-#undef HAVE_FORK
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#undef HAVE_FPREGSET_T
-
-/* Define to 1 if you have the `getauxval' function. */
-#undef HAVE_GETAUXVAL
-
-/* Define to 1 if you have the `getgid' function. */
-#undef HAVE_GETGID
-
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define to 1 if you have the `getpgid' function. */
-#undef HAVE_GETPGID
-
-/* Define to 1 if you have the `getrlimit' function. */
-#undef HAVE_GETRLIMIT
-
-/* Define to 1 if you have the `getrusage' function. */
-#undef HAVE_GETRUSAGE
-
-/* Define to 1 if you have the `getuid' function. */
-#undef HAVE_GETUID
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#undef HAVE_GREGSET_T
-
-/* Define if Guile interpreter is being linked in. */
-#undef HAVE_GUILE
-
-/* Define if Guile supports manual finalization. */
-#undef HAVE_GUILE_MANUAL_FINALIZATION
-
-/* Define if you have the iconv() function. */
-#undef HAVE_ICONV
-
-/* Define to 1 if you have the `iconvlist' function. */
-#undef HAVE_ICONVLIST
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if your system has the kinfo_getfile function. */
-#undef HAVE_KINFO_GETFILE
-
-/* Define to 1 if your system has the kinfo_getvmmap function. */
-#undef HAVE_KINFO_GETVMMAP
-
-/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
-#undef HAVE_LANGINFO_CODESET
-
-/* Define if your <locale.h> file defines LC_MESSAGES. */
-#undef HAVE_LC_MESSAGES
-
-/* Define if you have the babeltrace library. */
-#undef HAVE_LIBBABELTRACE
-
-/* Define if you have the expat library. */
-#undef HAVE_LIBEXPAT
-
-/* Define to 1 if you have the `libiconvlist' function. */
-#undef HAVE_LIBICONVLIST
-
-/* Define if you have the ipt library. */
-#undef HAVE_LIBIPT
-
-/* Define if you have the lzma library. */
-#undef HAVE_LIBLZMA
-
-/* Define to 1 if you have the `m' library (-lm). */
-#undef HAVE_LIBM
-
-/* Define if you have the mpfr library. */
-#undef HAVE_LIBMPFR
-
-/* Define to 1 if you have the <libunwind-ia64.h> header file. */
-#undef HAVE_LIBUNWIND_IA64_H
-
-/* Define if you have the xxhash library. */
-#undef HAVE_LIBXXHASH
-
-/* Define to 1 if you have the <linux/elf.h> header file. */
-#undef HAVE_LINUX_ELF_H
-
-/* Define to 1 if you have the <linux/perf_event.h> header file. */
-#undef HAVE_LINUX_PERF_EVENT_H
-
-/* Define to 1 if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
-/* Define to 1 if the compiler supports long double. */
-#undef HAVE_LONG_DOUBLE
-
-/* Define to 1 if the system has the type `long long'. */
-#undef HAVE_LONG_LONG
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#undef HAVE_LWPID_T
-
-/* Define to 1 if you have the <machine/reg.h> header file. */
-#undef HAVE_MACHINE_REG_H
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define to 1 if you have the `monstartup' function. */
-#undef HAVE_MONSTARTUP
-
-/* Define to 1 if you have the <ncursesw/ncurses.h> header file. */
-#undef HAVE_NCURSESW_NCURSES_H
-
-/* Define to 1 if you have the <ncurses.h> header file. */
-#undef HAVE_NCURSES_H
-
-/* Define to 1 if you have the <ncurses/ncurses.h> header file. */
-#undef HAVE_NCURSES_NCURSES_H
-
-/* Define to 1 if you have the <ncurses/term.h> header file. */
-#undef HAVE_NCURSES_TERM_H
-
-/* Define to 1 if you have the <nlist.h> header file. */
-#undef HAVE_NLIST_H
-
-/* Define if you support the personality syscall. */
-#undef HAVE_PERSONALITY
-
-/* Define to 1 if you have the `pipe' function. */
-#undef HAVE_PIPE
-
-/* Define to 1 if you have the `pipe2' function. */
-#undef HAVE_PIPE2
-
-/* Define to 1 if you have the `poll' function. */
-#undef HAVE_POLL
-
-/* Define to 1 if you have the <poll.h> header file. */
-#undef HAVE_POLL_H
-
-/* Define to 1 if you have the `posix_madvise' function. */
-#undef HAVE_POSIX_MADVISE
-
-/* Define to 1 if you have the `pread' function. */
-#undef HAVE_PREAD
-
-/* Define to 1 if you have the `pread64' function. */
-#undef HAVE_PREAD64
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#undef HAVE_PRFPREGSET_T
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-#undef HAVE_PRGREGSET32_T
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#undef HAVE_PRGREGSET_T
-
-/* Define to 1 if you have the <proc_service.h> header file. */
-#undef HAVE_PROC_SERVICE_H
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#undef HAVE_PSADDR_T
-
-/* Have PTHREAD_PRIO_INHERIT. */
-#undef HAVE_PTHREAD_PRIO_INHERIT
-
-/* Define to 1 if you have the `pthread_setname_np' function. */
-#undef HAVE_PTHREAD_SETNAME_NP
-
-/* Define to 1 if you have the `pthread_sigmask' function. */
-#undef HAVE_PTHREAD_SIGMASK
-
-/* Define to 1 if you have the `ptrace64' function. */
-#undef HAVE_PTRACE64
-
-/* Define if sys/ptrace.h defines the PTRACE_GETFPXREGS request. */
-#undef HAVE_PTRACE_GETFPXREGS
-
-/* Define if sys/ptrace.h defines the PTRACE_GETREGS request. */
-#undef HAVE_PTRACE_GETREGS
-
-/* Define to 1 if you have the <ptrace.h> header file. */
-#undef HAVE_PTRACE_H
-
-/* Define if sys/ptrace.h defines the PT_GETDBREGS request. */
-#undef HAVE_PT_GETDBREGS
-
-/* Define if sys/ptrace.h defines the PT_GETXMMREGS request. */
-#undef HAVE_PT_GETXMMREGS
-
-/* Define to 1 if you have the `pt_insn_event' function. */
-#undef HAVE_PT_INSN_EVENT
-
-/* Define to 1 if you have the `pwrite' function. */
-#undef HAVE_PWRITE
-
-/* Define if Python interpreter is being linked in. */
-#undef HAVE_PYTHON
-
-/* Define to 1 if you have the `resize_term' function. */
-#undef HAVE_RESIZE_TERM
-
-/* Define to 1 if you have the `sbrk' function. */
-#undef HAVE_SBRK
-
-/* Define to 1 if you have the `scm_new_smob' function. */
-#undef HAVE_SCM_NEW_SMOB
-
-/* Define to 1 if you have the `setlocale' function. */
-#undef HAVE_SETLOCALE
-
-/* Define to 1 if you have the `setns' function. */
-#undef HAVE_SETNS
-
-/* Define to 1 if you have the `setpgid' function. */
-#undef HAVE_SETPGID
-
-/* Define to 1 if you have the `setpgrp' function. */
-#undef HAVE_SETPGRP
-
-/* Define to 1 if you have the `setrlimit' function. */
-#undef HAVE_SETRLIMIT
-
-/* Define to 1 if you have the `setsid' function. */
-#undef HAVE_SETSID
-
-/* Define to 1 if you have the `sigaction' function. */
-#undef HAVE_SIGACTION
-
-/* Define to 1 if you have the `sigaltstack' function. */
-#undef HAVE_SIGALTSTACK
-
-/* Define to 1 if you have the <signal.h> header file. */
-#undef HAVE_SIGNAL_H
-
-/* Define to 1 if you have the `sigprocmask' function. */
-#undef HAVE_SIGPROCMASK
-
-/* Define if sigsetjmp is available. */
-#undef HAVE_SIGSETJMP
-
-/* Define to 1 if you have the `sigsetmask' function. */
-#undef HAVE_SIGSETMASK
-
-/* Define to 1 if you have the `socketpair' function. */
-#undef HAVE_SOCKETPAIR
-
-/* Define to 1 if the system has the type `socklen_t'. */
-#undef HAVE_SOCKLEN_T
-
-/* Define to 1 if the source-highlight library is available */
-#undef HAVE_SOURCE_HIGHLIGHT
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if your system has struct lwp. */
-#undef HAVE_STRUCT_LWP
-
-/* Define to 1 if `pl_syscall_code' is a member of `struct ptrace_lwpinfo'. */
-#undef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
-
-/* Define to 1 if `pl_tdname' is a member of `struct ptrace_lwpinfo'. */
-#undef HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME
-
-/* Define to 1 if `enabled' is a member of `struct pt_insn'. */
-#undef HAVE_STRUCT_PT_INSN_ENABLED
-
-/* Define to 1 if `resynced' is a member of `struct pt_insn'. */
-#undef HAVE_STRUCT_PT_INSN_RESYNCED
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#undef HAVE_STRUCT_REG
-
-/* Define to 1 if `r_fs' is a member of `struct reg'. */
-#undef HAVE_STRUCT_REG_R_FS
-
-/* Define to 1 if `r_gs' is a member of `struct reg'. */
-#undef HAVE_STRUCT_REG_R_GS
-
-/* Define to 1 if `st_blksize' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BLKSIZE
-
-/* Define to 1 if `st_blocks' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BLOCKS
-
-/* Define to 1 if `td_pcb' is a member of `struct thread'. */
-#undef HAVE_STRUCT_THREAD_TD_PCB
-
-/* Define to 1 if `fs_base' is a member of `struct user_regs_struct'. */
-#undef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
-
-/* Define to 1 if `gs_base' is a member of `struct user_regs_struct'. */
-#undef HAVE_STRUCT_USER_REGS_STRUCT_GS_BASE
-
-/* Define to 1 if you have the <sys/debugreg.h> header file. */
-#undef HAVE_SYS_DEBUGREG_H
-
-/* Define to 1 if you have the <sys/file.h> header file. */
-#undef HAVE_SYS_FILE_H
-
-/* Define to 1 if you have the <sys/filio.h> header file. */
-#undef HAVE_SYS_FILIO_H
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/poll.h> header file. */
-#undef HAVE_SYS_POLL_H
-
-/* Define to 1 if you have the <sys/procfs.h> header file. */
-#undef HAVE_SYS_PROCFS_H
-
-/* Define to 1 if you have the <sys/ptrace.h> header file. */
-#undef HAVE_SYS_PTRACE_H
-
-/* Define to 1 if you have the <sys/reg.h> header file. */
-#undef HAVE_SYS_REG_H
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#undef HAVE_SYS_RESOURCE_H
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#undef HAVE_SYS_SELECT_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/un.h> header file. */
-#undef HAVE_SYS_UN_H
-
-/* Define to 1 if you have the <sys/user.h> header file. */
-#undef HAVE_SYS_USER_H
-
-/* Define to 1 if you have the <sys/wait.h> header file. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define to 1 if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
-
-/* Define to 1 if you have the <term.h> header file. */
-#undef HAVE_TERM_H
-
-/* Define to 1 if you have the <thread_db.h> header file. */
-#undef HAVE_THREAD_DB_H
-
-/* Define to 1 if you have the `ttrace' function. */
-#undef HAVE_TTRACE
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the `use_default_colors' function. */
-#undef HAVE_USE_DEFAULT_COLORS
-
-/* Define to 1 if you have the `vfork' function. */
-#undef HAVE_VFORK
-
-/* Define to 1 if you have the <vfork.h> header file. */
-#undef HAVE_VFORK_H
-
-/* Define to 1 if you have the `waitpid' function. */
-#undef HAVE_WAITPID
-
-/* Define to 1 if you have the <wait.h> header file. */
-#undef HAVE_WAIT_H
-
-/* Define to 1 if you have the `wborder' function. */
-#undef HAVE_WBORDER
-
-/* Define to 1 if you have the <windows.h> header file. */
-#undef HAVE_WINDOWS_H
-
-/* Define to 1 if `fork' works. */
-#undef HAVE_WORKING_FORK
-
-/* Define to 1 if `vfork' works. */
-#undef HAVE_WORKING_VFORK
-
-/* Define to 1 if you have the `wresize' function. */
-#undef HAVE_WRESIZE
-
-/* Define to 1 if you have the `XML_StopParser' function. */
-#undef HAVE_XML_STOPPARSER
-
-/* Define to 1 if your system has the _etext variable. */
-#undef HAVE__ETEXT
-
-/* Define to 1 if you have the `_mcleanup' function. */
-#undef HAVE__MCLEANUP
-
-/* Path of directory of iconv program. */
-#undef ICONV_BIN
-
-/* Define if the iconv directory should be relocated when GDB is moved. */
-#undef ICONV_BIN_RELOCATABLE
-
-/* Define as const if the declaration of iconv() needs const. */
-#undef ICONV_CONST
-
-/* directory to load the JIT readers from */
-#undef JIT_READER_DIR
-
-/* Define if the jit-reader-dir directory should be relocated when GDB is
-   moved. */
-#undef JIT_READER_DIR_RELOCATABLE
-
-/* Name of this package. */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
 #undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
+#undef PACKAGE
+#undef PACKAGE_VERSION
 #undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
+#include <gdbsupport/support-config.h>
 
-/* Define to the version of this package. */
+#undef PACKAGE_NAME
+#undef PACKAGE
 #undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
 
-/* Additional package description */
-#undef PKGVERSION
-
-/* Define to 1 if the "%H, %D and %DD" formats work to print decfloats. */
-#undef PRINTF_HAS_DECFLOAT
-
-/* Define to 1 if the "%Lg" format works to print long doubles. */
-#undef PRINTF_HAS_LONG_DOUBLE
-
-/* Define to 1 if the "%ll" format works to print long longs. */
-#undef PRINTF_HAS_LONG_LONG
-
-/* Define to necessary symbol if this constant uses a non-standard name on
-   your system. */
-#undef PTHREAD_CREATE_JOINABLE
-
-/* Define to the type of arg 1 for ptrace. */
-#undef PTRACE_TYPE_ARG1
-
-/* Define to the type of arg 3 for ptrace. */
-#undef PTRACE_TYPE_ARG3
-
-/* Define to the type of arg 4 for ptrace. */
-#undef PTRACE_TYPE_ARG4
-
-/* Define to the type of arg 5 for ptrace. */
-#undef PTRACE_TYPE_ARG5
-
-/* Define as the return type of ptrace. */
-#undef PTRACE_TYPE_RET
-
-/* Define if the python directory should be relocated when GDB is moved. */
-#undef PYTHON_PATH_RELOCATABLE
-
-/* Relocated directory for source files. */
-#undef RELOC_SRCDIR
-
-/* Bug reporting address */
-#undef REPORT_BUGS_TO
-
-/* Define to 1 if the "%Lg" format works to scan long doubles. */
-#undef SCANF_HAS_LONG_DOUBLE
-
-/* Define to 1 if the `setpgrp' function takes no argument. */
-#undef SETPGRP_VOID
-
-/* The size of `long', as computed by sizeof. */
-#undef SIZEOF_LONG
-
-/* The size of `long long', as computed by sizeof. */
-#undef SIZEOF_LONG_LONG
-
-/* The size of `unsigned long', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_LONG
-
-/* The size of `unsigned long long', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_LONG_LONG
-
-/* The size of `unsigned __int128', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED___INT128
-
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at runtime.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-#undef STACK_DIRECTION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* automatically load a system-wide gdbinit file */
-#undef SYSTEM_GDBINIT
-
-/* automatically load system-wide gdbinit files from this directory */
-#undef SYSTEM_GDBINIT_DIR
-
-/* Define if the system-gdbinit-dir directory should be relocated when GDB is
-   moved. */
-#undef SYSTEM_GDBINIT_DIR_RELOCATABLE
-
-/* Define if the system-gdbinit directory should be relocated when GDB is
-   moved. */
-#undef SYSTEM_GDBINIT_RELOCATABLE
-
-/* search for usr/lib et al within DIR */
-#undef TARGET_SYSTEM_ROOT
-
-/* Define if the sysroot directory should be relocated when GDB is moved. */
-#undef TARGET_SYSTEM_ROOT_RELOCATABLE
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-#undef THREAD_DB_HAS_TD_NOTALLOC
-
-/* Define if <thread_db.h> has the TD_NOTLS error code. */
-#undef THREAD_DB_HAS_TD_NOTLS
-
-/* Define if <thread_db.h> has the TD_VERSION error code. */
-#undef THREAD_DB_HAS_TD_VERSION
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#undef USE_INCLUDED_REGEX
-
-/* Enable extensions on AIX 3, Interix.  */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them.  */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris.  */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop.  */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
-/* Define if we should use the Windows API, instead of the POSIX API. On
-   Windows, we use the Windows API when building for MinGW, but the POSIX API
-   when building for Cygwin. */
-#undef USE_WIN32API
-
-/* Define if the PPC simulator is being linked in. */
-#undef WITH_PPC_SIM
-
-/* Define if --with-python provides a path, either directly or via
-   python-config.py --exec-prefix. */
-#undef WITH_PYTHON_PATH
-
-/* Define if the simulator is being linked in. */
-#undef WITH_SIM
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-#  undef WORDS_BIGENDIAN
-# endif
-#endif
-
-/* Enable large inode numbers on Mac OS X 10.5.  */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
-   this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
-   calls it, or to nothing if 'inline' is not supported under any name.  */
-#ifndef __cplusplus
-#undef inline
-#endif
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
-
-/* Define as `fork' if `vfork' does not work. */
-#undef vfork
+#include "gdb-config.h"
diff --git a/gdb/configure b/gdb/configure
index 72ffad8d37b..b3e072314f6 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -2945,7 +2945,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_headers="$ac_config_headers config.h:config.in"
+ac_config_headers="$ac_config_headers gdb-config.h:gdb-config.in"
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
@@ -9140,6 +9140,9 @@ fi
 ac_config_files="$ac_config_files jit-reader.h:jit-reader.in"
 
 
+ac_config_files="$ac_config_files config.h:config.in"
+
+
 { $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 :
@@ -19729,9 +19732,10 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
-    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
+    "gdb-config.h") CONFIG_HEADERS="$CONFIG_HEADERS gdb-config.h:gdb-config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "jit-reader.h") CONFIG_FILES="$CONFIG_FILES jit-reader.h:jit-reader.in" ;;
+    "config.h") CONFIG_FILES="$CONFIG_FILES config.h:config.in" ;;
     "nm.h") CONFIG_LINKS="$CONFIG_LINKS nm.h:$GDB_NM_FILE" ;;
     "gcore") CONFIG_FILES="$CONFIG_FILES gcore" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
@@ -20365,7 +20369,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
 
   case $ac_file$ac_mode in
-    "config.h":H) echo > stamp-h ;;
+    "gdb-config.h":H) echo > stamp-h ;;
     "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;;
     "nm.h":L) echo > stamp-nmh ;;
     "gcore":F) chmod +x gcore ;;
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 0ca169101b3..e1bf6851bf6 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -19,7 +19,7 @@ dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
 dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT(main.c)
-AC_CONFIG_HEADERS(config.h:config.in, [echo > stamp-h])
+AC_CONFIG_HEADERS(gdb-config.h:gdb-config.in, [echo > stamp-h])
 AM_MAINTAINER_MODE
 
 # Set the 'development' global.
@@ -623,6 +623,8 @@ fi
 AC_SUBST(TARGET_PTR)
 AC_CONFIG_FILES([jit-reader.h:jit-reader.in])
 
+AC_CONFIG_FILES([config.h:config.in])
+
 AC_SEARCH_LIBS(dlopen, dl)
 
 GDB_AC_WITH_DIR([JIT_READER_DIR], [jit-reader-dir],
diff --git a/gdb/gdb-config.in b/gdb/gdb-config.in
new file mode 100644
index 00000000000..cb886ba8e1a
--- /dev/null
+++ b/gdb/gdb-config.in
@@ -0,0 +1,811 @@
+/* config.in.  Generated from configure.ac by autoheader.  */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Directories from which to load auto-loaded scripts. */
+#undef AUTO_LOAD_DIR
+
+/* Directories safe to hold auto-loaded files. */
+#undef AUTO_LOAD_SAFE_PATH
+
+/* Directory of programs. */
+#undef BINDIR
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if std::thread works. */
+#undef CXX_STD_THREAD
+
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* look for global separate debug info in this path [LIBDIR/debug] */
+#undef DEBUGDIR
+
+/* Define if the separate-debug-dir directory should be relocated when GDB is
+   moved. */
+#undef DEBUGDIR_RELOCATABLE
+
+/* Define to BFD's default architecture. */
+#undef DEFAULT_BFD_ARCH
+
+/* Define to BFD's default target vector. */
+#undef DEFAULT_BFD_VEC
+
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
+#undef ENABLE_NLS
+
+/* The .gdbinit filename. */
+#undef GDBINIT
+
+/* look for global separate data files in this path [DATADIR/gdb] */
+#undef GDB_DATADIR
+
+/* Define if the gdb-datadir directory should be relocated when GDB is moved.
+   */
+#undef GDB_DATADIR_RELOCATABLE
+
+/* Define to be a string naming the default host character set. */
+#undef GDB_DEFAULT_HOST_CHARSET
+
+/* Host double floatformat */
+#undef GDB_HOST_DOUBLE_FORMAT
+
+/* Host float floatformat */
+#undef GDB_HOST_FLOAT_FORMAT
+
+/* Host long double floatformat */
+#undef GDB_HOST_LONG_DOUBLE_FORMAT
+
+/* nativefile */
+#undef GDB_NM_FILE
+
+/* Define to the default OS ABI for this configuration. */
+#undef GDB_OSABI_DEFAULT
+
+/* Define if self-testing features should be enabled */
+#undef GDB_SELF_TEST
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+   */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if you have the `btowc' function. */
+#undef HAVE_BTOWC
+
+/* Define to 1 if you have the <cursesX.h> header file. */
+#undef HAVE_CURSESX_H
+
+/* Define to 1 if you have the <curses.h> header file. */
+#undef HAVE_CURSES_H
+
+/* define if the compiler supports basic C++11 syntax */
+#undef HAVE_CXX11
+
+/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
+   you don't. */
+#undef HAVE_DECL_ADDR_NO_RANDOMIZE
+
+/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_ASPRINTF
+
+/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if
+   you don't. */
+#undef HAVE_DECL_BASENAME
+
+/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
+#undef HAVE_DECL_FFS
+
+/* Define to 1 if you have the declaration of `getthrds', and to 0 if you
+   don't. */
+#undef HAVE_DECL_GETTHRDS
+
+/* Define to 1 if you have the declaration of `ptrace', and to 0 if you don't.
+   */
+#undef HAVE_DECL_PTRACE
+
+/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_SNPRINTF
+
+/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
+   */
+#undef HAVE_DECL_STRSTR
+
+/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
+   */
+#undef HAVE_DECL_STRTOL
+
+/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOLL
+
+/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOUL
+
+/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOULL
+
+/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRVERSCMP
+
+/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_VASPRINTF
+
+/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_VSNPRINTF
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define if ELF support should be included. */
+#undef HAVE_ELF
+
+/* Define if <sys/procfs.h> has elf_fpregset_t. */
+#undef HAVE_ELF_FPREGSET_T
+
+/* Define to 1 if you have the <elf_hp.h> header file. */
+#undef HAVE_ELF_HP_H
+
+/* Define to 1 if your system has the etext variable. */
+#undef HAVE_ETEXT
+
+/* Define to 1 if you have the `fdwalk' function. */
+#undef HAVE_FDWALK
+
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define if <sys/procfs.h> has fpregset_t. */
+#undef HAVE_FPREGSET_T
+
+/* Define to 1 if you have the `getauxval' function. */
+#undef HAVE_GETAUXVAL
+
+/* Define to 1 if you have the `getgid' function. */
+#undef HAVE_GETGID
+
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define to 1 if you have the `getpgid' function. */
+#undef HAVE_GETPGID
+
+/* Define to 1 if you have the `getrlimit' function. */
+#undef HAVE_GETRLIMIT
+
+/* Define to 1 if you have the `getrusage' function. */
+#undef HAVE_GETRUSAGE
+
+/* Define to 1 if you have the `getuid' function. */
+#undef HAVE_GETUID
+
+/* Define if <sys/procfs.h> has gregset_t. */
+#undef HAVE_GREGSET_T
+
+/* Define if Guile interpreter is being linked in. */
+#undef HAVE_GUILE
+
+/* Define if Guile supports manual finalization. */
+#undef HAVE_GUILE_MANUAL_FINALIZATION
+
+/* Define if you have the iconv() function. */
+#undef HAVE_ICONV
+
+/* Define to 1 if you have the `iconvlist' function. */
+#undef HAVE_ICONVLIST
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if your system has the kinfo_getfile function. */
+#undef HAVE_KINFO_GETFILE
+
+/* Define to 1 if your system has the kinfo_getvmmap function. */
+#undef HAVE_KINFO_GETVMMAP
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
+
+/* Define if you have the babeltrace library. */
+#undef HAVE_LIBBABELTRACE
+
+/* Define if you have the expat library. */
+#undef HAVE_LIBEXPAT
+
+/* Define to 1 if you have the `libiconvlist' function. */
+#undef HAVE_LIBICONVLIST
+
+/* Define if you have the ipt library. */
+#undef HAVE_LIBIPT
+
+/* Define if you have the lzma library. */
+#undef HAVE_LIBLZMA
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define if you have the mpfr library. */
+#undef HAVE_LIBMPFR
+
+/* Define to 1 if you have the <libunwind-ia64.h> header file. */
+#undef HAVE_LIBUNWIND_IA64_H
+
+/* Define if you have the xxhash library. */
+#undef HAVE_LIBXXHASH
+
+/* Define to 1 if you have the <linux/elf.h> header file. */
+#undef HAVE_LINUX_ELF_H
+
+/* Define to 1 if you have the <linux/perf_event.h> header file. */
+#undef HAVE_LINUX_PERF_EVENT_H
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if the compiler supports long double. */
+#undef HAVE_LONG_DOUBLE
+
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
+/* Define if <sys/procfs.h> has lwpid_t. */
+#undef HAVE_LWPID_T
+
+/* Define to 1 if you have the <machine/reg.h> header file. */
+#undef HAVE_MACHINE_REG_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the `monstartup' function. */
+#undef HAVE_MONSTARTUP
+
+/* Define to 1 if you have the <ncursesw/ncurses.h> header file. */
+#undef HAVE_NCURSESW_NCURSES_H
+
+/* Define to 1 if you have the <ncurses.h> header file. */
+#undef HAVE_NCURSES_H
+
+/* Define to 1 if you have the <ncurses/ncurses.h> header file. */
+#undef HAVE_NCURSES_NCURSES_H
+
+/* Define to 1 if you have the <ncurses/term.h> header file. */
+#undef HAVE_NCURSES_TERM_H
+
+/* Define to 1 if you have the <nlist.h> header file. */
+#undef HAVE_NLIST_H
+
+/* Define if you support the personality syscall. */
+#undef HAVE_PERSONALITY
+
+/* Define to 1 if you have the `pipe' function. */
+#undef HAVE_PIPE
+
+/* Define to 1 if you have the `pipe2' function. */
+#undef HAVE_PIPE2
+
+/* Define to 1 if you have the `poll' function. */
+#undef HAVE_POLL
+
+/* Define to 1 if you have the <poll.h> header file. */
+#undef HAVE_POLL_H
+
+/* Define to 1 if you have the `posix_madvise' function. */
+#undef HAVE_POSIX_MADVISE
+
+/* Define to 1 if you have the `pread' function. */
+#undef HAVE_PREAD
+
+/* Define to 1 if you have the `pread64' function. */
+#undef HAVE_PREAD64
+
+/* Define if <sys/procfs.h> has prfpregset_t. */
+#undef HAVE_PRFPREGSET_T
+
+/* Define if <sys/procfs.h> has prgregset32_t. */
+#undef HAVE_PRGREGSET32_T
+
+/* Define if <sys/procfs.h> has prgregset_t. */
+#undef HAVE_PRGREGSET_T
+
+/* Define to 1 if you have the <proc_service.h> header file. */
+#undef HAVE_PROC_SERVICE_H
+
+/* Define if <sys/procfs.h> has psaddr_t. */
+#undef HAVE_PSADDR_T
+
+/* Have PTHREAD_PRIO_INHERIT. */
+#undef HAVE_PTHREAD_PRIO_INHERIT
+
+/* Define to 1 if you have the `pthread_setname_np' function. */
+#undef HAVE_PTHREAD_SETNAME_NP
+
+/* Define to 1 if you have the `pthread_sigmask' function. */
+#undef HAVE_PTHREAD_SIGMASK
+
+/* Define to 1 if you have the `ptrace64' function. */
+#undef HAVE_PTRACE64
+
+/* Define if sys/ptrace.h defines the PTRACE_GETFPXREGS request. */
+#undef HAVE_PTRACE_GETFPXREGS
+
+/* Define if sys/ptrace.h defines the PTRACE_GETREGS request. */
+#undef HAVE_PTRACE_GETREGS
+
+/* Define to 1 if you have the <ptrace.h> header file. */
+#undef HAVE_PTRACE_H
+
+/* Define if sys/ptrace.h defines the PT_GETDBREGS request. */
+#undef HAVE_PT_GETDBREGS
+
+/* Define if sys/ptrace.h defines the PT_GETXMMREGS request. */
+#undef HAVE_PT_GETXMMREGS
+
+/* Define to 1 if you have the `pt_insn_event' function. */
+#undef HAVE_PT_INSN_EVENT
+
+/* Define to 1 if you have the `pwrite' function. */
+#undef HAVE_PWRITE
+
+/* Define if Python interpreter is being linked in. */
+#undef HAVE_PYTHON
+
+/* Define to 1 if you have the `resize_term' function. */
+#undef HAVE_RESIZE_TERM
+
+/* Define to 1 if you have the `sbrk' function. */
+#undef HAVE_SBRK
+
+/* Define to 1 if you have the `scm_new_smob' function. */
+#undef HAVE_SCM_NEW_SMOB
+
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
+/* Define to 1 if you have the `setns' function. */
+#undef HAVE_SETNS
+
+/* Define to 1 if you have the `setpgid' function. */
+#undef HAVE_SETPGID
+
+/* Define to 1 if you have the `setpgrp' function. */
+#undef HAVE_SETPGRP
+
+/* Define to 1 if you have the `setrlimit' function. */
+#undef HAVE_SETRLIMIT
+
+/* Define to 1 if you have the `setsid' function. */
+#undef HAVE_SETSID
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Define to 1 if you have the `sigaltstack' function. */
+#undef HAVE_SIGALTSTACK
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Define to 1 if you have the `sigprocmask' function. */
+#undef HAVE_SIGPROCMASK
+
+/* Define if sigsetjmp is available. */
+#undef HAVE_SIGSETJMP
+
+/* Define to 1 if you have the `sigsetmask' function. */
+#undef HAVE_SIGSETMASK
+
+/* Define to 1 if you have the `socketpair' function. */
+#undef HAVE_SOCKETPAIR
+
+/* Define to 1 if the system has the type `socklen_t'. */
+#undef HAVE_SOCKLEN_T
+
+/* Define to 1 if the source-highlight library is available */
+#undef HAVE_SOURCE_HIGHLIGHT
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if your system has struct lwp. */
+#undef HAVE_STRUCT_LWP
+
+/* Define to 1 if `pl_syscall_code' is a member of `struct ptrace_lwpinfo'. */
+#undef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
+
+/* Define to 1 if `pl_tdname' is a member of `struct ptrace_lwpinfo'. */
+#undef HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME
+
+/* Define to 1 if `enabled' is a member of `struct pt_insn'. */
+#undef HAVE_STRUCT_PT_INSN_ENABLED
+
+/* Define to 1 if `resynced' is a member of `struct pt_insn'. */
+#undef HAVE_STRUCT_PT_INSN_RESYNCED
+
+/* Define to 1 if your system has struct reg in <machine/reg.h>. */
+#undef HAVE_STRUCT_REG
+
+/* Define to 1 if `r_fs' is a member of `struct reg'. */
+#undef HAVE_STRUCT_REG_R_FS
+
+/* Define to 1 if `r_gs' is a member of `struct reg'. */
+#undef HAVE_STRUCT_REG_R_GS
+
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if `st_blocks' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLOCKS
+
+/* Define to 1 if `td_pcb' is a member of `struct thread'. */
+#undef HAVE_STRUCT_THREAD_TD_PCB
+
+/* Define to 1 if `fs_base' is a member of `struct user_regs_struct'. */
+#undef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
+
+/* Define to 1 if `gs_base' is a member of `struct user_regs_struct'. */
+#undef HAVE_STRUCT_USER_REGS_STRUCT_GS_BASE
+
+/* Define to 1 if you have the <sys/debugreg.h> header file. */
+#undef HAVE_SYS_DEBUGREG_H
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define to 1 if you have the <sys/filio.h> header file. */
+#undef HAVE_SYS_FILIO_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#undef HAVE_SYS_POLL_H
+
+/* Define to 1 if you have the <sys/procfs.h> header file. */
+#undef HAVE_SYS_PROCFS_H
+
+/* Define to 1 if you have the <sys/ptrace.h> header file. */
+#undef HAVE_SYS_PTRACE_H
+
+/* Define to 1 if you have the <sys/reg.h> header file. */
+#undef HAVE_SYS_REG_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#undef HAVE_SYS_UN_H
+
+/* Define to 1 if you have the <sys/user.h> header file. */
+#undef HAVE_SYS_USER_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define to 1 if you have the <term.h> header file. */
+#undef HAVE_TERM_H
+
+/* Define to 1 if you have the <thread_db.h> header file. */
+#undef HAVE_THREAD_DB_H
+
+/* Define to 1 if you have the `ttrace' function. */
+#undef HAVE_TTRACE
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `use_default_colors' function. */
+#undef HAVE_USE_DEFAULT_COLORS
+
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
+
+/* Define to 1 if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
+
+/* Define to 1 if you have the `waitpid' function. */
+#undef HAVE_WAITPID
+
+/* Define to 1 if you have the <wait.h> header file. */
+#undef HAVE_WAIT_H
+
+/* Define to 1 if you have the `wborder' function. */
+#undef HAVE_WBORDER
+
+/* Define to 1 if you have the <windows.h> header file. */
+#undef HAVE_WINDOWS_H
+
+/* Define to 1 if `fork' works. */
+#undef HAVE_WORKING_FORK
+
+/* Define to 1 if `vfork' works. */
+#undef HAVE_WORKING_VFORK
+
+/* Define to 1 if you have the `wresize' function. */
+#undef HAVE_WRESIZE
+
+/* Define to 1 if you have the `XML_StopParser' function. */
+#undef HAVE_XML_STOPPARSER
+
+/* Define to 1 if your system has the _etext variable. */
+#undef HAVE__ETEXT
+
+/* Define to 1 if you have the `_mcleanup' function. */
+#undef HAVE__MCLEANUP
+
+/* Path of directory of iconv program. */
+#undef ICONV_BIN
+
+/* Define if the iconv directory should be relocated when GDB is moved. */
+#undef ICONV_BIN_RELOCATABLE
+
+/* Define as const if the declaration of iconv() needs const. */
+#undef ICONV_CONST
+
+/* directory to load the JIT readers from */
+#undef JIT_READER_DIR
+
+/* Define if the jit-reader-dir directory should be relocated when GDB is
+   moved. */
+#undef JIT_READER_DIR_RELOCATABLE
+
+/* Name of this package. */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Additional package description */
+#undef PKGVERSION
+
+/* Define to 1 if the "%H, %D and %DD" formats work to print decfloats. */
+#undef PRINTF_HAS_DECFLOAT
+
+/* Define to 1 if the "%Lg" format works to print long doubles. */
+#undef PRINTF_HAS_LONG_DOUBLE
+
+/* Define to 1 if the "%ll" format works to print long longs. */
+#undef PRINTF_HAS_LONG_LONG
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+   your system. */
+#undef PTHREAD_CREATE_JOINABLE
+
+/* Define to the type of arg 1 for ptrace. */
+#undef PTRACE_TYPE_ARG1
+
+/* Define to the type of arg 3 for ptrace. */
+#undef PTRACE_TYPE_ARG3
+
+/* Define to the type of arg 4 for ptrace. */
+#undef PTRACE_TYPE_ARG4
+
+/* Define to the type of arg 5 for ptrace. */
+#undef PTRACE_TYPE_ARG5
+
+/* Define as the return type of ptrace. */
+#undef PTRACE_TYPE_RET
+
+/* Define if the python directory should be relocated when GDB is moved. */
+#undef PYTHON_PATH_RELOCATABLE
+
+/* Relocated directory for source files. */
+#undef RELOC_SRCDIR
+
+/* Bug reporting address */
+#undef REPORT_BUGS_TO
+
+/* Define to 1 if the "%Lg" format works to scan long doubles. */
+#undef SCANF_HAS_LONG_DOUBLE
+
+/* Define to 1 if the `setpgrp' function takes no argument. */
+#undef SETPGRP_VOID
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* The size of `unsigned long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG
+
+/* The size of `unsigned long long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG_LONG
+
+/* The size of `unsigned __int128', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED___INT128
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* automatically load a system-wide gdbinit file */
+#undef SYSTEM_GDBINIT
+
+/* automatically load system-wide gdbinit files from this directory */
+#undef SYSTEM_GDBINIT_DIR
+
+/* Define if the system-gdbinit-dir directory should be relocated when GDB is
+   moved. */
+#undef SYSTEM_GDBINIT_DIR_RELOCATABLE
+
+/* Define if the system-gdbinit directory should be relocated when GDB is
+   moved. */
+#undef SYSTEM_GDBINIT_RELOCATABLE
+
+/* search for usr/lib et al within DIR */
+#undef TARGET_SYSTEM_ROOT
+
+/* Define if the sysroot directory should be relocated when GDB is moved. */
+#undef TARGET_SYSTEM_ROOT_RELOCATABLE
+
+/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
+#undef THREAD_DB_HAS_TD_NOTALLOC
+
+/* Define if <thread_db.h> has the TD_NOTLS error code. */
+#undef THREAD_DB_HAS_TD_NOTLS
+
+/* Define if <thread_db.h> has the TD_VERSION error code. */
+#undef THREAD_DB_HAS_TD_VERSION
+
+/* Define to 1 if the regex included in libiberty should be used. */
+#undef USE_INCLUDED_REGEX
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define if we should use the Windows API, instead of the POSIX API. On
+   Windows, we use the Windows API when building for MinGW, but the POSIX API
+   when building for Cygwin. */
+#undef USE_WIN32API
+
+/* Define if the PPC simulator is being linked in. */
+#undef WITH_PPC_SIM
+
+/* Define if --with-python provides a path, either directly or via
+   python-config.py --exec-prefix. */
+#undef WITH_PYTHON_PATH
+
+/* Define if the simulator is being linked in. */
+#undef WITH_SIM
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+#  undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define as `fork' if `vfork' does not work. */
+#undef vfork
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index da8c313c360..b28c4c71ee1 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -1,496 +1,17 @@
-/* config.in.  Generated from configure.ac by autoheader.  */
+#include <build-gnulib-gdbserver/config.h>
 
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
-   systems. This function is required for `alloca.c' support on those systems.
-   */
-#undef CRAY_STACKSEG_END
-
-/* Define to 1 if std::thread works. */
-#undef CXX_STD_THREAD
-
-/* Define to 1 if using `alloca.c'. */
-#undef C_ALLOCA
-
-/* Define if self-testing features should be enabled */
-#undef GDB_SELF_TEST
-
-/* Define to 1 if you have `alloca', as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
-   */
-#undef HAVE_ALLOCA_H
-
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#undef HAVE_ARPA_INET_H
-
-/* define if the compiler supports basic C++11 syntax */
-#undef HAVE_CXX11
-
-/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
-   you don't. */
-#undef HAVE_DECL_ADDR_NO_RANDOMIZE
-
-/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_ASPRINTF
-
-/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if
-   you don't. */
-#undef HAVE_DECL_BASENAME
-
-/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
-#undef HAVE_DECL_FFS
-
-/* Define to 1 if you have the declaration of `perror', and to 0 if you don't.
-   */
-#undef HAVE_DECL_PERROR
-
-/* Define to 1 if you have the declaration of `ptrace', and to 0 if you don't.
-   */
-#undef HAVE_DECL_PTRACE
-
-/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_SNPRINTF
-
-/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
-   */
-#undef HAVE_DECL_STRSTR
-
-/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
-   */
-#undef HAVE_DECL_STRTOL
-
-/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOLL
-
-/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOUL
-
-/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOULL
-
-/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRVERSCMP
-
-/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_VASPRINTF
-
-/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_VSNPRINTF
-
-/* Define to 1 if you have the `dladdr' function. */
-#undef HAVE_DLADDR
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if the system has the type `Elf32_auxv_t'. */
-#undef HAVE_ELF32_AUXV_T
-
-/* Define to 1 if the system has the type `Elf64_auxv_t'. */
-#undef HAVE_ELF64_AUXV_T
-
-/* Define if <sys/procfs.h> has elf_fpregset_t. */
-#undef HAVE_ELF_FPREGSET_T
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define to 1 if you have the `fdwalk' function. */
-#undef HAVE_FDWALK
-
-/* Define to 1 if you have the `fork' function. */
-#undef HAVE_FORK
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#undef HAVE_FPREGSET_T
-
-/* Define to 1 if you have the `getauxval' function. */
-#undef HAVE_GETAUXVAL
-
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define to 1 if you have the `getrlimit' function. */
-#undef HAVE_GETRLIMIT
-
-/* Define to 1 if you have the `getrusage' function. */
-#undef HAVE_GETRUSAGE
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#undef HAVE_GREGSET_T
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if your system has the kinfo_getfile function. */
-#undef HAVE_KINFO_GETFILE
-
-/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
-#undef HAVE_LANGINFO_CODESET
-
-/* Define to 1 if you have the `dl' library (-ldl). */
-#undef HAVE_LIBDL
-
-/* Define if you have the ipt library. */
-#undef HAVE_LIBIPT
-
-/* Define if the target supports branch tracing. */
-#undef HAVE_LINUX_BTRACE
-
-/* Define to 1 if you have the <linux/elf.h> header file. */
-#undef HAVE_LINUX_ELF_H
-
-/* Define to 1 if you have the <linux/perf_event.h> header file. */
-#undef HAVE_LINUX_PERF_EVENT_H
-
-/* Define if the target supports register sets. */
-#undef HAVE_LINUX_REGSETS
-
-/* Define if the target supports PTRACE_PEEKUSR for register access. */
-#undef HAVE_LINUX_USRREGS
-
-/* Define to 1 if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
-/* Define to 1 if the system has the type `long long'. */
-#undef HAVE_LONG_LONG
-
-/* Define if <thread_db.h> has lwpid_t. */
-#undef HAVE_LWPID_T
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define to 1 if you have the <netdb.h> header file. */
-#undef HAVE_NETDB_H
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#undef HAVE_NETINET_IN_H
-
-/* Define to 1 if you have the <netinet/tcp.h> header file. */
-#undef HAVE_NETINET_TCP_H
-
-/* Define if you support the personality syscall. */
-#undef HAVE_PERSONALITY
-
-/* Define to 1 if you have the `pipe' function. */
-#undef HAVE_PIPE
-
-/* Define to 1 if you have the `pipe2' function. */
-#undef HAVE_PIPE2
-
-/* Define to 1 if you have the `pread' function. */
-#undef HAVE_PREAD
-
-/* Define to 1 if you have the `pread64' function. */
-#undef HAVE_PREAD64
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#undef HAVE_PRFPREGSET_T
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-#undef HAVE_PRGREGSET32_T
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#undef HAVE_PRGREGSET_T
-
-/* Define to 1 if you have the <proc_service.h> header file. */
-#undef HAVE_PROC_SERVICE_H
-
-/* Define if <thread_db.h> has psaddr_t. */
-#undef HAVE_PSADDR_T
-
-/* Have PTHREAD_PRIO_INHERIT. */
-#undef HAVE_PTHREAD_PRIO_INHERIT
-
-/* Define to 1 if you have the `pthread_setname_np' function. */
-#undef HAVE_PTHREAD_SETNAME_NP
-
-/* Define to 1 if you have the `pthread_sigmask' function. */
-#undef HAVE_PTHREAD_SIGMASK
-
-/* Define to 1 if you have the `ptrace64' function. */
-#undef HAVE_PTRACE64
-
-/* Define if the target supports PTRACE_GETFPXREGS for extended register
-   access. */
-#undef HAVE_PTRACE_GETFPXREGS
-
-/* Define if the target supports PTRACE_GETREGS for register access. */
-#undef HAVE_PTRACE_GETREGS
-
-/* Define to 1 if you have the <ptrace.h> header file. */
-#undef HAVE_PTRACE_H
-
-/* Define to 1 if you have the `pt_insn_event' function. */
-#undef HAVE_PT_INSN_EVENT
-
-/* Define to 1 if you have the `pwrite' function. */
-#undef HAVE_PWRITE
-
-/* Define to 1 if you have the `sbrk' function. */
-#undef HAVE_SBRK
-
-/* Define to 1 if you have the `setns' function. */
-#undef HAVE_SETNS
-
-/* Define to 1 if you have the `setpgid' function. */
-#undef HAVE_SETPGID
-
-/* Define to 1 if you have the `setpgrp' function. */
-#undef HAVE_SETPGRP
-
-/* Define to 1 if you have the `sigaction' function. */
-#undef HAVE_SIGACTION
-
-/* Define to 1 if you have the `sigaltstack' function. */
-#undef HAVE_SIGALTSTACK
-
-/* Define to 1 if you have the <signal.h> header file. */
-#undef HAVE_SIGNAL_H
-
-/* Define to 1 if you have the `sigprocmask' function. */
-#undef HAVE_SIGPROCMASK
-
-/* Define if sigsetjmp is available. */
-#undef HAVE_SIGSETJMP
-
-/* Define to 1 if you have the `socketpair' function. */
-#undef HAVE_SOCKETPAIR
-
-/* Define to 1 if the system has the type `socklen_t'. */
-#undef HAVE_SOCKLEN_T
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if `enabled' is a member of `struct pt_insn'. */
-#undef HAVE_STRUCT_PT_INSN_ENABLED
-
-/* Define to 1 if `resynced' is a member of `struct pt_insn'. */
-#undef HAVE_STRUCT_PT_INSN_RESYNCED
-
-/* Define to 1 if `st_blksize' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BLKSIZE
-
-/* Define to 1 if `st_blocks' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BLOCKS
-
-/* Define to 1 if `fs_base' is a member of `struct user_regs_struct'. */
-#undef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
-
-/* Define to 1 if `gs_base' is a member of `struct user_regs_struct'. */
-#undef HAVE_STRUCT_USER_REGS_STRUCT_GS_BASE
-
-/* Define to 1 if the target supports __sync_*_compare_and_swap */
-#undef HAVE_SYNC_BUILTINS
-
-/* Define to 1 if you have the <sys/file.h> header file. */
-#undef HAVE_SYS_FILE_H
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/procfs.h> header file. */
-#undef HAVE_SYS_PROCFS_H
-
-/* Define to 1 if you have the <sys/ptrace.h> header file. */
-#undef HAVE_SYS_PTRACE_H
-
-/* Define to 1 if you have the <sys/reg.h> header file. */
-#undef HAVE_SYS_REG_H
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#undef HAVE_SYS_RESOURCE_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/un.h> header file. */
-#undef HAVE_SYS_UN_H
-
-/* Define to 1 if you have the <sys/wait.h> header file. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define if TD_VERSION is available. */
-#undef HAVE_TD_VERSION
-
-/* Define to 1 if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
-
-/* Define to 1 if you have the <thread_db.h> header file. */
-#undef HAVE_THREAD_DB_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define if UST is available */
-#undef HAVE_UST
-
-/* Define to 1 if you have the `vfork' function. */
-#undef HAVE_VFORK
-
-/* Define to 1 if you have the <vfork.h> header file. */
-#undef HAVE_VFORK_H
-
-/* Define to 1 if you have the <wait.h> header file. */
-#undef HAVE_WAIT_H
-
-/* Define to 1 if `fork' works. */
-#undef HAVE_WORKING_FORK
-
-/* Define to 1 if `vfork' works. */
-#undef HAVE_WORKING_VFORK
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
 #undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
+#undef PACKAGE
+#undef PACKAGE_VERSION
 #undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
+#include <gdbsupport/support-config.h>
 
-/* Define to the version of this package. */
+#undef PACKAGE_NAME
+#undef PACKAGE
 #undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
 
-/* Additional package description */
-#undef PKGVERSION
-
-/* Define to necessary symbol if this constant uses a non-standard name on
-   your system. */
-#undef PTHREAD_CREATE_JOINABLE
-
-/* Define to the type of arg 1 for ptrace. */
-#undef PTRACE_TYPE_ARG1
-
-/* Define to the type of arg 3 for ptrace. */
-#undef PTRACE_TYPE_ARG3
-
-/* Define to the type of arg 4 for ptrace. */
-#undef PTRACE_TYPE_ARG4
-
-/* Define to the type of arg 5 for ptrace. */
-#undef PTRACE_TYPE_ARG5
-
-/* Define as the return type of ptrace. */
-#undef PTRACE_TYPE_RET
-
-/* Bug reporting address */
-#undef REPORT_BUGS_TO
-
-/* The size of `long long', as computed by sizeof. */
-#undef SIZEOF_LONG_LONG
-
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at runtime.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-#undef STACK_DIRECTION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if we should use libthread_db directly. */
-#undef USE_LIBTHREAD_DB_DIRECTLY
-
-/* Enable extensions on AIX 3, Interix.  */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them.  */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris.  */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop.  */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
-/* Define if we should use libthread_db. */
-#undef USE_THREAD_DB
-
-/* Define if we should use the Windows API, instead of the POSIX API. On
-   Windows, we use the Windows API when building for MinGW, but the POSIX API
-   when building for Cygwin. */
-#undef USE_WIN32API
-
-/* Define if an XML target description is available. */
-#undef USE_XML
-
-/* Enable large inode numbers on Mac OS X 10.5.  */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
-   this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
-
-/* Define as `fork' if `vfork' does not work. */
-#undef vfork
+#include "gdbserver-config.h"
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 0bdc2145098..54dce062522 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -2695,7 +2695,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_headers="$ac_config_headers config.h:config.in"
+ac_config_headers="$ac_config_headers gdbserver-config.h:gdbserver-config.in"
+
+ac_config_files="$ac_config_files config.h:config.in"
 
 
 
@@ -11438,7 +11440,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
-    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
+    "gdbserver-config.h") CONFIG_HEADERS="$CONFIG_HEADERS gdbserver-config.h:gdbserver-config.in" ;;
+    "config.h") CONFIG_FILES="$CONFIG_FILES config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "gdbdepdir") CONFIG_COMMANDS="$CONFIG_COMMANDS gdbdepdir" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
@@ -11997,7 +12000,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
 
   case $ac_file$ac_mode in
-    "config.h":H) echo > stamp-h ;;
+    "gdbserver-config.h":H) echo > stamp-h ;;
     "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;;
     "gdbdepdir":C)
   for subdir in ${CONFIG_SRC_SUBDIR}
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 969354308c7..3afa6c1e37c 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -19,7 +19,8 @@ dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
 dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT(server.c)
-AC_CONFIG_HEADERS(config.h:config.in, [echo > stamp-h])
+AC_CONFIG_HEADERS(gdbserver-config.h:gdbserver-config.in, [echo > stamp-h])
+AC_CONFIG_FILES([config.h:config.in])
 
 AM_MAINTAINER_MODE
 
diff --git a/gdb/gdbserver/gdbserver-config.in b/gdb/gdbserver/gdbserver-config.in
new file mode 100644
index 00000000000..da8c313c360
--- /dev/null
+++ b/gdb/gdbserver/gdbserver-config.in
@@ -0,0 +1,496 @@
+/* config.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if std::thread works. */
+#undef CXX_STD_THREAD
+
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Define if self-testing features should be enabled */
+#undef GDB_SELF_TEST
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+   */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* define if the compiler supports basic C++11 syntax */
+#undef HAVE_CXX11
+
+/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
+   you don't. */
+#undef HAVE_DECL_ADDR_NO_RANDOMIZE
+
+/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_ASPRINTF
+
+/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if
+   you don't. */
+#undef HAVE_DECL_BASENAME
+
+/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
+#undef HAVE_DECL_FFS
+
+/* Define to 1 if you have the declaration of `perror', and to 0 if you don't.
+   */
+#undef HAVE_DECL_PERROR
+
+/* Define to 1 if you have the declaration of `ptrace', and to 0 if you don't.
+   */
+#undef HAVE_DECL_PTRACE
+
+/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_SNPRINTF
+
+/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
+   */
+#undef HAVE_DECL_STRSTR
+
+/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
+   */
+#undef HAVE_DECL_STRTOL
+
+/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOLL
+
+/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOUL
+
+/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOULL
+
+/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRVERSCMP
+
+/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_VASPRINTF
+
+/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_VSNPRINTF
+
+/* Define to 1 if you have the `dladdr' function. */
+#undef HAVE_DLADDR
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if the system has the type `Elf32_auxv_t'. */
+#undef HAVE_ELF32_AUXV_T
+
+/* Define to 1 if the system has the type `Elf64_auxv_t'. */
+#undef HAVE_ELF64_AUXV_T
+
+/* Define if <sys/procfs.h> has elf_fpregset_t. */
+#undef HAVE_ELF_FPREGSET_T
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `fdwalk' function. */
+#undef HAVE_FDWALK
+
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define if <sys/procfs.h> has fpregset_t. */
+#undef HAVE_FPREGSET_T
+
+/* Define to 1 if you have the `getauxval' function. */
+#undef HAVE_GETAUXVAL
+
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define to 1 if you have the `getrlimit' function. */
+#undef HAVE_GETRLIMIT
+
+/* Define to 1 if you have the `getrusage' function. */
+#undef HAVE_GETRUSAGE
+
+/* Define if <sys/procfs.h> has gregset_t. */
+#undef HAVE_GREGSET_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if your system has the kinfo_getfile function. */
+#undef HAVE_KINFO_GETFILE
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
+/* Define to 1 if you have the `dl' library (-ldl). */
+#undef HAVE_LIBDL
+
+/* Define if you have the ipt library. */
+#undef HAVE_LIBIPT
+
+/* Define if the target supports branch tracing. */
+#undef HAVE_LINUX_BTRACE
+
+/* Define to 1 if you have the <linux/elf.h> header file. */
+#undef HAVE_LINUX_ELF_H
+
+/* Define to 1 if you have the <linux/perf_event.h> header file. */
+#undef HAVE_LINUX_PERF_EVENT_H
+
+/* Define if the target supports register sets. */
+#undef HAVE_LINUX_REGSETS
+
+/* Define if the target supports PTRACE_PEEKUSR for register access. */
+#undef HAVE_LINUX_USRREGS
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
+/* Define if <thread_db.h> has lwpid_t. */
+#undef HAVE_LWPID_T
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#undef HAVE_NETINET_TCP_H
+
+/* Define if you support the personality syscall. */
+#undef HAVE_PERSONALITY
+
+/* Define to 1 if you have the `pipe' function. */
+#undef HAVE_PIPE
+
+/* Define to 1 if you have the `pipe2' function. */
+#undef HAVE_PIPE2
+
+/* Define to 1 if you have the `pread' function. */
+#undef HAVE_PREAD
+
+/* Define to 1 if you have the `pread64' function. */
+#undef HAVE_PREAD64
+
+/* Define if <sys/procfs.h> has prfpregset_t. */
+#undef HAVE_PRFPREGSET_T
+
+/* Define if <sys/procfs.h> has prgregset32_t. */
+#undef HAVE_PRGREGSET32_T
+
+/* Define if <sys/procfs.h> has prgregset_t. */
+#undef HAVE_PRGREGSET_T
+
+/* Define to 1 if you have the <proc_service.h> header file. */
+#undef HAVE_PROC_SERVICE_H
+
+/* Define if <thread_db.h> has psaddr_t. */
+#undef HAVE_PSADDR_T
+
+/* Have PTHREAD_PRIO_INHERIT. */
+#undef HAVE_PTHREAD_PRIO_INHERIT
+
+/* Define to 1 if you have the `pthread_setname_np' function. */
+#undef HAVE_PTHREAD_SETNAME_NP
+
+/* Define to 1 if you have the `pthread_sigmask' function. */
+#undef HAVE_PTHREAD_SIGMASK
+
+/* Define to 1 if you have the `ptrace64' function. */
+#undef HAVE_PTRACE64
+
+/* Define if the target supports PTRACE_GETFPXREGS for extended register
+   access. */
+#undef HAVE_PTRACE_GETFPXREGS
+
+/* Define if the target supports PTRACE_GETREGS for register access. */
+#undef HAVE_PTRACE_GETREGS
+
+/* Define to 1 if you have the <ptrace.h> header file. */
+#undef HAVE_PTRACE_H
+
+/* Define to 1 if you have the `pt_insn_event' function. */
+#undef HAVE_PT_INSN_EVENT
+
+/* Define to 1 if you have the `pwrite' function. */
+#undef HAVE_PWRITE
+
+/* Define to 1 if you have the `sbrk' function. */
+#undef HAVE_SBRK
+
+/* Define to 1 if you have the `setns' function. */
+#undef HAVE_SETNS
+
+/* Define to 1 if you have the `setpgid' function. */
+#undef HAVE_SETPGID
+
+/* Define to 1 if you have the `setpgrp' function. */
+#undef HAVE_SETPGRP
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Define to 1 if you have the `sigaltstack' function. */
+#undef HAVE_SIGALTSTACK
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Define to 1 if you have the `sigprocmask' function. */
+#undef HAVE_SIGPROCMASK
+
+/* Define if sigsetjmp is available. */
+#undef HAVE_SIGSETJMP
+
+/* Define to 1 if you have the `socketpair' function. */
+#undef HAVE_SOCKETPAIR
+
+/* Define to 1 if the system has the type `socklen_t'. */
+#undef HAVE_SOCKLEN_T
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if `enabled' is a member of `struct pt_insn'. */
+#undef HAVE_STRUCT_PT_INSN_ENABLED
+
+/* Define to 1 if `resynced' is a member of `struct pt_insn'. */
+#undef HAVE_STRUCT_PT_INSN_RESYNCED
+
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if `st_blocks' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLOCKS
+
+/* Define to 1 if `fs_base' is a member of `struct user_regs_struct'. */
+#undef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
+
+/* Define to 1 if `gs_base' is a member of `struct user_regs_struct'. */
+#undef HAVE_STRUCT_USER_REGS_STRUCT_GS_BASE
+
+/* Define to 1 if the target supports __sync_*_compare_and_swap */
+#undef HAVE_SYNC_BUILTINS
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/procfs.h> header file. */
+#undef HAVE_SYS_PROCFS_H
+
+/* Define to 1 if you have the <sys/ptrace.h> header file. */
+#undef HAVE_SYS_PTRACE_H
+
+/* Define to 1 if you have the <sys/reg.h> header file. */
+#undef HAVE_SYS_REG_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#undef HAVE_SYS_UN_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define if TD_VERSION is available. */
+#undef HAVE_TD_VERSION
+
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define to 1 if you have the <thread_db.h> header file. */
+#undef HAVE_THREAD_DB_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if UST is available */
+#undef HAVE_UST
+
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
+
+/* Define to 1 if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
+
+/* Define to 1 if you have the <wait.h> header file. */
+#undef HAVE_WAIT_H
+
+/* Define to 1 if `fork' works. */
+#undef HAVE_WORKING_FORK
+
+/* Define to 1 if `vfork' works. */
+#undef HAVE_WORKING_VFORK
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Additional package description */
+#undef PKGVERSION
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+   your system. */
+#undef PTHREAD_CREATE_JOINABLE
+
+/* Define to the type of arg 1 for ptrace. */
+#undef PTRACE_TYPE_ARG1
+
+/* Define to the type of arg 3 for ptrace. */
+#undef PTRACE_TYPE_ARG3
+
+/* Define to the type of arg 4 for ptrace. */
+#undef PTRACE_TYPE_ARG4
+
+/* Define to the type of arg 5 for ptrace. */
+#undef PTRACE_TYPE_ARG5
+
+/* Define as the return type of ptrace. */
+#undef PTRACE_TYPE_RET
+
+/* Bug reporting address */
+#undef REPORT_BUGS_TO
+
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if we should use libthread_db directly. */
+#undef USE_LIBTHREAD_DB_DIRECTLY
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define if we should use libthread_db. */
+#undef USE_THREAD_DB
+
+/* Define if we should use the Windows API, instead of the POSIX API. On
+   Windows, we use the Windows API when building for MinGW, but the POSIX API
+   when building for Cygwin. */
+#undef USE_WIN32API
+
+/* Define if an XML target description is available. */
+#undef USE_XML
+
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define as `fork' if `vfork' does not work. */
+#undef vfork
diff --git a/gdb/unittests/scoped_fd-selftests.c b/gdb/unittests/scoped_fd-selftests.c
index 3f024764245..96ca9bf7f63 100644
--- a/gdb/unittests/scoped_fd-selftests.c
+++ b/gdb/unittests/scoped_fd-selftests.c
@@ -21,7 +21,6 @@
 
 #include "gdbsupport/filestuff.h"
 #include "gdbsupport/scoped_fd.h"
-#include "config.h"
 #include "gdbsupport/selftest.h"
 
 namespace selftests {
diff --git a/gdb/unittests/scoped_mmap-selftests.c b/gdb/unittests/scoped_mmap-selftests.c
index fa963d1b47f..7e479e2bc06 100644
--- a/gdb/unittests/scoped_mmap-selftests.c
+++ b/gdb/unittests/scoped_mmap-selftests.c
@@ -21,7 +21,6 @@
 
 #include "gdbsupport/filestuff.h"
 #include "gdbsupport/scoped_mmap.h"
-#include "config.h"
 
 #if defined(HAVE_SYS_MMAN_H)
 
diff --git a/gdbsupport/common-defs.h b/gdbsupport/common-defs.h
index d823c41607c..d6fc62be413 100644
--- a/gdbsupport/common-defs.h
+++ b/gdbsupport/common-defs.h
@@ -20,32 +20,8 @@
 #ifndef COMMON_COMMON_DEFS_H
 #define COMMON_COMMON_DEFS_H
 
-#ifdef GDBSERVER
-
-#include <build-gnulib-gdbserver/config.h>
-
-#undef PACKAGE_NAME
-#undef PACKAGE
-#undef PACKAGE_VERSION
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-
 #include <config.h>
 
-#else  /* GDBSERVER */
-
-#include <gdbsupport/support-config.h>
-
-#undef PACKAGE_NAME
-#undef PACKAGE
-#undef PACKAGE_VERSION
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-
-#include "gnulib/config.h"
-
-#endif /* GDBSERVER */
-
 /* From:
     https://www.gnu.org/software/gnulib/manual/html_node/stdint_002eh.html
 
diff --git a/gdbsupport/config.in b/gdbsupport/config.in
index 6a6b0bc74f0..33d297ca932 100644
--- a/gdbsupport/config.in
+++ b/gdbsupport/config.in
@@ -1,414 +1,25 @@
-/* config.in.  Generated from configure.ac by autoheader.  */
+#ifdef GDBSERVER
 
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
-   systems. This function is required for `alloca.c' support on those systems.
-   */
-#undef CRAY_STACKSEG_END
+#include <build-gnulib-gdbserver/config.h>
 
-/* Define to 1 if std::thread works. */
-#undef CXX_STD_THREAD
-
-/* Define to 1 if using `alloca.c'. */
-#undef C_ALLOCA
-
-/* Define to 1 if translation of program messages to the user's native
-   language is requested. */
-#undef ENABLE_NLS
-
-/* Define if self-testing features should be enabled */
-#undef GDB_SELF_TEST
-
-/* Define to 1 if you have `alloca', as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
-   */
-#undef HAVE_ALLOCA_H
-
-/* define if the compiler supports basic C++11 syntax */
-#undef HAVE_CXX11
-
-/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
-   you don't. */
-#undef HAVE_DECL_ADDR_NO_RANDOMIZE
-
-/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_ASPRINTF
-
-/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if
-   you don't. */
-#undef HAVE_DECL_BASENAME
-
-/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
-#undef HAVE_DECL_FFS
-
-/* Define to 1 if you have the declaration of `ptrace', and to 0 if you don't.
-   */
-#undef HAVE_DECL_PTRACE
-
-/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_SNPRINTF
-
-/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
-   */
-#undef HAVE_DECL_STRSTR
-
-/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
-   */
-#undef HAVE_DECL_STRTOL
-
-/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOLL
-
-/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOUL
-
-/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOULL
-
-/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRVERSCMP
-
-/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_VASPRINTF
-
-/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_VSNPRINTF
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define if <sys/procfs.h> has elf_fpregset_t. */
-#undef HAVE_ELF_FPREGSET_T
-
-/* Define to 1 if you have the `fdwalk' function. */
-#undef HAVE_FDWALK
-
-/* Define to 1 if you have the `fork' function. */
-#undef HAVE_FORK
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#undef HAVE_FPREGSET_T
-
-/* Define to 1 if you have the `getauxval' function. */
-#undef HAVE_GETAUXVAL
-
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define to 1 if you have the `getrlimit' function. */
-#undef HAVE_GETRLIMIT
-
-/* Define to 1 if you have the `getrusage' function. */
-#undef HAVE_GETRUSAGE
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#undef HAVE_GREGSET_T
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if your system has the kinfo_getfile function. */
-#undef HAVE_KINFO_GETFILE
-
-/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
-#undef HAVE_LANGINFO_CODESET
-
-/* Define if you have the ipt library. */
-#undef HAVE_LIBIPT
-
-/* Define to 1 if you have the <linux/elf.h> header file. */
-#undef HAVE_LINUX_ELF_H
-
-/* Define to 1 if you have the <linux/perf_event.h> header file. */
-#undef HAVE_LINUX_PERF_EVENT_H
-
-/* Define to 1 if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
-/* Define to 1 if the system has the type `long long'. */
-#undef HAVE_LONG_LONG
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#undef HAVE_LWPID_T
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define if you support the personality syscall. */
-#undef HAVE_PERSONALITY
-
-/* Define to 1 if you have the `pipe' function. */
-#undef HAVE_PIPE
-
-/* Define to 1 if you have the `pipe2' function. */
-#undef HAVE_PIPE2
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#undef HAVE_PRFPREGSET_T
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-#undef HAVE_PRGREGSET32_T
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#undef HAVE_PRGREGSET_T
-
-/* Define to 1 if you have the <proc_service.h> header file. */
-#undef HAVE_PROC_SERVICE_H
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#undef HAVE_PSADDR_T
-
-/* Have PTHREAD_PRIO_INHERIT. */
-#undef HAVE_PTHREAD_PRIO_INHERIT
-
-/* Define to 1 if you have the `pthread_setname_np' function. */
-#undef HAVE_PTHREAD_SETNAME_NP
-
-/* Define to 1 if you have the `pthread_sigmask' function. */
-#undef HAVE_PTHREAD_SIGMASK
-
-/* Define to 1 if you have the `ptrace64' function. */
-#undef HAVE_PTRACE64
-
-/* Define to 1 if you have the <ptrace.h> header file. */
-#undef HAVE_PTRACE_H
-
-/* Define to 1 if you have the `pt_insn_event' function. */
-#undef HAVE_PT_INSN_EVENT
-
-/* Define to 1 if you have the `sbrk' function. */
-#undef HAVE_SBRK
-
-/* Define to 1 if you have the `setns' function. */
-#undef HAVE_SETNS
-
-/* Define to 1 if you have the `setpgid' function. */
-#undef HAVE_SETPGID
-
-/* Define to 1 if you have the `setpgrp' function. */
-#undef HAVE_SETPGRP
-
-/* Define to 1 if you have the `sigaction' function. */
-#undef HAVE_SIGACTION
-
-/* Define to 1 if you have the `sigaltstack' function. */
-#undef HAVE_SIGALTSTACK
-
-/* Define to 1 if you have the <signal.h> header file. */
-#undef HAVE_SIGNAL_H
-
-/* Define to 1 if you have the `sigprocmask' function. */
-#undef HAVE_SIGPROCMASK
-
-/* Define if sigsetjmp is available. */
-#undef HAVE_SIGSETJMP
-
-/* Define to 1 if you have the `socketpair' function. */
-#undef HAVE_SOCKETPAIR
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if `enabled' is a member of `struct pt_insn'. */
-#undef HAVE_STRUCT_PT_INSN_ENABLED
-
-/* Define to 1 if `resynced' is a member of `struct pt_insn'. */
-#undef HAVE_STRUCT_PT_INSN_RESYNCED
-
-/* Define to 1 if `st_blksize' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BLKSIZE
-
-/* Define to 1 if `st_blocks' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BLOCKS
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/procfs.h> header file. */
-#undef HAVE_SYS_PROCFS_H
-
-/* Define to 1 if you have the <sys/ptrace.h> header file. */
-#undef HAVE_SYS_PTRACE_H
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#undef HAVE_SYS_RESOURCE_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/un.h> header file. */
-#undef HAVE_SYS_UN_H
-
-/* Define to 1 if you have the <sys/wait.h> header file. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define to 1 if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
-
-/* Define to 1 if you have the <thread_db.h> header file. */
-#undef HAVE_THREAD_DB_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the `vfork' function. */
-#undef HAVE_VFORK
-
-/* Define to 1 if you have the <vfork.h> header file. */
-#undef HAVE_VFORK_H
-
-/* Define to 1 if you have the <wait.h> header file. */
-#undef HAVE_WAIT_H
-
-/* Define to 1 if you have the <windows.h> header file. */
-#undef HAVE_WINDOWS_H
-
-/* Define to 1 if `fork' works. */
-#undef HAVE_WORKING_FORK
-
-/* Define to 1 if `vfork' works. */
-#undef HAVE_WORKING_VFORK
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
 #undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
+#undef PACKAGE
+#undef PACKAGE_VERSION
 #undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define to necessary symbol if this constant uses a non-standard name on
-   your system. */
-#undef PTHREAD_CREATE_JOINABLE
-
-/* Define to the type of arg 1 for ptrace. */
-#undef PTRACE_TYPE_ARG1
-
-/* Define to the type of arg 3 for ptrace. */
-#undef PTRACE_TYPE_ARG3
-
-/* Define to the type of arg 4 for ptrace. */
-#undef PTRACE_TYPE_ARG4
-
-/* Define to the type of arg 5 for ptrace. */
-#undef PTRACE_TYPE_ARG5
-
-/* Define as the return type of ptrace. */
-#undef PTRACE_TYPE_RET
-
-/* The size of `long long', as computed by sizeof. */
-#undef SIZEOF_LONG_LONG
-
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at runtime.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-#undef STACK_DIRECTION
+#include <config.h>
 
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
+#else  /* GDBSERVER */
 
-/* Define to the word size for the target. */
-#undef TARGET_WORD_SIZE
+#include <gdbsupport/support-config.h>
 
-/* Enable extensions on AIX 3, Interix.  */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them.  */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris.  */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop.  */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
-/* Define if we should use the Windows API, instead of the POSIX API. On
-   Windows, we use the Windows API when building for MinGW, but the POSIX API
-   when building for Cygwin. */
-#undef USE_WIN32API
-
-/* Version number of package */
-#undef VERSION
-
-/* Enable large inode numbers on Mac OS X 10.5.  */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
-   this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
+#undef PACKAGE_NAME
+#undef PACKAGE
+#undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
 
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
+#include "gnulib/config.h"
 
-/* Define as `fork' if `vfork' does not work. */
-#undef vfork
+#endif /* GDBSERVER */
diff --git a/gdbsupport/configure b/gdbsupport/configure
index a0df06bbd53..0d505655ee5 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -2713,7 +2713,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_headers="$ac_config_headers support-config.h:config.in"
+ac_config_headers="$ac_config_headers support-config.h:support-config.in"
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -3526,6 +3526,9 @@ fi
 AM_BACKSLASH='\'
 
 
+ac_config_files="$ac_config_files config.h:config.in"
+
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -9687,7 +9690,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5
 $as_echo_n "checking for sigsetjmp... " >&6; }
 if ${gdb_cv_func_sigsetjmp+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -9695,7 +9698,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <setjmp.h>
+  #include <setjmp.h>
 
 int
 main ()
@@ -9714,11 +9717,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_sigsetjmp" >&5
 $as_echo "$gdb_cv_func_sigsetjmp" >&6; }
-if test "$gdb_cv_func_sigsetjmp" = "yes"; then
+  if test "$gdb_cv_func_sigsetjmp" = "yes"; then
 
 $as_echo "#define HAVE_SIGSETJMP 1" >>confdefs.h
 
-fi
+  fi
 
 
 # Check whether --with-intel_pt was given.
@@ -9728,23 +9731,23 @@ else
   with_intel_pt=auto
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use intel pt" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use intel pt" >&5
 $as_echo_n "checking whether to use intel pt... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_intel_pt" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_intel_pt" >&5
 $as_echo "$with_intel_pt" >&6; }
 
-if test "${with_intel_pt}" = no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Intel Processor Trace support disabled; some features may be unavailable." >&5
+  if test "${with_intel_pt}" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Intel Processor Trace support disabled; some features may be unavailable." >&5
 $as_echo "$as_me: WARNING: Intel Processor Trace support disabled; some features may be unavailable." >&2;}
-  HAVE_LIBIPT=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    HAVE_LIBIPT=no
+  else
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <linux/perf_event.h>
-#ifndef PERF_ATTR_SIZE_VER5
-# error
-#endif
+  #include <linux/perf_event.h>
+  #ifndef PERF_ATTR_SIZE_VER5
+  # error
+  #endif
 
 _ACEOF
 if ac_fn_c_try_cpp "$LINENO"; then :
@@ -9753,14 +9756,14 @@ else
   perf_event=no
 fi
 rm -f conftest.err conftest.i conftest.$ac_ext
-  if test "$perf_event" != yes; then
-    if test "$with_intel_pt" = yes; then
-      as_fn_error $? "linux/perf_event.h missing or too old" "$LINENO" 5
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&5
+    if test "$perf_event" != yes; then
+      if test "$with_intel_pt" = yes; then
+ as_fn_error $? "linux/perf_event.h missing or too old" "$LINENO" 5
+      else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&5
 $as_echo "$as_me: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&2;}
+      fi
     fi
-  fi
 
 
 
@@ -10224,17 +10227,17 @@ $as_echo "$LIBIPT" >&6; }
 
 
 
-  if test "$HAVE_LIBIPT" != yes; then
-    if test "$with_intel_pt" = yes; then
-      as_fn_error $? "libipt is missing or unusable" "$LINENO" 5
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libipt is missing or unusable; some features may be unavailable." >&5
+    if test "$HAVE_LIBIPT" != yes; then
+      if test "$with_intel_pt" = yes; then
+ as_fn_error $? "libipt is missing or unusable" "$LINENO" 5
+      else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libipt is missing or unusable; some features may be unavailable." >&5
 $as_echo "$as_me: WARNING: libipt is missing or unusable; some features may be unavailable." >&2;}
-    fi
-  else
-    save_LIBS=$LIBS
-    LIBS="$LIBS $LIBIPT"
-    for ac_func in pt_insn_event
+      fi
+    else
+      save_LIBS=$LIBS
+      LIBS="$LIBS $LIBIPT"
+      for ac_func in pt_insn_event
 do :
   ac_fn_c_check_func "$LINENO" "pt_insn_event" "ac_cv_func_pt_insn_event"
 if test "x$ac_cv_func_pt_insn_event" = xyes; then :
@@ -10245,7 +10248,7 @@ _ACEOF
 fi
 done
 
-    ac_fn_c_check_member "$LINENO" "struct pt_insn" "enabled" "ac_cv_member_struct_pt_insn_enabled" "#include <intel-pt.h>
+      ac_fn_c_check_member "$LINENO" "struct pt_insn" "enabled" "ac_cv_member_struct_pt_insn_enabled" "#include <intel-pt.h>
 "
 if test "x$ac_cv_member_struct_pt_insn_enabled" = xyes; then :
 
@@ -10266,12 +10269,12 @@ _ACEOF
 
 fi
 
-    LIBS=$save_LIBS
+      LIBS=$save_LIBS
+    fi
   fi
-fi
 
-if test "$ac_cv_header_sys_procfs_h" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gregset_t in sys/procfs.h" >&5
+  if test "$ac_cv_header_sys_procfs_h" = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for gregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_gregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10308,7 +10311,7 @@ $as_echo "#define HAVE_GREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_gregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_gregset_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpregset_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for fpregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_fpregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10345,7 +10348,7 @@ $as_echo "#define HAVE_FPREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_fpregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_fpregset_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for prgregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_prgregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10382,7 +10385,7 @@ $as_echo "#define HAVE_PRGREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_prgregset_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prfpregset_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prfpregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for prfpregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_prfpregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10419,7 +10422,7 @@ $as_echo "#define HAVE_PRFPREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prfpregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_prfpregset_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset32_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset32_t in sys/procfs.h" >&5
 $as_echo_n "checking for prgregset32_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_prgregset32_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10456,7 +10459,7 @@ $as_echo "#define HAVE_PRGREGSET32_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset32_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_prgregset32_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpid_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpid_t in sys/procfs.h" >&5
 $as_echo_n "checking for lwpid_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_lwpid_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10493,7 +10496,7 @@ $as_echo "#define HAVE_LWPID_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_lwpid_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_lwpid_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psaddr_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psaddr_t in sys/procfs.h" >&5
 $as_echo_n "checking for psaddr_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_psaddr_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10530,7 +10533,7 @@ $as_echo "#define HAVE_PSADDR_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_psaddr_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_psaddr_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_fpregset_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_fpregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for elf_fpregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_elf_fpregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10567,7 +10570,7 @@ $as_echo "#define HAVE_ELF_FPREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6; }
 
-fi
+  fi
 
 
 # Check whether we will enable the inclusion of unit tests when
@@ -11563,7 +11566,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
-    "support-config.h") CONFIG_HEADERS="$CONFIG_HEADERS support-config.h:config.in" ;;
+    "support-config.h") CONFIG_HEADERS="$CONFIG_HEADERS support-config.h:support-config.in" ;;
+    "config.h") CONFIG_FILES="$CONFIG_FILES config.h:config.in" ;;
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
 
diff --git a/gdbsupport/configure.ac b/gdbsupport/configure.ac
index af14d7bb92d..e9607ad265f 100644
--- a/gdbsupport/configure.ac
+++ b/gdbsupport/configure.ac
@@ -18,13 +18,15 @@ dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT([gdbsupport], 1.0)
 AC_CONFIG_SRCDIR(common-defs.h)
-AC_CONFIG_HEADER(support-config.h:config.in)
+AC_CONFIG_HEADER(support-config.h:support-config.in)
 AC_CANONICAL_SYSTEM
 AM_MAINTAINER_MODE
 AC_CONFIG_AUX_DIR(..)
 AM_INIT_AUTOMAKE
 AM_SILENT_RULES([yes])
 
+AC_CONFIG_FILES([config.h:config.in])
+
 AC_PROG_CC
 AC_PROG_CXX
 AC_PROG_RANLIB
diff --git a/gdbsupport/support-config.in b/gdbsupport/support-config.in
new file mode 100644
index 00000000000..6a6b0bc74f0
--- /dev/null
+++ b/gdbsupport/support-config.in
@@ -0,0 +1,414 @@
+/* config.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if std::thread works. */
+#undef CXX_STD_THREAD
+
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
+#undef ENABLE_NLS
+
+/* Define if self-testing features should be enabled */
+#undef GDB_SELF_TEST
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+   */
+#undef HAVE_ALLOCA_H
+
+/* define if the compiler supports basic C++11 syntax */
+#undef HAVE_CXX11
+
+/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
+   you don't. */
+#undef HAVE_DECL_ADDR_NO_RANDOMIZE
+
+/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_ASPRINTF
+
+/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if
+   you don't. */
+#undef HAVE_DECL_BASENAME
+
+/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
+#undef HAVE_DECL_FFS
+
+/* Define to 1 if you have the declaration of `ptrace', and to 0 if you don't.
+   */
+#undef HAVE_DECL_PTRACE
+
+/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_SNPRINTF
+
+/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
+   */
+#undef HAVE_DECL_STRSTR
+
+/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
+   */
+#undef HAVE_DECL_STRTOL
+
+/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOLL
+
+/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOUL
+
+/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOULL
+
+/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRVERSCMP
+
+/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_VASPRINTF
+
+/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_VSNPRINTF
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define if <sys/procfs.h> has elf_fpregset_t. */
+#undef HAVE_ELF_FPREGSET_T
+
+/* Define to 1 if you have the `fdwalk' function. */
+#undef HAVE_FDWALK
+
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define if <sys/procfs.h> has fpregset_t. */
+#undef HAVE_FPREGSET_T
+
+/* Define to 1 if you have the `getauxval' function. */
+#undef HAVE_GETAUXVAL
+
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define to 1 if you have the `getrlimit' function. */
+#undef HAVE_GETRLIMIT
+
+/* Define to 1 if you have the `getrusage' function. */
+#undef HAVE_GETRUSAGE
+
+/* Define if <sys/procfs.h> has gregset_t. */
+#undef HAVE_GREGSET_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if your system has the kinfo_getfile function. */
+#undef HAVE_KINFO_GETFILE
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
+/* Define if you have the ipt library. */
+#undef HAVE_LIBIPT
+
+/* Define to 1 if you have the <linux/elf.h> header file. */
+#undef HAVE_LINUX_ELF_H
+
+/* Define to 1 if you have the <linux/perf_event.h> header file. */
+#undef HAVE_LINUX_PERF_EVENT_H
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
+/* Define if <sys/procfs.h> has lwpid_t. */
+#undef HAVE_LWPID_T
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define if you support the personality syscall. */
+#undef HAVE_PERSONALITY
+
+/* Define to 1 if you have the `pipe' function. */
+#undef HAVE_PIPE
+
+/* Define to 1 if you have the `pipe2' function. */
+#undef HAVE_PIPE2
+
+/* Define if <sys/procfs.h> has prfpregset_t. */
+#undef HAVE_PRFPREGSET_T
+
+/* Define if <sys/procfs.h> has prgregset32_t. */
+#undef HAVE_PRGREGSET32_T
+
+/* Define if <sys/procfs.h> has prgregset_t. */
+#undef HAVE_PRGREGSET_T
+
+/* Define to 1 if you have the <proc_service.h> header file. */
+#undef HAVE_PROC_SERVICE_H
+
+/* Define if <sys/procfs.h> has psaddr_t. */
+#undef HAVE_PSADDR_T
+
+/* Have PTHREAD_PRIO_INHERIT. */
+#undef HAVE_PTHREAD_PRIO_INHERIT
+
+/* Define to 1 if you have the `pthread_setname_np' function. */
+#undef HAVE_PTHREAD_SETNAME_NP
+
+/* Define to 1 if you have the `pthread_sigmask' function. */
+#undef HAVE_PTHREAD_SIGMASK
+
+/* Define to 1 if you have the `ptrace64' function. */
+#undef HAVE_PTRACE64
+
+/* Define to 1 if you have the <ptrace.h> header file. */
+#undef HAVE_PTRACE_H
+
+/* Define to 1 if you have the `pt_insn_event' function. */
+#undef HAVE_PT_INSN_EVENT
+
+/* Define to 1 if you have the `sbrk' function. */
+#undef HAVE_SBRK
+
+/* Define to 1 if you have the `setns' function. */
+#undef HAVE_SETNS
+
+/* Define to 1 if you have the `setpgid' function. */
+#undef HAVE_SETPGID
+
+/* Define to 1 if you have the `setpgrp' function. */
+#undef HAVE_SETPGRP
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Define to 1 if you have the `sigaltstack' function. */
+#undef HAVE_SIGALTSTACK
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Define to 1 if you have the `sigprocmask' function. */
+#undef HAVE_SIGPROCMASK
+
+/* Define if sigsetjmp is available. */
+#undef HAVE_SIGSETJMP
+
+/* Define to 1 if you have the `socketpair' function. */
+#undef HAVE_SOCKETPAIR
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if `enabled' is a member of `struct pt_insn'. */
+#undef HAVE_STRUCT_PT_INSN_ENABLED
+
+/* Define to 1 if `resynced' is a member of `struct pt_insn'. */
+#undef HAVE_STRUCT_PT_INSN_RESYNCED
+
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if `st_blocks' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLOCKS
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/procfs.h> header file. */
+#undef HAVE_SYS_PROCFS_H
+
+/* Define to 1 if you have the <sys/ptrace.h> header file. */
+#undef HAVE_SYS_PTRACE_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#undef HAVE_SYS_UN_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define to 1 if you have the <thread_db.h> header file. */
+#undef HAVE_THREAD_DB_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
+
+/* Define to 1 if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
+
+/* Define to 1 if you have the <wait.h> header file. */
+#undef HAVE_WAIT_H
+
+/* Define to 1 if you have the <windows.h> header file. */
+#undef HAVE_WINDOWS_H
+
+/* Define to 1 if `fork' works. */
+#undef HAVE_WORKING_FORK
+
+/* Define to 1 if `vfork' works. */
+#undef HAVE_WORKING_VFORK
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+   your system. */
+#undef PTHREAD_CREATE_JOINABLE
+
+/* Define to the type of arg 1 for ptrace. */
+#undef PTRACE_TYPE_ARG1
+
+/* Define to the type of arg 3 for ptrace. */
+#undef PTRACE_TYPE_ARG3
+
+/* Define to the type of arg 4 for ptrace. */
+#undef PTRACE_TYPE_ARG4
+
+/* Define to the type of arg 5 for ptrace. */
+#undef PTRACE_TYPE_ARG5
+
+/* Define as the return type of ptrace. */
+#undef PTRACE_TYPE_RET
+
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to the word size for the target. */
+#undef TARGET_WORD_SIZE
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define if we should use the Windows API, instead of the POSIX API. On
+   Windows, we use the Windows API when building for MinGW, but the POSIX API
+   when building for Cygwin. */
+#undef USE_WIN32API
+
+/* Version number of package */
+#undef VERSION
+
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define as `fork' if `vfork' does not work. */
+#undef vfork

base-commit: aad09917e04b33da463f1703aab8d057cfe3f54e
--
2.14.5

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Sourceware - gdb-patches mailing list
In reply to this post by Tom Tromey-2
On Sat, Jan 11, 2020 at 11:58 AM Tom Tromey <[hidden email]> wrote:

>
> >>>>> "Tom" == Tom Tromey <[hidden email]> writes:
>
> Tom> Here is an update of the series to move gdbsupport to the top level.
> Tom> This is one step in the bigger projecct to move gdbserver to top
> Tom> level.
>
> I see that patches #2 and #3 did not come through.
> I think they ran into the size limit.
>
> Here is patch 2.  I'll send patch 3 separately.
> Using "git show" makes patch 2 smaller, but I'm also going to edit out
> the generated files from both patches.

Since these files were moved anyway, this might be a good opportunity
to rename .c -> .cpp in gdbsupport? (Similar for when gdbserver will
be moved)

Christian

>
> Tom
>
> commit f68357acdbb40bdd712dc09c3d87b2de2e18aedf
> Author: Tom Tromey <[hidden email]>
> Date:   Tue Jul 9 08:06:39 2019 -0600
>
>     Move gdbsupport to the top level
>
>     This patch moves the gdbsupport directory to the top level.  This is
>     the next step in the ongoing project to move gdbserver to the top
>     level.
>
>     The bulk of this patch was created by "git mv gdb/gdbsupport gdbsupport".
>
>     This patch then adds a build system to gdbsupport and wires it into
>     the top level.  Then it changes gdb to use the top-level build.
>
>     gdbserver, on the other hand, is not yet changed.  It still does its
>     own build of gdbsupport.
>
>     ChangeLog
>     2020-01-08  Tom Tromey  <[hidden email]>
>
>             * src-release.sh (GDB_SUPPORT_DIRS): Add gdbsupport.
>             * MAINTAINERS: Add gdbsupport.
>             * configure: Rebuild.
>             * configure.ac (configdirs): Add gdbsupport.
>             * gdbsupport: New directory, move from gdb/gdbsupport.
>             * Makefile.def (host_modules, dependencies): Add gnulib.
>             * Makefile.in: Rebuild.
>
>     gdb/ChangeLog
>     2020-01-08  Tom Tromey  <[hidden email]>
>
>             * nat/x86-linux-dregs.c: Include configh.h.
>             * nat/linux-ptrace.c: Include configh.h.
>             * nat/linux-btrace.c: Include configh.h.
>             * defs.h: Include config.h, bfd.h.
>             * configure.ac: Don't source common.host.
>             (CONFIG_OBS, CONFIG_SRCS): Remove gdbsupport files.
>             * configure: Rebuild.
>             * acinclude.m4: Update path.
>             * Makefile.in (SUPPORT, LIBSUPPORT, INCSUPPORT): New variables.
>             (CONFIG_SRC_SUBDIR): Remove gdbsupport.
>             (INTERNAL_CFLAGS_BASE): Add INCSUPPORT.
>             (CLIBS): Add LIBSUPPORT.
>             (CDEPS): Likewise.
>             (COMMON_SFILES): Remove gdbsupport files.
>             (HFILES_NO_SRCDIR): Likewise.
>             (stamp-version): Update path to create-version.sh.
>             (ALLDEPFILES): Remove gdbsupport files.
>
>     gdb/gdbserver/ChangeLog
>     2020-01-08  Tom Tromey  <[hidden email]>
>
>             * server.h: Include config.h.
>             * gdbreplay.c: Include config.h.
>             * configure: Rebuild.
>             * configure.ac: Don't source common.host.
>             * acinclude.m4: Update path.
>             * Makefile.in (INCSUPPORT): New variable.
>             (INCLUDE_CFLAGS): Add INCSUPPORT.
>             (SFILES): Update paths.
>             (version-generated.c): Update path to create-version.sh.
>             (gdbsupport/%-ipa.o, gdbsupport/%.o): Update paths.
>
>     gdbsupport/ChangeLog
>     2020-01-08  Tom Tromey  <[hidden email]>
>
>             * common-defs.h: Add GDBSERVER case.  Update includes.
>             * acinclude.m4, aclocal.m4, config.in, configure, configure.ac,
>             Makefile.am, Makefile.in, README: New files.
>             * Moved from ../gdb/gdbsupport/
>
>     Change-Id: I07632e7798635c1bab389bf885971e584fb4bb78
>
> diff --git a/ChangeLog b/ChangeLog
> index 00a224473b5..9e3006cf5bf 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,13 @@
> +2020-01-08  Tom Tromey  <[hidden email]>
> +
> +       * src-release.sh (GDB_SUPPORT_DIRS): Add gdbsupport.
> +       * MAINTAINERS: Add gdbsupport.
> +       * configure: Rebuild.
> +       * configure.ac (configdirs): Add gdbsupport.
> +       * gdbsupport: New directory, move from gdb/gdbsupport.
> +       * Makefile.def (host_modules, dependencies): Add gnulib.
> +       * Makefile.in: Rebuild.
> +
>  2020-01-09  Aaron Merey  <[hidden email]>
>
>          * config/debuginfod.m4: New file. Add macro AC_DEBUGINFOD. Adds
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 4e04918dad8..805f2e3ac43 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -41,7 +41,7 @@ config.guess; config.sub; readline/support/config.{sub,guess}
>  depcomp; mkinstalldirs
>          Send bug reports and patches to [hidden email].
>
> -gdb/; gnulib/; readline/; sim/; GDB's part of include/
> +gdb/; gdbsupport/; gnulib/; readline/; sim/; GDB's part of include/
>         GDB: http://www.gnu.org/software/gdb/
>         Patches to [hidden email].
>         See also gdb/MAINTAINERS and sim/MAINTAINERS.
> diff --git a/Makefile.def b/Makefile.def
> index 311feb9de3b..079fd3e4f16 100644
> --- a/Makefile.def
> +++ b/Makefile.def
> @@ -113,6 +113,7 @@ host_modules= { module= zlib; no_install=true; no_check=true;
>                 bootstrap=true;
>                 extra_configure_flags='@extra_host_zlib_configure_flags@';};
>  host_modules= { module= gnulib; };
> +host_modules= { module= gdbsupport; };
>  host_modules= { module= gdb; };
>  host_modules= { module= expect; };
>  host_modules= { module= guile; };
> @@ -392,12 +393,14 @@ dependencies = { module=configure-gdb; on=all-intl; };
>  dependencies = { module=configure-gdb; on=configure-sim; };
>  dependencies = { module=configure-gdb; on=all-bfd; };
>  dependencies = { module=configure-gdb; on=all-gnulib; };
> +dependencies = { module=configure-gdb; on=all-gdbsupport; };
>  // Depend on all-libiconv so that configure checks for iconv
>  // functions will work.
>  dependencies = { module=configure-gdb; on=all-libiconv; };
>  dependencies = { module=all-gdb; on=all-libiberty; };
>  dependencies = { module=all-gdb; on=all-libiconv; };
>  dependencies = { module=all-gdb; on=all-gnulib; };
> +dependencies = { module=all-gdb; on=all-gdbsupport; };
>  dependencies = { module=all-gdb; on=all-opcodes; };
>  dependencies = { module=all-gdb; on=all-readline; };
>  dependencies = { module=all-gdb; on=all-build-bison; };
> @@ -412,6 +415,10 @@ dependencies = { module=all-libgui; on=all-tcl; };
>  dependencies = { module=all-libgui; on=all-tk; };
>  dependencies = { module=all-libgui; on=all-itcl; };
>
> +dependencies = { module=configure-gdbsupport; on=configure-bfd; };
> +dependencies = { module=configure-gdbsupport; on=configure-gnulib; };
> +dependencies = { module=all-gdbsupport; on=all-gnulib; };
> +
>  // Host modules specific to binutils.
>  dependencies = { module=configure-bfd; on=configure-libiberty; hard=true; };
>  dependencies = { module=configure-bfd; on=configure-intl; };
> diff --git a/configure.ac b/configure.ac
> index 544fab3d209..4bd869a63a9 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2730,12 +2730,12 @@ esac
>  CONFIGURE_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-configure-/g`
>  INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`
>
> -# gdb depends on gnulib, but as nothing else does, only include it if
> -# gdb is built.
> +# gdb depends on gnulib and gdbsupport, but as nothing else does, only
> +# include them if gdb is built.
>  if echo " ${configdirs} " | grep " gdb " > /dev/null 2>&1 ; then
> -  # The Makefile provides the ordering, so it's enough here to add
> -  # gnulib to the list.
> -  configdirs="${configdirs} gnulib"
> +  # The Makefile provides the ordering, so it's enough here to add to
> +  # the list.
> +  configdirs="${configdirs} gnulib gdbsupport"
>  fi
>
>  # Strip out unwanted targets.
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index 28f5c21242b..71d41d9f67f 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,23 @@
> +2020-01-08  Tom Tromey  <[hidden email]>
> +
> +       * nat/x86-linux-dregs.c: Include configh.h.
> +       * nat/linux-ptrace.c: Include configh.h.
> +       * nat/linux-btrace.c: Include configh.h.
> +       * defs.h: Include config.h, bfd.h.
> +       * configure.ac: Don't source common.host.
> +       (CONFIG_OBS, CONFIG_SRCS): Remove gdbsupport files.
> +       * configure: Rebuild.
> +       * acinclude.m4: Update path.
> +       * Makefile.in (SUPPORT, LIBSUPPORT, INCSUPPORT): New variables.
> +       (CONFIG_SRC_SUBDIR): Remove gdbsupport.
> +       (INTERNAL_CFLAGS_BASE): Add INCSUPPORT.
> +       (CLIBS): Add LIBSUPPORT.
> +       (CDEPS): Likewise.
> +       (COMMON_SFILES): Remove gdbsupport files.
> +       (HFILES_NO_SRCDIR): Likewise.
> +       (stamp-version): Update path to create-version.sh.
> +       (ALLDEPFILES): Remove gdbsupport files.
> +
>  2020-01-08  Tom Tromey  <[hidden email]>
>
>         * gdbsupport/common.m4 (GDB_AC_COMMON): Define WIN32APILIBS and
> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index 6df0f46b5ed..5f63c617d4f 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -238,6 +238,10 @@ GNULIB_BUILDDIR = ../gnulib
>  LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a
>  INCGNU = -I$(srcdir)/../gnulib/import -I$(GNULIB_BUILDDIR)/import
>
> +SUPPORT = ../gdbsupport
> +LIBSUPPORT = $(SUPPORT)/libgdbsupport.a
> +INCSUPPORT = -I$(srcdir)/.. -I..
> +
>  #
>  # CLI sub directory definitons
>  #
> @@ -547,7 +551,7 @@ CONFIG_INSTALL = @CONFIG_INSTALL@
>  CONFIG_UNINSTALL = @CONFIG_UNINSTALL@
>  HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
>
> -CONFIG_SRC_SUBDIR = arch cli mi gdbsupport compile tui unittests guile python \
> +CONFIG_SRC_SUBDIR = arch cli mi compile tui unittests guile python \
>         target nat
>  CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
>
> @@ -586,8 +590,8 @@ INTERNAL_CFLAGS_BASE = \
>         $(CXXFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
>         $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) $(ZLIBINC) \
>         $(BFD_CFLAGS) $(INCLUDE_CFLAGS) $(LIBDECNUMBER_CFLAGS) \
> -       $(INTL_CFLAGS) $(INCGNU) $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS) \
> -       $(SRCHIGH_CFLAGS) $(TOP_CFLAGS) $(PTHREAD_CFLAGS)
> +       $(INTL_CFLAGS) $(INCGNU) $(INCSUPPORT) $(ENABLE_CFLAGS) \
> +       $(INTERNAL_CPPFLAGS) $(SRCHIGH_CFLAGS) $(TOP_CFLAGS) $(PTHREAD_CFLAGS)
>  INTERNAL_WARN_CFLAGS = $(INTERNAL_CFLAGS_BASE) $(GDB_WARN_CFLAGS)
>  INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS)
>
> @@ -607,14 +611,15 @@ INTERNAL_LDFLAGS = \
>  # XM_CLIBS, defined in *config files, have host-dependent libs.
>  # LIBIBERTY appears twice on purpose.
>  CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(LIBCTF) $(ZLIB) \
> -        $(INTL) $(LIBIBERTY) $(LIBDECNUMBER) \
> +        $(LIBSUPPORT) $(INTL) $(LIBIBERTY) $(LIBDECNUMBER) \
>         $(XM_CLIBS) $(GDBTKLIBS) \
>         @LIBS@ @GUILE_LIBS@ @PYTHON_LIBS@ \
>         $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \
> -       $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR) \
> -       $(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS)
> +       $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) \
> +       $(LIBMPFR) $(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS)
>  CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) $(LIBCTF) \
> -       $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)
> +       $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU) \
> +       $(LIBSUPPORT)
>
>  DIST = gdb
>
> @@ -968,39 +973,6 @@ COMMON_SFILES = \
>         cli-out.c \
>         coff-pe-read.c \
>         coffread.c \
> -       gdbsupport/agent.c \
> -       gdbsupport/btrace-common.c \
> -       gdbsupport/buffer.c \
> -       gdbsupport/cleanups.c \
> -       gdbsupport/common-debug.c \
> -       gdbsupport/common-exceptions.c \
> -       gdbsupport/common-inferior.c \
> -       gdbsupport/common-regcache.c \
> -       gdbsupport/common-utils.c \
> -       gdbsupport/errors.c \
> -       gdbsupport/environ.c \
> -       gdbsupport/fileio.c \
> -       gdbsupport/filestuff.c \
> -       gdbsupport/format.c \
> -       gdbsupport/job-control.c \
> -       gdbsupport/gdb-dlfcn.c \
> -       gdbsupport/gdb_tilde_expand.c \
> -       gdbsupport/gdb_vecs.c \
> -       gdbsupport/gdb_wait.c \
> -       gdbsupport/netstuff.c \
> -       gdbsupport/new-op.c \
> -       gdbsupport/pathstuff.c \
> -       gdbsupport/print-utils.c \
> -       gdbsupport/ptid.c \
> -       gdbsupport/rsp-low.c \
> -       gdbsupport/run-time-clock.c \
> -       gdbsupport/safe-strerror.c \
> -       gdbsupport/scoped_mmap.c \
> -       gdbsupport/signals.c \
> -       gdbsupport/signals-state-save-restore.c \
> -       gdbsupport/tdesc.c \
> -       gdbsupport/thread-pool.c \
> -       gdbsupport/xml-utils.c \
>         complaints.c \
>         completer.c \
>         continuations.c \
> @@ -1468,49 +1440,6 @@ HFILES_NO_SRCDIR = \
>         cli/cli-setshow.h \
>         cli/cli-style.h \
>         cli/cli-utils.h \
> -       gdbsupport/buffer.h \
> -       gdbsupport/cleanups.h \
> -       gdbsupport/common-debug.h \
> -       gdbsupport/common-defs.h \
> -       gdbsupport/common-exceptions.h \
> -       gdbsupport/common-gdbthread.h \
> -       gdbsupport/common-regcache.h \
> -       gdbsupport/common-types.h \
> -       gdbsupport/common-utils.h \
> -       gdbsupport/job-control.h \
> -       gdbsupport/errors.h \
> -       gdbsupport/environ.h \
> -       gdbsupport/fileio.h \
> -       gdbsupport/format.h \
> -       gdbsupport/gdb-dlfcn.h \
> -       gdbsupport/gdb-sigmask.h \
> -       gdbsupport/gdb_assert.h \
> -       gdbsupport/gdb_binary_search.h \
> -       gdbsupport/gdb_tilde_expand.h \
> -       gdbsupport/gdb_locale.h \
> -       gdbsupport/gdb_proc_service.h \
> -       gdbsupport/gdb_setjmp.h \
> -       gdbsupport/gdb_signals.h \
> -       gdbsupport/gdb_sys_time.h \
> -       gdbsupport/gdb_vecs.h \
> -       gdbsupport/gdb_wait.h \
> -       gdbsupport/common-inferior.h \
> -       gdbsupport/netstuff.h \
> -       gdbsupport/host-defs.h \
> -       gdbsupport/parallel-for.h \
> -       gdbsupport/pathstuff.h \
> -       gdbsupport/print-utils.h \
> -       gdbsupport/ptid.h \
> -       gdbsupport/queue.h \
> -       gdbsupport/rsp-low.h \
> -       gdbsupport/run-time-clock.h \
> -       gdbsupport/signals-state-save-restore.h \
> -       gdbsupport/symbol.h \
> -       gdbsupport/tdesc.h \
> -       gdbsupport/thread-pool.h \
> -       gdbsupport/version.h \
> -       gdbsupport/x86-xstate.h \
> -       gdbsupport/xml-utils.h \
>         compile/compile.h \
>         compile/compile-c.h \
>         compile/compile-cplus.h \
> @@ -2131,8 +2060,8 @@ $(srcdir)/copying.c: @MAINTAINER_MODE_TRUE@ $(srcdir)/../COPYING3 $(srcdir)/copy
>  version.c: stamp-version; @true
>  # Note that the obvious names for the temp file are taken by
>  # create-version.sh.
> -stamp-version: Makefile version.in $(srcdir)/../bfd/version.h $(srcdir)/gdbsupport/create-version.sh
> -       $(ECHO_GEN) $(SHELL) $(srcdir)/gdbsupport/create-version.sh $(srcdir) \
> +stamp-version: Makefile version.in $(srcdir)/../bfd/version.h $(srcdir)/../gdbsupport/create-version.sh
> +       $(ECHO_GEN) $(SHELL) $(srcdir)/../gdbsupport/create-version.sh $(srcdir) \
>             $(host_alias) $(target_alias) version-t.t
>         @$(SHELL) $(srcdir)/../move-if-change version-t.t version.c
>         @echo stamp > stamp-version
> diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
> index 11cc0bc2417..d60b2fe19c1 100644
> --- a/gdb/acinclude.m4
> +++ b/gdb/acinclude.m4
> @@ -63,7 +63,7 @@ m4_include([../config/iconv.m4])
>
>  m4_include([../config/zlib.m4])
>
> -m4_include([gdbsupport/common.m4])
> +m4_include([../gdbsupport/common.m4])
>
>  dnl For libiberty_INIT.
>  m4_include(libiberty.m4)
> diff --git a/gdb/configure.ac b/gdb/configure.ac
> index a7b744bf241..ddb9530afd0 100644
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -2215,8 +2215,8 @@ AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "UTF-8",
>            [Define to be a string naming the default host character set.])
>
>  GDB_AC_SELFTEST([
> -  CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_UNITTESTS_OBS) gdbsupport/selftest.o selftest-arch.o"
> -  CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_UNITTESTS_SRCS) gdbsupport/selftest.c selftest-arch.c"
> +  CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_UNITTESTS_OBS) selftest-arch.o"
> +  CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_UNITTESTS_SRCS) selftest-arch.c"
>  ])
>
>  GDB_AC_TRANSFORM([gdb], [GDB_TRANSFORM_NAME])
> diff --git a/gdb/defs.h b/gdb/defs.h
> index 567f214b81d..1ad52feb1f8 100644
> --- a/gdb/defs.h
> +++ b/gdb/defs.h
> @@ -27,6 +27,15 @@
>
>  #include "gdbsupport/common-defs.h"
>
> +#undef PACKAGE
> +#undef PACKAGE_NAME
> +#undef PACKAGE_VERSION
> +#undef PACKAGE_STRING
> +#undef PACKAGE_TARNAME
> +
> +#include <config.h>
> +#include "bfd.h"
> +
>  #include <sys/types.h>
>  #include <limits.h>
>
> diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
> index c3b547528d0..22d10bec484 100644
> --- a/gdb/gdbserver/ChangeLog
> +++ b/gdb/gdbserver/ChangeLog
> @@ -1,3 +1,16 @@
> +2020-01-08  Tom Tromey  <[hidden email]>
> +
> +       * server.h: Include config.h.
> +       * gdbreplay.c: Include config.h.
> +       * configure: Rebuild.
> +       * configure.ac: Don't source common.host.
> +       * acinclude.m4: Update path.
> +       * Makefile.in (INCSUPPORT): New variable.
> +       (INCLUDE_CFLAGS): Add INCSUPPORT.
> +       (SFILES): Update paths.
> +       (version-generated.c): Update path to create-version.sh.
> +       (gdbsupport/%-ipa.o, gdbsupport/%.o): Update paths.
> +
>  2020-01-08  Tom Tromey  <[hidden email]>
>
>         * configure.ac (LIBS): Use WIN32APILIBS.
> diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
> index 1125426778b..9640a2a4447 100644
> --- a/gdb/gdbserver/Makefile.in
> +++ b/gdb/gdbserver/Makefile.in
> @@ -109,6 +109,8 @@ INCGNU = -I$(srcdir)/../../gnulib/import -I$(GNULIB_BUILDDIR)/import
>  # so that they are generated before other files are compiled.
>  GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@
>
> +INCSUPPORT = -I$(srcdir)/../.. -I../..
> +
>  # All the includes used for CFLAGS and for lint.
>  # -I. for config files.
>  # -I${srcdir} for our headers.
> @@ -120,7 +122,7 @@ GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@
>  #
>  INCLUDE_CFLAGS = -I. -I${srcdir} \
>         -I$(srcdir)/../regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \
> -       $(INCGNU)
> +       $(INCGNU) $(INCSUPPORT)
>
>  # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
>  # from the config/ directory.
> @@ -201,32 +203,32 @@ SFILES = \
>         $(srcdir)/arch/arm-linux.c \
>         $(srcdir)/arch/ppc-linux-common.c \
>         $(srcdir)/../alloc.c \
> -       $(srcdir)/gdbsupport/btrace-common.c \
> -       $(srcdir)/gdbsupport/buffer.c \
> -       $(srcdir)/gdbsupport/cleanups.c \
> -       $(srcdir)/gdbsupport/common-debug.c \
> -       $(srcdir)/gdbsupport/common-exceptions.c \
> -       $(srcdir)/gdbsupport/common-inferior.c \
> -       $(srcdir)/gdbsupport/common-regcache.c \
> -       $(srcdir)/gdbsupport/common-utils.c \
> -       $(srcdir)/gdbsupport/errors.c \
> -       $(srcdir)/gdbsupport/environ.c \
> -       $(srcdir)/gdbsupport/fileio.c \
> -       $(srcdir)/gdbsupport/filestuff.c \
> -       $(srcdir)/gdbsupport/job-control.c \
> -       $(srcdir)/gdbsupport/gdb-dlfcn.c \
> -       $(srcdir)/gdbsupport/gdb_tilde_expand.c \
> -       $(srcdir)/gdbsupport/gdb_vecs.c \
> -       $(srcdir)/gdbsupport/gdb_wait.c \
> -       $(srcdir)/gdbsupport/netstuff.c \
> -       $(srcdir)/gdbsupport/new-op.c \
> -       $(srcdir)/gdbsupport/pathstuff.c \
> -       $(srcdir)/gdbsupport/print-utils.c \
> -       $(srcdir)/gdbsupport/ptid.c \
> -       $(srcdir)/gdbsupport/rsp-low.c \
> -       $(srcdir)/gdbsupport/safe-strerror.c \
> -       $(srcdir)/gdbsupport/tdesc.c \
> -       $(srcdir)/gdbsupport/xml-utils.c \
> +       $(srcdir)/../../gdbsupport/btrace-common.c \
> +       $(srcdir)/../../gdbsupport/buffer.c \
> +       $(srcdir)/../../gdbsupport/cleanups.c \
> +       $(srcdir)/../../gdbsupport/common-debug.c \
> +       $(srcdir)/../../gdbsupport/common-exceptions.c \
> +       $(srcdir)/../../gdbsupport/common-inferior.c \
> +       $(srcdir)/../../gdbsupport/common-regcache.c \
> +       $(srcdir)/../../gdbsupport/common-utils.c \
> +       $(srcdir)/../../gdbsupport/errors.c \
> +       $(srcdir)/../../gdbsupport/environ.c \
> +       $(srcdir)/../../gdbsupport/fileio.c \
> +       $(srcdir)/../../gdbsupport/filestuff.c \
> +       $(srcdir)/../../gdbsupport/job-control.c \
> +       $(srcdir)/../../gdbsupport/gdb-dlfcn.c \
> +       $(srcdir)/../../gdbsupport/gdb_tilde_expand.c \
> +       $(srcdir)/../../gdbsupport/gdb_vecs.c \
> +       $(srcdir)/../../gdbsupport/gdb_wait.c \
> +       $(srcdir)/../../gdbsupport/netstuff.c \
> +       $(srcdir)/../../gdbsupport/new-op.c \
> +       $(srcdir)/../../gdbsupport/pathstuff.c \
> +       $(srcdir)/../../gdbsupport/print-utils.c \
> +       $(srcdir)/../../gdbsupport/ptid.c \
> +       $(srcdir)/../../gdbsupport/rsp-low.c \
> +       $(srcdir)/../../gdbsupport/safe-strerror.c \
> +       $(srcdir)/../../gdbsupport/tdesc.c \
> +       $(srcdir)/../../gdbsupport/xml-utils.c \
>         $(srcdir)/nat/aarch64-sve-linux-ptrace.c \
>         $(srcdir)/nat/linux-btrace.c \
>         $(srcdir)/nat/linux-namespaces.c \
> @@ -529,8 +531,8 @@ am--refresh:
>
>  force:
>
> -version-generated.c: Makefile $(srcdir)/../version.in $(srcdir)/../../bfd/version.h $(srcdir)/../gdbsupport/create-version.sh
> -       $(ECHO_GEN) $(SHELL) $(srcdir)/../gdbsupport/create-version.sh $(srcdir)/.. \
> +version-generated.c: Makefile $(srcdir)/../version.in $(srcdir)/../../bfd/version.h $(srcdir)/../../gdbsupport/create-version.sh
> +       $(ECHO_GEN) $(SHELL) $(srcdir)/../../gdbsupport/create-version.sh $(srcdir)/.. \
>                 $(host_alias) $(target_alias) $@
>
>  xml-builtin-generated.c: stamp-xml; @true
> @@ -588,7 +590,7 @@ arch/%-ipa.o: ../arch/%.c
>         $(IPAGENT_COMPILE) $<
>         $(POSTCOMPILE)
>
> -gdbsupport/%-ipa.o: ../gdbsupport/%.c
> +gdbsupport/%-ipa.o: ../../gdbsupport/%.c
>         $(IPAGENT_COMPILE) $<
>         $(POSTCOMPILE)
>
> @@ -621,7 +623,7 @@ arch/%.o: ../arch/%.c
>         $(COMPILE) $<
>         $(POSTCOMPILE)
>
> -gdbsupport/%.o: ../gdbsupport/%.c
> +gdbsupport/%.o: ../../gdbsupport/%.c
>         $(COMPILE) $<
>         $(POSTCOMPILE)
>
> diff --git a/gdb/gdbserver/acinclude.m4 b/gdb/gdbserver/acinclude.m4
> index 4c18e9b01db..a42f2d5e74a 100644
> --- a/gdb/gdbserver/acinclude.m4
> +++ b/gdb/gdbserver/acinclude.m4
> @@ -18,7 +18,7 @@ m4_include(../../config/lead-dot.m4)
>  dnl codeset.m4 is needed for common.m4, but not for
>  dnl anything else in gdbserver.
>  m4_include(../../config/codeset.m4)
> -m4_include(../gdbsupport/common.m4)
> +m4_include(../../gdbsupport/common.m4)
>
>  dnl For libiberty_INIT.
>  m4_include(../libiberty.m4)
> diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
> index 3ed18f1f372..263fb0efeac 100644
> --- a/gdb/gdbserver/gdbreplay.c
> +++ b/gdb/gdbserver/gdbreplay.c
> @@ -18,6 +18,14 @@
>     along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
>
>  #include "gdbsupport/common-defs.h"
> +
> +#undef PACKAGE
> +#undef PACKAGE_NAME
> +#undef PACKAGE_VERSION
> +#undef PACKAGE_STRING
> +#undef PACKAGE_TARNAME
> +
> +#include <config.h>
>  #include "gdbsupport/version.h"
>
>  #if HAVE_SYS_FILE_H
> diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
> index 0c74f99a161..3c286862349 100644
> --- a/gdb/gdbserver/server.h
> +++ b/gdb/gdbserver/server.h
> @@ -21,6 +21,14 @@
>
>  #include "gdbsupport/common-defs.h"
>
> +#undef PACKAGE
> +#undef PACKAGE_NAME
> +#undef PACKAGE_VERSION
> +#undef PACKAGE_STRING
> +#undef PACKAGE_TARNAME
> +
> +#include <config.h>
> +
>  gdb_static_assert (sizeof (CORE_ADDR) >= sizeof (void *));
>
>  #ifdef __MINGW32CE__
> diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c
> index 03fc85e2ece..3a3cd8d235d 100644
> --- a/gdb/nat/linux-btrace.c
> +++ b/gdb/nat/linux-btrace.c
> @@ -20,6 +20,14 @@
>     along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
>
>  #include "gdbsupport/common-defs.h"
> +
> +#undef PACKAGE
> +#undef PACKAGE_NAME
> +#undef PACKAGE_VERSION
> +#undef PACKAGE_STRING
> +#undef PACKAGE_TARNAME
> +
> +#include <config.h>
>  #include "linux-btrace.h"
>  #include "gdbsupport/common-regcache.h"
>  #include "gdbsupport/gdb_wait.h"
> diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
> index 5335d690922..859feb7ca87 100644
> --- a/gdb/nat/linux-ptrace.c
> +++ b/gdb/nat/linux-ptrace.c
> @@ -17,6 +17,14 @@
>     along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
>
>  #include "gdbsupport/common-defs.h"
> +
> +#undef PACKAGE
> +#undef PACKAGE_NAME
> +#undef PACKAGE_VERSION
> +#undef PACKAGE_STRING
> +#undef PACKAGE_TARNAME
> +
> +#include <config.h>
>  #include "linux-ptrace.h"
>  #include "linux-procfs.h"
>  #include "linux-waitpid.h"
> diff --git a/gdb/nat/x86-linux-dregs.c b/gdb/nat/x86-linux-dregs.c
> index b5dd71e3c7c..31683aab17c 100644
> --- a/gdb/nat/x86-linux-dregs.c
> +++ b/gdb/nat/x86-linux-dregs.c
> @@ -18,6 +18,14 @@
>     along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
>
>  #include "gdbsupport/common-defs.h"
> +
> +#undef PACKAGE
> +#undef PACKAGE_NAME
> +#undef PACKAGE_VERSION
> +#undef PACKAGE_STRING
> +#undef PACKAGE_TARNAME
> +
> +#include <config.h>
>  #include "nat/gdb_ptrace.h"
>  #include <sys/user.h>
>  #include "target/waitstatus.h"
> diff --git a/gdbsupport/ChangeLog b/gdbsupport/ChangeLog
> new file mode 100644
> index 00000000000..727b919bb08
> --- /dev/null
> +++ b/gdbsupport/ChangeLog
> @@ -0,0 +1,7 @@
> +2020-01-08  Tom Tromey  <[hidden email]>
> +
> +       * common-defs.h: Add GDBSERVER case.  Update includes.
> +       * acinclude.m4, aclocal.m4, config.in, configure, configure.ac,
> +       Makefile.am, Makefile.in, README: New files.
> +       * Moved from ../gdb/gdbsupport/
> +
> diff --git a/gdbsupport/Makefile.am b/gdbsupport/Makefile.am
> new file mode 100644
> index 00000000000..48e6079fb9f
> --- /dev/null
> +++ b/gdbsupport/Makefile.am
> @@ -0,0 +1,70 @@
> +## Process this file with automake to generate Makefile.in
> +#
> +#   Copyright (C) 2020 Free Software Foundation, Inc.
> +#
> +# This file is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; see the file COPYING3.  If not see
> +# <http://www.gnu.org/licenses/>.
> +#
> +
> +AUTOMAKE_OPTIONS = no-dist foreign
> +ACLOCAL_AMFLAGS = -I . -I ../config
> +
> +AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir)/../gdb \
> +    -I../gnulib/import -I$(srcdir)/../gnulib/import \
> +    -I.. -I$(srcdir)/.. $(INCINTL) -I../bfd -I$(srcdir)/../bfd
> +
> +override CC := $(CXX)
> +override CFLAGS := $(CXXFLAGS)
> +
> +noinst_LIBRARIES = libgdbsupport.a
> +
> +if SELFTEST
> +selftest = selftest.c
> +endif
> +
> +libgdbsupport_a_SOURCES = \
> +    agent.c \
> +    btrace-common.c \
> +    buffer.c \
> +    cleanups.c \
> +    common-debug.c \
> +    common-exceptions.c        \
> +    common-inferior.c \
> +    common-regcache.c \
> +    common-utils.c \
> +    environ.c \
> +    errors.c \
> +    fileio.c \
> +    filestuff.c        \
> +    format.c \
> +    gdb-dlfcn.c        \
> +    gdb_tilde_expand.c \
> +    gdb_wait.c \
> +    gdb_vecs.c \
> +    job-control.c \
> +    netstuff.c \
> +    new-op.c \
> +    pathstuff.c        \
> +    print-utils.c \
> +    ptid.c \
> +    rsp-low.c \
> +    run-time-clock.c \
> +    safe-strerror.c \
> +    scoped_mmap.c \
> +    signals.c \
> +    signals-state-save-restore.c \
> +    tdesc.c \
> +    thread-pool.c \
> +    xml-utils.c        \
> +    $(selftest)
> diff --git a/gdbsupport/README b/gdbsupport/README
> new file mode 100644
> index 00000000000..257dcea5af9
> --- /dev/null
> +++ b/gdbsupport/README
> @@ -0,0 +1,4 @@
> +This is a helper library that is used by gdb and gdbserver.
> +
> +To send patches, follow the gdb patch submission instructions in
> +../gdb/CONTRIBUTE.  For maintainers, see ../gdb/MAINTAINERS.
> diff --git a/gdbsupport/acinclude.m4 b/gdbsupport/acinclude.m4
> new file mode 100644
> index 00000000000..6e20e9cdb0a
> --- /dev/null
> +++ b/gdbsupport/acinclude.m4
> @@ -0,0 +1,5 @@
> +m4_include([common.m4])
> +m4_include([../config/ax_pthread.m4])
> +m4_include([../gdb/ax_cxx_compile_stdcxx.m4])
> +m4_include([../gdb/libiberty.m4])
> +m4_include([../gdb/selftest.m4])
> diff --git a/gdb/gdbsupport/agent.c b/gdbsupport/agent.c
> similarity index 100%
> rename from gdb/gdbsupport/agent.c
> rename to gdbsupport/agent.c
> diff --git a/gdb/gdbsupport/agent.h b/gdbsupport/agent.h
> similarity index 100%
> rename from gdb/gdbsupport/agent.h
> rename to gdbsupport/agent.h
> diff --git a/gdb/gdbsupport/alt-stack.h b/gdbsupport/alt-stack.h
> similarity index 100%
> rename from gdb/gdbsupport/alt-stack.h
> rename to gdbsupport/alt-stack.h
> diff --git a/gdb/gdbsupport/array-view.h b/gdbsupport/array-view.h
> similarity index 100%
> rename from gdb/gdbsupport/array-view.h
> rename to gdbsupport/array-view.h
> diff --git a/gdb/gdbsupport/ax.def b/gdbsupport/ax.def
> similarity index 100%
> rename from gdb/gdbsupport/ax.def
> rename to gdbsupport/ax.def
> diff --git a/gdb/gdbsupport/block-signals.h b/gdbsupport/block-signals.h
> similarity index 100%
> rename from gdb/gdbsupport/block-signals.h
> rename to gdbsupport/block-signals.h
> diff --git a/gdb/gdbsupport/break-common.h b/gdbsupport/break-common.h
> similarity index 100%
> rename from gdb/gdbsupport/break-common.h
> rename to gdbsupport/break-common.h
> diff --git a/gdb/gdbsupport/btrace-common.c b/gdbsupport/btrace-common.c
> similarity index 100%
> rename from gdb/gdbsupport/btrace-common.c
> rename to gdbsupport/btrace-common.c
> diff --git a/gdb/gdbsupport/btrace-common.h b/gdbsupport/btrace-common.h
> similarity index 100%
> rename from gdb/gdbsupport/btrace-common.h
> rename to gdbsupport/btrace-common.h
> diff --git a/gdb/gdbsupport/buffer.c b/gdbsupport/buffer.c
> similarity index 100%
> rename from gdb/gdbsupport/buffer.c
> rename to gdbsupport/buffer.c
> diff --git a/gdb/gdbsupport/buffer.h b/gdbsupport/buffer.h
> similarity index 100%
> rename from gdb/gdbsupport/buffer.h
> rename to gdbsupport/buffer.h
> diff --git a/gdb/gdbsupport/byte-vector.h b/gdbsupport/byte-vector.h
> similarity index 100%
> rename from gdb/gdbsupport/byte-vector.h
> rename to gdbsupport/byte-vector.h
> diff --git a/gdb/gdbsupport/cleanups.c b/gdbsupport/cleanups.c
> similarity index 100%
> rename from gdb/gdbsupport/cleanups.c
> rename to gdbsupport/cleanups.c
> diff --git a/gdb/gdbsupport/cleanups.h b/gdbsupport/cleanups.h
> similarity index 100%
> rename from gdb/gdbsupport/cleanups.h
> rename to gdbsupport/cleanups.h
> diff --git a/gdb/gdbsupport/common-debug.c b/gdbsupport/common-debug.c
> similarity index 100%
> rename from gdb/gdbsupport/common-debug.c
> rename to gdbsupport/common-debug.c
> diff --git a/gdb/gdbsupport/common-debug.h b/gdbsupport/common-debug.h
> similarity index 100%
> rename from gdb/gdbsupport/common-debug.h
> rename to gdbsupport/common-debug.h
> diff --git a/gdb/gdbsupport/common-defs.h b/gdbsupport/common-defs.h
> similarity index 95%
> rename from gdb/gdbsupport/common-defs.h
> rename to gdbsupport/common-defs.h
> index 214bca1ee17..d823c41607c 100644
> --- a/gdb/gdbsupport/common-defs.h
> +++ b/gdbsupport/common-defs.h
> @@ -20,24 +20,32 @@
>  #ifndef COMMON_COMMON_DEFS_H
>  #define COMMON_COMMON_DEFS_H
>
> -#include "config.h"
> +#ifdef GDBSERVER
> +
> +#include <build-gnulib-gdbserver/config.h>
>
>  #undef PACKAGE_NAME
> +#undef PACKAGE
>  #undef PACKAGE_VERSION
>  #undef PACKAGE_STRING
>  #undef PACKAGE_TARNAME
>
> -#ifdef GDBSERVER
> -#include "build-gnulib-gdbserver/config.h"
> -#else
> -#include "../../gnulib/config.h"
> -#endif
> +#include <config.h>
> +
> +#else  /* GDBSERVER */
> +
> +#include <gdbsupport/support-config.h>
>
>  #undef PACKAGE_NAME
> +#undef PACKAGE
>  #undef PACKAGE_VERSION
>  #undef PACKAGE_STRING
>  #undef PACKAGE_TARNAME
>
> +#include "gnulib/config.h"
> +
> +#endif /* GDBSERVER */
> +
>  /* From:
>      https://www.gnu.org/software/gnulib/manual/html_node/stdint_002eh.html
>
> diff --git a/gdb/gdbsupport/common-exceptions.c b/gdbsupport/common-exceptions.c
> similarity index 100%
> rename from gdb/gdbsupport/common-exceptions.c
> rename to gdbsupport/common-exceptions.c
> diff --git a/gdb/gdbsupport/common-exceptions.h b/gdbsupport/common-exceptions.h
> similarity index 100%
> rename from gdb/gdbsupport/common-exceptions.h
> rename to gdbsupport/common-exceptions.h
> diff --git a/gdb/gdbsupport/common-gdbthread.h b/gdbsupport/common-gdbthread.h
> similarity index 100%
> rename from gdb/gdbsupport/common-gdbthread.h
> rename to gdbsupport/common-gdbthread.h
> diff --git a/gdb/gdbsupport/common-inferior.c b/gdbsupport/common-inferior.c
> similarity index 100%
> rename from gdb/gdbsupport/common-inferior.c
> rename to gdbsupport/common-inferior.c
> diff --git a/gdb/gdbsupport/common-inferior.h b/gdbsupport/common-inferior.h
> similarity index 100%
> rename from gdb/gdbsupport/common-inferior.h
> rename to gdbsupport/common-inferior.h
> diff --git a/gdb/gdbsupport/common-regcache.c b/gdbsupport/common-regcache.c
> similarity index 100%
> rename from gdb/gdbsupport/common-regcache.c
> rename to gdbsupport/common-regcache.c
> diff --git a/gdb/gdbsupport/common-regcache.h b/gdbsupport/common-regcache.h
> similarity index 100%
> rename from gdb/gdbsupport/common-regcache.h
> rename to gdbsupport/common-regcache.h
> diff --git a/gdb/gdbsupport/common-types.h b/gdbsupport/common-types.h
> similarity index 100%
> rename from gdb/gdbsupport/common-types.h
> rename to gdbsupport/common-types.h
> diff --git a/gdb/gdbsupport/common-utils.c b/gdbsupport/common-utils.c
> similarity index 100%
> rename from gdb/gdbsupport/common-utils.c
> rename to gdbsupport/common-utils.c
> diff --git a/gdb/gdbsupport/common-utils.h b/gdbsupport/common-utils.h
> similarity index 100%
> rename from gdb/gdbsupport/common-utils.h
> rename to gdbsupport/common-utils.h
> diff --git a/gdb/gdbsupport/common.m4 b/gdbsupport/common.m4
> similarity index 100%
> rename from gdb/gdbsupport/common.m4
> rename to gdbsupport/common.m4
> diff --git a/gdbsupport/configure.ac b/gdbsupport/configure.ac
> new file mode 100644
> index 00000000000..1dfed3cdc51
> --- /dev/null
> +++ b/gdbsupport/configure.ac
> @@ -0,0 +1,63 @@
> +dnl Autoconf configure script for GDB support library
> +dnl Copyright (C) 2020 Free Software Foundation, Inc.
> +dnl
> +dnl This program is free software; you can redistribute it and/or modify
> +dnl it under the terms of the GNU General Public License as published by
> +dnl the Free Software Foundation; either version 3 of the License, or
> +dnl (at your option) any later version.
> +dnl
> +dnl This program is distributed in the hope that it will be useful,
> +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
> +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +dnl GNU General Public License for more details.
> +dnl
> +dnl You should have received a copy of the GNU General Public License
> +dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +
> +dnl Process this file with autoconf to produce a configure script.
> +
> +AC_INIT([gdbsupport], 1.0)
> +AC_CONFIG_SRCDIR(common-defs.h)
> +AC_CONFIG_HEADER(support-config.h:config.in)
> +AC_CANONICAL_SYSTEM
> +AM_MAINTAINER_MODE
> +AC_CONFIG_AUX_DIR(..)
> +AM_INIT_AUTOMAKE
> +AM_SILENT_RULES([yes])
> +
> +AC_PROG_CC
> +AC_PROG_CXX
> +AC_PROG_RANLIB
> +
> +AC_USE_SYSTEM_EXTENSIONS
> +ACX_LARGEFILE
> +AM_PROG_CC_STDC
> +
> +# We require a C++11 compiler.  Check if one is available, and if
> +# necessary, set CXX_DIALECT to some -std=xxx switch.
> +AX_CXX_COMPILE_STDCXX(11, , mandatory)
> +
> +dnl Set up for gettext.
> +ZW_GNU_GETTEXT_SISTER_DIR
> +
> +libiberty_INIT
> +GDB_AC_COMMON
> +GDB_AC_SELFTEST
> +AM_CONDITIONAL(SELFTEST, $enable_unittests)
> +
> +TARGET_WORD_SIZE=`sed -n 's,#define BFD_ARCH_SIZE \(.*\)$,\1,p' ../bfd/bfd-in3.h`
> +AC_DEFINE_UNQUOTED(TARGET_WORD_SIZE, $TARGET_WORD_SIZE,
> +   [Define to the word size for the target.])
> +
> +case ${host} in
> +  *mingw32*)
> +    AC_DEFINE(USE_WIN32API, 1,
> +              [Define if we should use the Windows API, instead of the
> +              POSIX API.  On Windows, we use the Windows API when
> +              building for MinGW, but the POSIX API when building
> +              for Cygwin.])
> +    ;;
> +esac
> +
> +AC_CONFIG_FILES([Makefile])
> +AC_OUTPUT
> diff --git a/gdb/gdbsupport/create-version.sh b/gdbsupport/create-version.sh
> similarity index 100%
> rename from gdb/gdbsupport/create-version.sh
> rename to gdbsupport/create-version.sh
> diff --git a/gdb/gdbsupport/def-vector.h b/gdbsupport/def-vector.h
> similarity index 100%
> rename from gdb/gdbsupport/def-vector.h
> rename to gdbsupport/def-vector.h
> diff --git a/gdb/gdbsupport/default-init-alloc.h b/gdbsupport/default-init-alloc.h
> similarity index 100%
> rename from gdb/gdbsupport/default-init-alloc.h
> rename to gdbsupport/default-init-alloc.h
> diff --git a/gdb/gdbsupport/enum-flags.h b/gdbsupport/enum-flags.h
> similarity index 100%
> rename from gdb/gdbsupport/enum-flags.h
> rename to gdbsupport/enum-flags.h
> diff --git a/gdb/gdbsupport/environ.c b/gdbsupport/environ.c
> similarity index 100%
> rename from gdb/gdbsupport/environ.c
> rename to gdbsupport/environ.c
> diff --git a/gdb/gdbsupport/environ.h b/gdbsupport/environ.h
> similarity index 100%
> rename from gdb/gdbsupport/environ.h
> rename to gdbsupport/environ.h
> diff --git a/gdb/gdbsupport/errors.c b/gdbsupport/errors.c
> similarity index 100%
> rename from gdb/gdbsupport/errors.c
> rename to gdbsupport/errors.c
> diff --git a/gdb/gdbsupport/errors.h b/gdbsupport/errors.h
> similarity index 100%
> rename from gdb/gdbsupport/errors.h
> rename to gdbsupport/errors.h
> diff --git a/gdb/gdbsupport/fileio.c b/gdbsupport/fileio.c
> similarity index 100%
> rename from gdb/gdbsupport/fileio.c
> rename to gdbsupport/fileio.c
> diff --git a/gdb/gdbsupport/fileio.h b/gdbsupport/fileio.h
> similarity index 100%
> rename from gdb/gdbsupport/fileio.h
> rename to gdbsupport/fileio.h
> diff --git a/gdb/gdbsupport/filestuff.c b/gdbsupport/filestuff.c
> similarity index 100%
> rename from gdb/gdbsupport/filestuff.c
> rename to gdbsupport/filestuff.c
> diff --git a/gdb/gdbsupport/filestuff.h b/gdbsupport/filestuff.h
> similarity index 100%
> rename from gdb/gdbsupport/filestuff.h
> rename to gdbsupport/filestuff.h
> diff --git a/gdb/gdbsupport/filtered-iterator.h b/gdbsupport/filtered-iterator.h
> similarity index 100%
> rename from gdb/gdbsupport/filtered-iterator.h
> rename to gdbsupport/filtered-iterator.h
> diff --git a/gdb/gdbsupport/format.c b/gdbsupport/format.c
> similarity index 100%
> rename from gdb/gdbsupport/format.c
> rename to gdbsupport/format.c
> diff --git a/gdb/gdbsupport/format.h b/gdbsupport/format.h
> similarity index 100%
> rename from gdb/gdbsupport/format.h
> rename to gdbsupport/format.h
> diff --git a/gdb/gdbsupport/forward-scope-exit.h b/gdbsupport/forward-scope-exit.h
> similarity index 100%
> rename from gdb/gdbsupport/forward-scope-exit.h
> rename to gdbsupport/forward-scope-exit.h
> diff --git a/gdb/gdbsupport/function-view.h b/gdbsupport/function-view.h
> similarity index 100%
> rename from gdb/gdbsupport/function-view.h
> rename to gdbsupport/function-view.h
> diff --git a/gdb/gdbsupport/gdb-dlfcn.c b/gdbsupport/gdb-dlfcn.c
> similarity index 100%
> rename from gdb/gdbsupport/gdb-dlfcn.c
> rename to gdbsupport/gdb-dlfcn.c
> diff --git a/gdb/gdbsupport/gdb-dlfcn.h b/gdbsupport/gdb-dlfcn.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb-dlfcn.h
> rename to gdbsupport/gdb-dlfcn.h
> diff --git a/gdb/gdbsupport/gdb-sigmask.h b/gdbsupport/gdb-sigmask.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb-sigmask.h
> rename to gdbsupport/gdb-sigmask.h
> diff --git a/gdb/gdbsupport/gdb_assert.h b/gdbsupport/gdb_assert.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_assert.h
> rename to gdbsupport/gdb_assert.h
> diff --git a/gdb/gdbsupport/gdb_binary_search.h b/gdbsupport/gdb_binary_search.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_binary_search.h
> rename to gdbsupport/gdb_binary_search.h
> diff --git a/gdb/gdbsupport/gdb_locale.h b/gdbsupport/gdb_locale.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_locale.h
> rename to gdbsupport/gdb_locale.h
> diff --git a/gdb/gdbsupport/gdb_optional.h b/gdbsupport/gdb_optional.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_optional.h
> rename to gdbsupport/gdb_optional.h
> diff --git a/gdb/gdbsupport/gdb_proc_service.h b/gdbsupport/gdb_proc_service.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_proc_service.h
> rename to gdbsupport/gdb_proc_service.h
> diff --git a/gdb/gdbsupport/gdb_ref_ptr.h b/gdbsupport/gdb_ref_ptr.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_ref_ptr.h
> rename to gdbsupport/gdb_ref_ptr.h
> diff --git a/gdb/gdbsupport/gdb_setjmp.h b/gdbsupport/gdb_setjmp.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_setjmp.h
> rename to gdbsupport/gdb_setjmp.h
> diff --git a/gdb/gdbsupport/gdb_signals.h b/gdbsupport/gdb_signals.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_signals.h
> rename to gdbsupport/gdb_signals.h
> diff --git a/gdb/gdbsupport/gdb_splay_tree.h b/gdbsupport/gdb_splay_tree.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_splay_tree.h
> rename to gdbsupport/gdb_splay_tree.h
> diff --git a/gdb/gdbsupport/gdb_string_view.h b/gdbsupport/gdb_string_view.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_string_view.h
> rename to gdbsupport/gdb_string_view.h
> diff --git a/gdb/gdbsupport/gdb_string_view.tcc b/gdbsupport/gdb_string_view.tcc
> similarity index 100%
> rename from gdb/gdbsupport/gdb_string_view.tcc
> rename to gdbsupport/gdb_string_view.tcc
> diff --git a/gdb/gdbsupport/gdb_sys_time.h b/gdbsupport/gdb_sys_time.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_sys_time.h
> rename to gdbsupport/gdb_sys_time.h
> diff --git a/gdb/gdbsupport/gdb_tilde_expand.c b/gdbsupport/gdb_tilde_expand.c
> similarity index 100%
> rename from gdb/gdbsupport/gdb_tilde_expand.c
> rename to gdbsupport/gdb_tilde_expand.c
> diff --git a/gdb/gdbsupport/gdb_tilde_expand.h b/gdbsupport/gdb_tilde_expand.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_tilde_expand.h
> rename to gdbsupport/gdb_tilde_expand.h
> diff --git a/gdb/gdbsupport/gdb_unique_ptr.h b/gdbsupport/gdb_unique_ptr.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_unique_ptr.h
> rename to gdbsupport/gdb_unique_ptr.h
> diff --git a/gdb/gdbsupport/gdb_unlinker.h b/gdbsupport/gdb_unlinker.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_unlinker.h
> rename to gdbsupport/gdb_unlinker.h
> diff --git a/gdb/gdbsupport/gdb_vecs.c b/gdbsupport/gdb_vecs.c
> similarity index 100%
> rename from gdb/gdbsupport/gdb_vecs.c
> rename to gdbsupport/gdb_vecs.c
> diff --git a/gdb/gdbsupport/gdb_vecs.h b/gdbsupport/gdb_vecs.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_vecs.h
> rename to gdbsupport/gdb_vecs.h
> diff --git a/gdb/gdbsupport/gdb_wait.c b/gdbsupport/gdb_wait.c
> similarity index 100%
> rename from gdb/gdbsupport/gdb_wait.c
> rename to gdbsupport/gdb_wait.c
> diff --git a/gdb/gdbsupport/gdb_wait.h b/gdbsupport/gdb_wait.h
> similarity index 100%
> rename from gdb/gdbsupport/gdb_wait.h
> rename to gdbsupport/gdb_wait.h
> diff --git a/gdb/gdbsupport/hash_enum.h b/gdbsupport/hash_enum.h
> similarity index 100%
> rename from gdb/gdbsupport/hash_enum.h
> rename to gdbsupport/hash_enum.h
> diff --git a/gdb/gdbsupport/host-defs.h b/gdbsupport/host-defs.h
> similarity index 100%
> rename from gdb/gdbsupport/host-defs.h
> rename to gdbsupport/host-defs.h
> diff --git a/gdb/gdbsupport/job-control.c b/gdbsupport/job-control.c
> similarity index 100%
> rename from gdb/gdbsupport/job-control.c
> rename to gdbsupport/job-control.c
> diff --git a/gdb/gdbsupport/job-control.h b/gdbsupport/job-control.h
> similarity index 100%
> rename from gdb/gdbsupport/job-control.h
> rename to gdbsupport/job-control.h
> diff --git a/gdb/gdbsupport/netstuff.c b/gdbsupport/netstuff.c
> similarity index 100%
> rename from gdb/gdbsupport/netstuff.c
> rename to gdbsupport/netstuff.c
> diff --git a/gdb/gdbsupport/netstuff.h b/gdbsupport/netstuff.h
> similarity index 100%
> rename from gdb/gdbsupport/netstuff.h
> rename to gdbsupport/netstuff.h
> diff --git a/gdb/gdbsupport/new-op.c b/gdbsupport/new-op.c
> similarity index 100%
> rename from gdb/gdbsupport/new-op.c
> rename to gdbsupport/new-op.c
> diff --git a/gdb/gdbsupport/next-iterator.h b/gdbsupport/next-iterator.h
> similarity index 100%
> rename from gdb/gdbsupport/next-iterator.h
> rename to gdbsupport/next-iterator.h
> diff --git a/gdb/gdbsupport/observable.h b/gdbsupport/observable.h
> similarity index 100%
> rename from gdb/gdbsupport/observable.h
> rename to gdbsupport/observable.h
> diff --git a/gdb/gdbsupport/offset-type.h b/gdbsupport/offset-type.h
> similarity index 100%
> rename from gdb/gdbsupport/offset-type.h
> rename to gdbsupport/offset-type.h
> diff --git a/gdb/gdbsupport/parallel-for.h b/gdbsupport/parallel-for.h
> similarity index 100%
> rename from gdb/gdbsupport/parallel-for.h
> rename to gdbsupport/parallel-for.h
> diff --git a/gdb/gdbsupport/pathstuff.c b/gdbsupport/pathstuff.c
> similarity index 100%
> rename from gdb/gdbsupport/pathstuff.c
> rename to gdbsupport/pathstuff.c
> diff --git a/gdb/gdbsupport/pathstuff.h b/gdbsupport/pathstuff.h
> similarity index 100%
> rename from gdb/gdbsupport/pathstuff.h
> rename to gdbsupport/pathstuff.h
> diff --git a/gdb/gdbsupport/poison.h b/gdbsupport/poison.h
> similarity index 100%
> rename from gdb/gdbsupport/poison.h
> rename to gdbsupport/poison.h
> diff --git a/gdb/gdbsupport/preprocessor.h b/gdbsupport/preprocessor.h
> similarity index 100%
> rename from gdb/gdbsupport/preprocessor.h
> rename to gdbsupport/preprocessor.h
> diff --git a/gdb/gdbsupport/print-utils.c b/gdbsupport/print-utils.c
> similarity index 100%
> rename from gdb/gdbsupport/print-utils.c
> rename to gdbsupport/print-utils.c
> diff --git a/gdb/gdbsupport/print-utils.h b/gdbsupport/print-utils.h
> similarity index 100%
> rename from gdb/gdbsupport/print-utils.h
> rename to gdbsupport/print-utils.h
> diff --git a/gdb/gdbsupport/ptid.c b/gdbsupport/ptid.c
> similarity index 100%
> rename from gdb/gdbsupport/ptid.c
> rename to gdbsupport/ptid.c
> diff --git a/gdb/gdbsupport/ptid.h b/gdbsupport/ptid.h
> similarity index 100%
> rename from gdb/gdbsupport/ptid.h
> rename to gdbsupport/ptid.h
> diff --git a/gdb/gdbsupport/refcounted-object.h b/gdbsupport/refcounted-object.h
> similarity index 100%
> rename from gdb/gdbsupport/refcounted-object.h
> rename to gdbsupport/refcounted-object.h
> diff --git a/gdb/gdbsupport/rsp-low.c b/gdbsupport/rsp-low.c
> similarity index 100%
> rename from gdb/gdbsupport/rsp-low.c
> rename to gdbsupport/rsp-low.c
> diff --git a/gdb/gdbsupport/rsp-low.h b/gdbsupport/rsp-low.h
> similarity index 100%
> rename from gdb/gdbsupport/rsp-low.h
> rename to gdbsupport/rsp-low.h
> diff --git a/gdb/gdbsupport/run-time-clock.c b/gdbsupport/run-time-clock.c
> similarity index 100%
> rename from gdb/gdbsupport/run-time-clock.c
> rename to gdbsupport/run-time-clock.c
> diff --git a/gdb/gdbsupport/run-time-clock.h b/gdbsupport/run-time-clock.h
> similarity index 100%
> rename from gdb/gdbsupport/run-time-clock.h
> rename to gdbsupport/run-time-clock.h
> diff --git a/gdb/gdbsupport/safe-iterator.h b/gdbsupport/safe-iterator.h
> similarity index 100%
> rename from gdb/gdbsupport/safe-iterator.h
> rename to gdbsupport/safe-iterator.h
> diff --git a/gdb/gdbsupport/safe-strerror.c b/gdbsupport/safe-strerror.c
> similarity index 100%
> rename from gdb/gdbsupport/safe-strerror.c
> rename to gdbsupport/safe-strerror.c
> diff --git a/gdb/gdbsupport/scope-exit.h b/gdbsupport/scope-exit.h
> similarity index 100%
> rename from gdb/gdbsupport/scope-exit.h
> rename to gdbsupport/scope-exit.h
> diff --git a/gdb/gdbsupport/scoped_fd.h b/gdbsupport/scoped_fd.h
> similarity index 100%
> rename from gdb/gdbsupport/scoped_fd.h
> rename to gdbsupport/scoped_fd.h
> diff --git a/gdb/gdbsupport/scoped_mmap.c b/gdbsupport/scoped_mmap.c
> similarity index 100%
> rename from gdb/gdbsupport/scoped_mmap.c
> rename to gdbsupport/scoped_mmap.c
> diff --git a/gdb/gdbsupport/scoped_mmap.h b/gdbsupport/scoped_mmap.h
> similarity index 100%
> rename from gdb/gdbsupport/scoped_mmap.h
> rename to gdbsupport/scoped_mmap.h
> diff --git a/gdb/gdbsupport/scoped_restore.h b/gdbsupport/scoped_restore.h
> similarity index 100%
> rename from gdb/gdbsupport/scoped_restore.h
> rename to gdbsupport/scoped_restore.h
> diff --git a/gdb/gdbsupport/selftest.c b/gdbsupport/selftest.c
> similarity index 100%
> rename from gdb/gdbsupport/selftest.c
> rename to gdbsupport/selftest.c
> diff --git a/gdb/gdbsupport/selftest.h b/gdbsupport/selftest.h
> similarity index 100%
> rename from gdb/gdbsupport/selftest.h
> rename to gdbsupport/selftest.h
> diff --git a/gdb/gdbsupport/signals-state-save-restore.c b/gdbsupport/signals-state-save-restore.c
> similarity index 100%
> rename from gdb/gdbsupport/signals-state-save-restore.c
> rename to gdbsupport/signals-state-save-restore.c
> diff --git a/gdb/gdbsupport/signals-state-save-restore.h b/gdbsupport/signals-state-save-restore.h
> similarity index 100%
> rename from gdb/gdbsupport/signals-state-save-restore.h
> rename to gdbsupport/signals-state-save-restore.h
> diff --git a/gdb/gdbsupport/signals.c b/gdbsupport/signals.c
> similarity index 100%
> rename from gdb/gdbsupport/signals.c
> rename to gdbsupport/signals.c
> diff --git a/gdb/gdbsupport/symbol.h b/gdbsupport/symbol.h
> similarity index 100%
> rename from gdb/gdbsupport/symbol.h
> rename to gdbsupport/symbol.h
> diff --git a/gdb/gdbsupport/tdesc.c b/gdbsupport/tdesc.c
> similarity index 100%
> rename from gdb/gdbsupport/tdesc.c
> rename to gdbsupport/tdesc.c
> diff --git a/gdb/gdbsupport/tdesc.h b/gdbsupport/tdesc.h
> similarity index 100%
> rename from gdb/gdbsupport/tdesc.h
> rename to gdbsupport/tdesc.h
> diff --git a/gdb/gdbsupport/thread-pool.c b/gdbsupport/thread-pool.c
> similarity index 100%
> rename from gdb/gdbsupport/thread-pool.c
> rename to gdbsupport/thread-pool.c
> diff --git a/gdb/gdbsupport/thread-pool.h b/gdbsupport/thread-pool.h
> similarity index 100%
> rename from gdb/gdbsupport/thread-pool.h
> rename to gdbsupport/thread-pool.h
> diff --git a/gdb/gdbsupport/traits.h b/gdbsupport/traits.h
> similarity index 100%
> rename from gdb/gdbsupport/traits.h
> rename to gdbsupport/traits.h
> diff --git a/gdb/gdbsupport/underlying.h b/gdbsupport/underlying.h
> similarity index 100%
> rename from gdb/gdbsupport/underlying.h
> rename to gdbsupport/underlying.h
> diff --git a/gdb/gdbsupport/valid-expr.h b/gdbsupport/valid-expr.h
> similarity index 100%
> rename from gdb/gdbsupport/valid-expr.h
> rename to gdbsupport/valid-expr.h
> diff --git a/gdb/gdbsupport/version.h b/gdbsupport/version.h
> similarity index 100%
> rename from gdb/gdbsupport/version.h
> rename to gdbsupport/version.h
> diff --git a/gdb/gdbsupport/x86-xstate.h b/gdbsupport/x86-xstate.h
> similarity index 100%
> rename from gdb/gdbsupport/x86-xstate.h
> rename to gdbsupport/x86-xstate.h
> diff --git a/gdb/gdbsupport/xml-utils.c b/gdbsupport/xml-utils.c
> similarity index 100%
> rename from gdb/gdbsupport/xml-utils.c
> rename to gdbsupport/xml-utils.c
> diff --git a/gdb/gdbsupport/xml-utils.h b/gdbsupport/xml-utils.h
> similarity index 100%
> rename from gdb/gdbsupport/xml-utils.h
> rename to gdbsupport/xml-utils.h
> diff --git a/src-release.sh b/src-release.sh
> index 275f0f24b5d..92e92ac5d77 100755
> --- a/src-release.sh
> +++ b/src-release.sh
> @@ -1,5 +1,5 @@
>  #!/usr/bin/env bash
> -#   Copyright (C) 1990-2018 Free Software Foundation
> +#   Copyright (C) 1990-2019 Free Software Foundation
>  #
>  # This file is free software; you can redistribute it and/or modify
>  # it under the terms of the GNU General Public License as published by
> @@ -315,7 +315,7 @@ gas_release()
>      tar_compress $package $tool "$GAS_SUPPORT_DIRS" "$compressors"
>  }
>
> -GDB_SUPPORT_DIRS="bfd include libiberty libctf opcodes readline sim intl libdecnumber cpu zlib contrib gnulib"
> +GDB_SUPPORT_DIRS="bfd include libiberty libctf opcodes readline sim intl libdecnumber cpu zlib contrib gnulib gdbsupport"
>  gdb_release()
>  {
>      compressors=$1
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Pedro Alves-7
In reply to this post by Pedro Alves-7
On 1/15/20 8:23 PM, Pedro Alves wrote:

> On 1/15/20 2:55 PM, Pedro Alves wrote:
>> On 1/15/20 2:41 PM, Pedro Alves wrote:
>>> Don't know what I think of gnulib headers including <config.h>.
>>> Maybe we should rename gdb's config.h to gdb-config.h too.
>>
>> Hit reply to soon.  I meant to add,
>>
>> ... and then, add a manually-written config.h in the build
>> dir that does:
>>
>>  #include <gdbsupport/support-config.h>
>>  #include <gdb-config.h>
>>
>> We'd do the same to gdbsupport, add a config.h in its
>> build dir that does:
>>
>>  #include "gnulib/config.h"
>>  #include <support-config.h>
>>
>> Those config.h files would go in the build dirs so that
>> they're not picked by other build directories.
>>
>> With that, any "#include <config.h>" in any header ends up
>> picking the currently-being-built project's config.h, plus
>> the dependencies' config.h files.
>>
>> Just a half-baked thought.  Not sure it's the best idea.
>
> I tried it and it seems to work OK.  Fixes the build at least.
> Still not sure it's the best idea.  WDYT?
>
> The patch is actually quite small, but since I've rename
> config.h -> gdb-config.h etc., and _then_ added new config.h
> files, git doesn't notice the renames.
>
> I wonder whether there's anything could do to stop gnulib and
> gdbsupport's configure from defining PACKAGE_NAME etc. in their
> generated config.h files.
>
Here's an improved version, which fixes gdbserver's standalone
build, simplifies gdbsupport's config.h (there's no need for
#ifdef GDBSERVER stuff since gdbserver doesn't use gdbsupport
as a library yet), and adds copyright/intro comments.

From 15a6348cb2fa7d59d58ab1bd7e77d8e7a6474ea4 Mon Sep 17 00:00:00 2001
From: Pedro Alves <[hidden email]>
Date: Wed, 15 Jan 2020 17:49:01 +0000
Subject: [PATCH] config.h

---
 gdb/Makefile.in                       |   6 +-
 gdb/config.in                         | 824 ++--------------------------------
 gdb/configure                         |   9 +-
 gdb/configure.ac                      |   3 +-
 gdb/gdb-config.in                     | 811 +++++++++++++++++++++++++++++++++
 gdb/gdbserver/config.in               | 506 +--------------------
 gdb/gdbserver/configure               |   9 +-
 gdb/gdbserver/configure.ac            |   3 +-
 gdb/gdbserver/gdbserver-config.in     | 496 ++++++++++++++++++++
 gdb/unittests/scoped_fd-selftests.c   |   1 -
 gdb/unittests/scoped_mmap-selftests.c |   1 -
 gdbsupport/common-defs.h              |  24 -
 gdbsupport/config.in                  | 425 +-----------------
 gdbsupport/configure                  |  95 ++--
 gdbsupport/configure.ac               |   3 +-
 gdbsupport/support-config.in          | 414 +++++++++++++++++
 16 files changed, 1861 insertions(+), 1769 deletions(-)
 create mode 100644 gdb/gdb-config.in
 create mode 100644 gdb/gdbserver/gdbserver-config.in
 create mode 100644 gdbsupport/support-config.in

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 45d1586e85e..b7e1532c957 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1974,9 +1974,9 @@ gdb-gdb.py: $(srcdir)/gdb-gdb.py.in
 gdb-gdb.gdb: $(srcdir)/gdb-gdb.gdb.in
  $(SHELL) config.status $@
 
-config.h: stamp-h ; @true
-stamp-h: $(srcdir)/config.in config.status
- $(SHELL) config.status config.h
+gdb-config.h: stamp-h ; @true
+stamp-h: $(srcdir)/gdb-config.in config.status
+ $(SHELL) config.status gdb-config.h
 
 nm.h: stamp-nmh ; @true
 stamp-nmh: config.status
diff --git a/gdb/config.in b/gdb/config.in
index cb886ba8e1a..a178f1a87d6 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -1,811 +1,41 @@
-/* config.in.  Generated from configure.ac by autoheader.  */
+/* config.h for GDB, the GNU debugger.
+   Copyright (C) 2020 Free Software Foundation, Inc.
 
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
+   This file is part of GDB.
 
-/* Directories from which to load auto-loaded scripts. */
-#undef AUTO_LOAD_DIR
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
 
-/* Directories safe to hold auto-loaded files. */
-#undef AUTO_LOAD_SAFE_PATH
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-/* Directory of programs. */
-#undef BINDIR
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
-   systems. This function is required for `alloca.c' support on those systems.
-   */
-#undef CRAY_STACKSEG_END
+/* This file is automatically generated from config.in.  It exists so
+   that "#include <config.h>" in header files (including gnulib
+   headers), includes this file, which then includes our real config.h
+   (which is called gdb-config.h), along with gnulib's config.h and
+   gdbsupport's config.h.  */
 
-/* Define to 1 if std::thread works. */
-#undef CXX_STD_THREAD
+#include "gnulib/config.h"
 
-/* Define to 1 if using `alloca.c'. */
-#undef C_ALLOCA
-
-/* look for global separate debug info in this path [LIBDIR/debug] */
-#undef DEBUGDIR
-
-/* Define if the separate-debug-dir directory should be relocated when GDB is
-   moved. */
-#undef DEBUGDIR_RELOCATABLE
-
-/* Define to BFD's default architecture. */
-#undef DEFAULT_BFD_ARCH
-
-/* Define to BFD's default target vector. */
-#undef DEFAULT_BFD_VEC
-
-/* Define to 1 if translation of program messages to the user's native
-   language is requested. */
-#undef ENABLE_NLS
-
-/* The .gdbinit filename. */
-#undef GDBINIT
-
-/* look for global separate data files in this path [DATADIR/gdb] */
-#undef GDB_DATADIR
-
-/* Define if the gdb-datadir directory should be relocated when GDB is moved.
-   */
-#undef GDB_DATADIR_RELOCATABLE
-
-/* Define to be a string naming the default host character set. */
-#undef GDB_DEFAULT_HOST_CHARSET
-
-/* Host double floatformat */
-#undef GDB_HOST_DOUBLE_FORMAT
-
-/* Host float floatformat */
-#undef GDB_HOST_FLOAT_FORMAT
-
-/* Host long double floatformat */
-#undef GDB_HOST_LONG_DOUBLE_FORMAT
-
-/* nativefile */
-#undef GDB_NM_FILE
-
-/* Define to the default OS ABI for this configuration. */
-#undef GDB_OSABI_DEFAULT
-
-/* Define if self-testing features should be enabled */
-#undef GDB_SELF_TEST
-
-/* Define to 1 if you have `alloca', as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
-   */
-#undef HAVE_ALLOCA_H
-
-/* Define to 1 if you have the `btowc' function. */
-#undef HAVE_BTOWC
-
-/* Define to 1 if you have the <cursesX.h> header file. */
-#undef HAVE_CURSESX_H
-
-/* Define to 1 if you have the <curses.h> header file. */
-#undef HAVE_CURSES_H
-
-/* define if the compiler supports basic C++11 syntax */
-#undef HAVE_CXX11
-
-/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
-   you don't. */
-#undef HAVE_DECL_ADDR_NO_RANDOMIZE
-
-/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_ASPRINTF
-
-/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if
-   you don't. */
-#undef HAVE_DECL_BASENAME
-
-/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
-#undef HAVE_DECL_FFS
-
-/* Define to 1 if you have the declaration of `getthrds', and to 0 if you
-   don't. */
-#undef HAVE_DECL_GETTHRDS
-
-/* Define to 1 if you have the declaration of `ptrace', and to 0 if you don't.
-   */
-#undef HAVE_DECL_PTRACE
-
-/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_SNPRINTF
-
-/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
-   */
-#undef HAVE_DECL_STRSTR
-
-/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
-   */
-#undef HAVE_DECL_STRTOL
-
-/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOLL
-
-/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOUL
-
-/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOULL
-
-/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRVERSCMP
-
-/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_VASPRINTF
-
-/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_VSNPRINTF
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define if ELF support should be included. */
-#undef HAVE_ELF
-
-/* Define if <sys/procfs.h> has elf_fpregset_t. */
-#undef HAVE_ELF_FPREGSET_T
-
-/* Define to 1 if you have the <elf_hp.h> header file. */
-#undef HAVE_ELF_HP_H
-
-/* Define to 1 if your system has the etext variable. */
-#undef HAVE_ETEXT
-
-/* Define to 1 if you have the `fdwalk' function. */
-#undef HAVE_FDWALK
-
-/* Define to 1 if you have the `fork' function. */
-#undef HAVE_FORK
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#undef HAVE_FPREGSET_T
-
-/* Define to 1 if you have the `getauxval' function. */
-#undef HAVE_GETAUXVAL
-
-/* Define to 1 if you have the `getgid' function. */
-#undef HAVE_GETGID
-
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define to 1 if you have the `getpgid' function. */
-#undef HAVE_GETPGID
-
-/* Define to 1 if you have the `getrlimit' function. */
-#undef HAVE_GETRLIMIT
-
-/* Define to 1 if you have the `getrusage' function. */
-#undef HAVE_GETRUSAGE
-
-/* Define to 1 if you have the `getuid' function. */
-#undef HAVE_GETUID
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#undef HAVE_GREGSET_T
-
-/* Define if Guile interpreter is being linked in. */
-#undef HAVE_GUILE
-
-/* Define if Guile supports manual finalization. */
-#undef HAVE_GUILE_MANUAL_FINALIZATION
-
-/* Define if you have the iconv() function. */
-#undef HAVE_ICONV
-
-/* Define to 1 if you have the `iconvlist' function. */
-#undef HAVE_ICONVLIST
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if your system has the kinfo_getfile function. */
-#undef HAVE_KINFO_GETFILE
-
-/* Define to 1 if your system has the kinfo_getvmmap function. */
-#undef HAVE_KINFO_GETVMMAP
-
-/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
-#undef HAVE_LANGINFO_CODESET
-
-/* Define if your <locale.h> file defines LC_MESSAGES. */
-#undef HAVE_LC_MESSAGES
-
-/* Define if you have the babeltrace library. */
-#undef HAVE_LIBBABELTRACE
-
-/* Define if you have the expat library. */
-#undef HAVE_LIBEXPAT
-
-/* Define to 1 if you have the `libiconvlist' function. */
-#undef HAVE_LIBICONVLIST
-
-/* Define if you have the ipt library. */
-#undef HAVE_LIBIPT
-
-/* Define if you have the lzma library. */
-#undef HAVE_LIBLZMA
-
-/* Define to 1 if you have the `m' library (-lm). */
-#undef HAVE_LIBM
-
-/* Define if you have the mpfr library. */
-#undef HAVE_LIBMPFR
-
-/* Define to 1 if you have the <libunwind-ia64.h> header file. */
-#undef HAVE_LIBUNWIND_IA64_H
-
-/* Define if you have the xxhash library. */
-#undef HAVE_LIBXXHASH
-
-/* Define to 1 if you have the <linux/elf.h> header file. */
-#undef HAVE_LINUX_ELF_H
-
-/* Define to 1 if you have the <linux/perf_event.h> header file. */
-#undef HAVE_LINUX_PERF_EVENT_H
-
-/* Define to 1 if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
-/* Define to 1 if the compiler supports long double. */
-#undef HAVE_LONG_DOUBLE
-
-/* Define to 1 if the system has the type `long long'. */
-#undef HAVE_LONG_LONG
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#undef HAVE_LWPID_T
-
-/* Define to 1 if you have the <machine/reg.h> header file. */
-#undef HAVE_MACHINE_REG_H
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define to 1 if you have the `monstartup' function. */
-#undef HAVE_MONSTARTUP
-
-/* Define to 1 if you have the <ncursesw/ncurses.h> header file. */
-#undef HAVE_NCURSESW_NCURSES_H
-
-/* Define to 1 if you have the <ncurses.h> header file. */
-#undef HAVE_NCURSES_H
-
-/* Define to 1 if you have the <ncurses/ncurses.h> header file. */
-#undef HAVE_NCURSES_NCURSES_H
-
-/* Define to 1 if you have the <ncurses/term.h> header file. */
-#undef HAVE_NCURSES_TERM_H
-
-/* Define to 1 if you have the <nlist.h> header file. */
-#undef HAVE_NLIST_H
-
-/* Define if you support the personality syscall. */
-#undef HAVE_PERSONALITY
-
-/* Define to 1 if you have the `pipe' function. */
-#undef HAVE_PIPE
-
-/* Define to 1 if you have the `pipe2' function. */
-#undef HAVE_PIPE2
-
-/* Define to 1 if you have the `poll' function. */
-#undef HAVE_POLL
-
-/* Define to 1 if you have the <poll.h> header file. */
-#undef HAVE_POLL_H
-
-/* Define to 1 if you have the `posix_madvise' function. */
-#undef HAVE_POSIX_MADVISE
-
-/* Define to 1 if you have the `pread' function. */
-#undef HAVE_PREAD
-
-/* Define to 1 if you have the `pread64' function. */
-#undef HAVE_PREAD64
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#undef HAVE_PRFPREGSET_T
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-#undef HAVE_PRGREGSET32_T
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#undef HAVE_PRGREGSET_T
-
-/* Define to 1 if you have the <proc_service.h> header file. */
-#undef HAVE_PROC_SERVICE_H
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#undef HAVE_PSADDR_T
-
-/* Have PTHREAD_PRIO_INHERIT. */
-#undef HAVE_PTHREAD_PRIO_INHERIT
-
-/* Define to 1 if you have the `pthread_setname_np' function. */
-#undef HAVE_PTHREAD_SETNAME_NP
-
-/* Define to 1 if you have the `pthread_sigmask' function. */
-#undef HAVE_PTHREAD_SIGMASK
-
-/* Define to 1 if you have the `ptrace64' function. */
-#undef HAVE_PTRACE64
-
-/* Define if sys/ptrace.h defines the PTRACE_GETFPXREGS request. */
-#undef HAVE_PTRACE_GETFPXREGS
-
-/* Define if sys/ptrace.h defines the PTRACE_GETREGS request. */
-#undef HAVE_PTRACE_GETREGS
-
-/* Define to 1 if you have the <ptrace.h> header file. */
-#undef HAVE_PTRACE_H
-
-/* Define if sys/ptrace.h defines the PT_GETDBREGS request. */
-#undef HAVE_PT_GETDBREGS
-
-/* Define if sys/ptrace.h defines the PT_GETXMMREGS request. */
-#undef HAVE_PT_GETXMMREGS
-
-/* Define to 1 if you have the `pt_insn_event' function. */
-#undef HAVE_PT_INSN_EVENT
-
-/* Define to 1 if you have the `pwrite' function. */
-#undef HAVE_PWRITE
-
-/* Define if Python interpreter is being linked in. */
-#undef HAVE_PYTHON
-
-/* Define to 1 if you have the `resize_term' function. */
-#undef HAVE_RESIZE_TERM
-
-/* Define to 1 if you have the `sbrk' function. */
-#undef HAVE_SBRK
-
-/* Define to 1 if you have the `scm_new_smob' function. */
-#undef HAVE_SCM_NEW_SMOB
-
-/* Define to 1 if you have the `setlocale' function. */
-#undef HAVE_SETLOCALE
-
-/* Define to 1 if you have the `setns' function. */
-#undef HAVE_SETNS
-
-/* Define to 1 if you have the `setpgid' function. */
-#undef HAVE_SETPGID
-
-/* Define to 1 if you have the `setpgrp' function. */
-#undef HAVE_SETPGRP
-
-/* Define to 1 if you have the `setrlimit' function. */
-#undef HAVE_SETRLIMIT
-
-/* Define to 1 if you have the `setsid' function. */
-#undef HAVE_SETSID
-
-/* Define to 1 if you have the `sigaction' function. */
-#undef HAVE_SIGACTION
-
-/* Define to 1 if you have the `sigaltstack' function. */
-#undef HAVE_SIGALTSTACK
-
-/* Define to 1 if you have the <signal.h> header file. */
-#undef HAVE_SIGNAL_H
-
-/* Define to 1 if you have the `sigprocmask' function. */
-#undef HAVE_SIGPROCMASK
-
-/* Define if sigsetjmp is available. */
-#undef HAVE_SIGSETJMP
-
-/* Define to 1 if you have the `sigsetmask' function. */
-#undef HAVE_SIGSETMASK
-
-/* Define to 1 if you have the `socketpair' function. */
-#undef HAVE_SOCKETPAIR
-
-/* Define to 1 if the system has the type `socklen_t'. */
-#undef HAVE_SOCKLEN_T
-
-/* Define to 1 if the source-highlight library is available */
-#undef HAVE_SOURCE_HIGHLIGHT
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if your system has struct lwp. */
-#undef HAVE_STRUCT_LWP
-
-/* Define to 1 if `pl_syscall_code' is a member of `struct ptrace_lwpinfo'. */
-#undef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
-
-/* Define to 1 if `pl_tdname' is a member of `struct ptrace_lwpinfo'. */
-#undef HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME
-
-/* Define to 1 if `enabled' is a member of `struct pt_insn'. */
-#undef HAVE_STRUCT_PT_INSN_ENABLED
-
-/* Define to 1 if `resynced' is a member of `struct pt_insn'. */
-#undef HAVE_STRUCT_PT_INSN_RESYNCED
-
-/* Define to 1 if your system has struct reg in <machine/reg.h>. */
-#undef HAVE_STRUCT_REG
-
-/* Define to 1 if `r_fs' is a member of `struct reg'. */
-#undef HAVE_STRUCT_REG_R_FS
-
-/* Define to 1 if `r_gs' is a member of `struct reg'. */
-#undef HAVE_STRUCT_REG_R_GS
-
-/* Define to 1 if `st_blksize' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BLKSIZE
-
-/* Define to 1 if `st_blocks' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BLOCKS
-
-/* Define to 1 if `td_pcb' is a member of `struct thread'. */
-#undef HAVE_STRUCT_THREAD_TD_PCB
-
-/* Define to 1 if `fs_base' is a member of `struct user_regs_struct'. */
-#undef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
-
-/* Define to 1 if `gs_base' is a member of `struct user_regs_struct'. */
-#undef HAVE_STRUCT_USER_REGS_STRUCT_GS_BASE
-
-/* Define to 1 if you have the <sys/debugreg.h> header file. */
-#undef HAVE_SYS_DEBUGREG_H
-
-/* Define to 1 if you have the <sys/file.h> header file. */
-#undef HAVE_SYS_FILE_H
-
-/* Define to 1 if you have the <sys/filio.h> header file. */
-#undef HAVE_SYS_FILIO_H
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/poll.h> header file. */
-#undef HAVE_SYS_POLL_H
-
-/* Define to 1 if you have the <sys/procfs.h> header file. */
-#undef HAVE_SYS_PROCFS_H
-
-/* Define to 1 if you have the <sys/ptrace.h> header file. */
-#undef HAVE_SYS_PTRACE_H
-
-/* Define to 1 if you have the <sys/reg.h> header file. */
-#undef HAVE_SYS_REG_H
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#undef HAVE_SYS_RESOURCE_H
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#undef HAVE_SYS_SELECT_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/un.h> header file. */
-#undef HAVE_SYS_UN_H
-
-/* Define to 1 if you have the <sys/user.h> header file. */
-#undef HAVE_SYS_USER_H
-
-/* Define to 1 if you have the <sys/wait.h> header file. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define to 1 if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
-
-/* Define to 1 if you have the <term.h> header file. */
-#undef HAVE_TERM_H
-
-/* Define to 1 if you have the <thread_db.h> header file. */
-#undef HAVE_THREAD_DB_H
-
-/* Define to 1 if you have the `ttrace' function. */
-#undef HAVE_TTRACE
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the `use_default_colors' function. */
-#undef HAVE_USE_DEFAULT_COLORS
-
-/* Define to 1 if you have the `vfork' function. */
-#undef HAVE_VFORK
-
-/* Define to 1 if you have the <vfork.h> header file. */
-#undef HAVE_VFORK_H
-
-/* Define to 1 if you have the `waitpid' function. */
-#undef HAVE_WAITPID
-
-/* Define to 1 if you have the <wait.h> header file. */
-#undef HAVE_WAIT_H
-
-/* Define to 1 if you have the `wborder' function. */
-#undef HAVE_WBORDER
-
-/* Define to 1 if you have the <windows.h> header file. */
-#undef HAVE_WINDOWS_H
-
-/* Define to 1 if `fork' works. */
-#undef HAVE_WORKING_FORK
-
-/* Define to 1 if `vfork' works. */
-#undef HAVE_WORKING_VFORK
-
-/* Define to 1 if you have the `wresize' function. */
-#undef HAVE_WRESIZE
-
-/* Define to 1 if you have the `XML_StopParser' function. */
-#undef HAVE_XML_STOPPARSER
-
-/* Define to 1 if your system has the _etext variable. */
-#undef HAVE__ETEXT
-
-/* Define to 1 if you have the `_mcleanup' function. */
-#undef HAVE__MCLEANUP
-
-/* Path of directory of iconv program. */
-#undef ICONV_BIN
-
-/* Define if the iconv directory should be relocated when GDB is moved. */
-#undef ICONV_BIN_RELOCATABLE
-
-/* Define as const if the declaration of iconv() needs const. */
-#undef ICONV_CONST
-
-/* directory to load the JIT readers from */
-#undef JIT_READER_DIR
-
-/* Define if the jit-reader-dir directory should be relocated when GDB is
-   moved. */
-#undef JIT_READER_DIR_RELOCATABLE
-
-/* Name of this package. */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
 #undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
+#undef PACKAGE
+#undef PACKAGE_VERSION
 #undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
+#include <gdbsupport/support-config.h>
 
-/* Define to the version of this package. */
+#undef PACKAGE_NAME
+#undef PACKAGE
 #undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
 
-/* Additional package description */
-#undef PKGVERSION
-
-/* Define to 1 if the "%H, %D and %DD" formats work to print decfloats. */
-#undef PRINTF_HAS_DECFLOAT
-
-/* Define to 1 if the "%Lg" format works to print long doubles. */
-#undef PRINTF_HAS_LONG_DOUBLE
-
-/* Define to 1 if the "%ll" format works to print long longs. */
-#undef PRINTF_HAS_LONG_LONG
-
-/* Define to necessary symbol if this constant uses a non-standard name on
-   your system. */
-#undef PTHREAD_CREATE_JOINABLE
-
-/* Define to the type of arg 1 for ptrace. */
-#undef PTRACE_TYPE_ARG1
-
-/* Define to the type of arg 3 for ptrace. */
-#undef PTRACE_TYPE_ARG3
-
-/* Define to the type of arg 4 for ptrace. */
-#undef PTRACE_TYPE_ARG4
-
-/* Define to the type of arg 5 for ptrace. */
-#undef PTRACE_TYPE_ARG5
-
-/* Define as the return type of ptrace. */
-#undef PTRACE_TYPE_RET
-
-/* Define if the python directory should be relocated when GDB is moved. */
-#undef PYTHON_PATH_RELOCATABLE
-
-/* Relocated directory for source files. */
-#undef RELOC_SRCDIR
-
-/* Bug reporting address */
-#undef REPORT_BUGS_TO
-
-/* Define to 1 if the "%Lg" format works to scan long doubles. */
-#undef SCANF_HAS_LONG_DOUBLE
-
-/* Define to 1 if the `setpgrp' function takes no argument. */
-#undef SETPGRP_VOID
-
-/* The size of `long', as computed by sizeof. */
-#undef SIZEOF_LONG
-
-/* The size of `long long', as computed by sizeof. */
-#undef SIZEOF_LONG_LONG
-
-/* The size of `unsigned long', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_LONG
-
-/* The size of `unsigned long long', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_LONG_LONG
-
-/* The size of `unsigned __int128', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED___INT128
-
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at runtime.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-#undef STACK_DIRECTION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* automatically load a system-wide gdbinit file */
-#undef SYSTEM_GDBINIT
-
-/* automatically load system-wide gdbinit files from this directory */
-#undef SYSTEM_GDBINIT_DIR
-
-/* Define if the system-gdbinit-dir directory should be relocated when GDB is
-   moved. */
-#undef SYSTEM_GDBINIT_DIR_RELOCATABLE
-
-/* Define if the system-gdbinit directory should be relocated when GDB is
-   moved. */
-#undef SYSTEM_GDBINIT_RELOCATABLE
-
-/* search for usr/lib et al within DIR */
-#undef TARGET_SYSTEM_ROOT
-
-/* Define if the sysroot directory should be relocated when GDB is moved. */
-#undef TARGET_SYSTEM_ROOT_RELOCATABLE
-
-/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
-#undef THREAD_DB_HAS_TD_NOTALLOC
-
-/* Define if <thread_db.h> has the TD_NOTLS error code. */
-#undef THREAD_DB_HAS_TD_NOTLS
-
-/* Define if <thread_db.h> has the TD_VERSION error code. */
-#undef THREAD_DB_HAS_TD_VERSION
-
-/* Define to 1 if the regex included in libiberty should be used. */
-#undef USE_INCLUDED_REGEX
-
-/* Enable extensions on AIX 3, Interix.  */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them.  */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris.  */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop.  */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
-/* Define if we should use the Windows API, instead of the POSIX API. On
-   Windows, we use the Windows API when building for MinGW, but the POSIX API
-   when building for Cygwin. */
-#undef USE_WIN32API
-
-/* Define if the PPC simulator is being linked in. */
-#undef WITH_PPC_SIM
-
-/* Define if --with-python provides a path, either directly or via
-   python-config.py --exec-prefix. */
-#undef WITH_PYTHON_PATH
-
-/* Define if the simulator is being linked in. */
-#undef WITH_SIM
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-#  undef WORDS_BIGENDIAN
-# endif
-#endif
-
-/* Enable large inode numbers on Mac OS X 10.5.  */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
-   this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
-   calls it, or to nothing if 'inline' is not supported under any name.  */
-#ifndef __cplusplus
-#undef inline
-#endif
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
-
-/* Define as `fork' if `vfork' does not work. */
-#undef vfork
+#include "gdb-config.h"
diff --git a/gdb/configure b/gdb/configure
index 72ffad8d37b..048f87d062f 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -2945,7 +2945,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_headers="$ac_config_headers config.h:config.in"
+ac_config_headers="$ac_config_headers gdb-config.h:gdb-config.in"
+
+ac_config_files="$ac_config_files config.h:config.in"
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
@@ -19729,7 +19731,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
-    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
+    "gdb-config.h") CONFIG_HEADERS="$CONFIG_HEADERS gdb-config.h:gdb-config.in" ;;
+    "config.h") CONFIG_FILES="$CONFIG_FILES config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "jit-reader.h") CONFIG_FILES="$CONFIG_FILES jit-reader.h:jit-reader.in" ;;
     "nm.h") CONFIG_LINKS="$CONFIG_LINKS nm.h:$GDB_NM_FILE" ;;
@@ -20365,7 +20368,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
 
   case $ac_file$ac_mode in
-    "config.h":H) echo > stamp-h ;;
+    "gdb-config.h":H) echo > stamp-h ;;
     "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;;
     "nm.h":L) echo > stamp-nmh ;;
     "gcore":F) chmod +x gcore ;;
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 0ca169101b3..85c424b9860 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -19,7 +19,8 @@ dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
 dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT(main.c)
-AC_CONFIG_HEADERS(config.h:config.in, [echo > stamp-h])
+AC_CONFIG_HEADERS(gdb-config.h:gdb-config.in, [echo > stamp-h])
+AC_CONFIG_FILES([config.h:config.in])
 AM_MAINTAINER_MODE
 
 # Set the 'development' global.
diff --git a/gdb/gdb-config.in b/gdb/gdb-config.in
new file mode 100644
index 00000000000..cb886ba8e1a
--- /dev/null
+++ b/gdb/gdb-config.in
@@ -0,0 +1,811 @@
+/* config.in.  Generated from configure.ac by autoheader.  */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Directories from which to load auto-loaded scripts. */
+#undef AUTO_LOAD_DIR
+
+/* Directories safe to hold auto-loaded files. */
+#undef AUTO_LOAD_SAFE_PATH
+
+/* Directory of programs. */
+#undef BINDIR
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if std::thread works. */
+#undef CXX_STD_THREAD
+
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* look for global separate debug info in this path [LIBDIR/debug] */
+#undef DEBUGDIR
+
+/* Define if the separate-debug-dir directory should be relocated when GDB is
+   moved. */
+#undef DEBUGDIR_RELOCATABLE
+
+/* Define to BFD's default architecture. */
+#undef DEFAULT_BFD_ARCH
+
+/* Define to BFD's default target vector. */
+#undef DEFAULT_BFD_VEC
+
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
+#undef ENABLE_NLS
+
+/* The .gdbinit filename. */
+#undef GDBINIT
+
+/* look for global separate data files in this path [DATADIR/gdb] */
+#undef GDB_DATADIR
+
+/* Define if the gdb-datadir directory should be relocated when GDB is moved.
+   */
+#undef GDB_DATADIR_RELOCATABLE
+
+/* Define to be a string naming the default host character set. */
+#undef GDB_DEFAULT_HOST_CHARSET
+
+/* Host double floatformat */
+#undef GDB_HOST_DOUBLE_FORMAT
+
+/* Host float floatformat */
+#undef GDB_HOST_FLOAT_FORMAT
+
+/* Host long double floatformat */
+#undef GDB_HOST_LONG_DOUBLE_FORMAT
+
+/* nativefile */
+#undef GDB_NM_FILE
+
+/* Define to the default OS ABI for this configuration. */
+#undef GDB_OSABI_DEFAULT
+
+/* Define if self-testing features should be enabled */
+#undef GDB_SELF_TEST
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+   */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if you have the `btowc' function. */
+#undef HAVE_BTOWC
+
+/* Define to 1 if you have the <cursesX.h> header file. */
+#undef HAVE_CURSESX_H
+
+/* Define to 1 if you have the <curses.h> header file. */
+#undef HAVE_CURSES_H
+
+/* define if the compiler supports basic C++11 syntax */
+#undef HAVE_CXX11
+
+/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
+   you don't. */
+#undef HAVE_DECL_ADDR_NO_RANDOMIZE
+
+/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_ASPRINTF
+
+/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if
+   you don't. */
+#undef HAVE_DECL_BASENAME
+
+/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
+#undef HAVE_DECL_FFS
+
+/* Define to 1 if you have the declaration of `getthrds', and to 0 if you
+   don't. */
+#undef HAVE_DECL_GETTHRDS
+
+/* Define to 1 if you have the declaration of `ptrace', and to 0 if you don't.
+   */
+#undef HAVE_DECL_PTRACE
+
+/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_SNPRINTF
+
+/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
+   */
+#undef HAVE_DECL_STRSTR
+
+/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
+   */
+#undef HAVE_DECL_STRTOL
+
+/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOLL
+
+/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOUL
+
+/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOULL
+
+/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRVERSCMP
+
+/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_VASPRINTF
+
+/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_VSNPRINTF
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define if ELF support should be included. */
+#undef HAVE_ELF
+
+/* Define if <sys/procfs.h> has elf_fpregset_t. */
+#undef HAVE_ELF_FPREGSET_T
+
+/* Define to 1 if you have the <elf_hp.h> header file. */
+#undef HAVE_ELF_HP_H
+
+/* Define to 1 if your system has the etext variable. */
+#undef HAVE_ETEXT
+
+/* Define to 1 if you have the `fdwalk' function. */
+#undef HAVE_FDWALK
+
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define if <sys/procfs.h> has fpregset_t. */
+#undef HAVE_FPREGSET_T
+
+/* Define to 1 if you have the `getauxval' function. */
+#undef HAVE_GETAUXVAL
+
+/* Define to 1 if you have the `getgid' function. */
+#undef HAVE_GETGID
+
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define to 1 if you have the `getpgid' function. */
+#undef HAVE_GETPGID
+
+/* Define to 1 if you have the `getrlimit' function. */
+#undef HAVE_GETRLIMIT
+
+/* Define to 1 if you have the `getrusage' function. */
+#undef HAVE_GETRUSAGE
+
+/* Define to 1 if you have the `getuid' function. */
+#undef HAVE_GETUID
+
+/* Define if <sys/procfs.h> has gregset_t. */
+#undef HAVE_GREGSET_T
+
+/* Define if Guile interpreter is being linked in. */
+#undef HAVE_GUILE
+
+/* Define if Guile supports manual finalization. */
+#undef HAVE_GUILE_MANUAL_FINALIZATION
+
+/* Define if you have the iconv() function. */
+#undef HAVE_ICONV
+
+/* Define to 1 if you have the `iconvlist' function. */
+#undef HAVE_ICONVLIST
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if your system has the kinfo_getfile function. */
+#undef HAVE_KINFO_GETFILE
+
+/* Define to 1 if your system has the kinfo_getvmmap function. */
+#undef HAVE_KINFO_GETVMMAP
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
+
+/* Define if you have the babeltrace library. */
+#undef HAVE_LIBBABELTRACE
+
+/* Define if you have the expat library. */
+#undef HAVE_LIBEXPAT
+
+/* Define to 1 if you have the `libiconvlist' function. */
+#undef HAVE_LIBICONVLIST
+
+/* Define if you have the ipt library. */
+#undef HAVE_LIBIPT
+
+/* Define if you have the lzma library. */
+#undef HAVE_LIBLZMA
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define if you have the mpfr library. */
+#undef HAVE_LIBMPFR
+
+/* Define to 1 if you have the <libunwind-ia64.h> header file. */
+#undef HAVE_LIBUNWIND_IA64_H
+
+/* Define if you have the xxhash library. */
+#undef HAVE_LIBXXHASH
+
+/* Define to 1 if you have the <linux/elf.h> header file. */
+#undef HAVE_LINUX_ELF_H
+
+/* Define to 1 if you have the <linux/perf_event.h> header file. */
+#undef HAVE_LINUX_PERF_EVENT_H
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if the compiler supports long double. */
+#undef HAVE_LONG_DOUBLE
+
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
+/* Define if <sys/procfs.h> has lwpid_t. */
+#undef HAVE_LWPID_T
+
+/* Define to 1 if you have the <machine/reg.h> header file. */
+#undef HAVE_MACHINE_REG_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the `monstartup' function. */
+#undef HAVE_MONSTARTUP
+
+/* Define to 1 if you have the <ncursesw/ncurses.h> header file. */
+#undef HAVE_NCURSESW_NCURSES_H
+
+/* Define to 1 if you have the <ncurses.h> header file. */
+#undef HAVE_NCURSES_H
+
+/* Define to 1 if you have the <ncurses/ncurses.h> header file. */
+#undef HAVE_NCURSES_NCURSES_H
+
+/* Define to 1 if you have the <ncurses/term.h> header file. */
+#undef HAVE_NCURSES_TERM_H
+
+/* Define to 1 if you have the <nlist.h> header file. */
+#undef HAVE_NLIST_H
+
+/* Define if you support the personality syscall. */
+#undef HAVE_PERSONALITY
+
+/* Define to 1 if you have the `pipe' function. */
+#undef HAVE_PIPE
+
+/* Define to 1 if you have the `pipe2' function. */
+#undef HAVE_PIPE2
+
+/* Define to 1 if you have the `poll' function. */
+#undef HAVE_POLL
+
+/* Define to 1 if you have the <poll.h> header file. */
+#undef HAVE_POLL_H
+
+/* Define to 1 if you have the `posix_madvise' function. */
+#undef HAVE_POSIX_MADVISE
+
+/* Define to 1 if you have the `pread' function. */
+#undef HAVE_PREAD
+
+/* Define to 1 if you have the `pread64' function. */
+#undef HAVE_PREAD64
+
+/* Define if <sys/procfs.h> has prfpregset_t. */
+#undef HAVE_PRFPREGSET_T
+
+/* Define if <sys/procfs.h> has prgregset32_t. */
+#undef HAVE_PRGREGSET32_T
+
+/* Define if <sys/procfs.h> has prgregset_t. */
+#undef HAVE_PRGREGSET_T
+
+/* Define to 1 if you have the <proc_service.h> header file. */
+#undef HAVE_PROC_SERVICE_H
+
+/* Define if <sys/procfs.h> has psaddr_t. */
+#undef HAVE_PSADDR_T
+
+/* Have PTHREAD_PRIO_INHERIT. */
+#undef HAVE_PTHREAD_PRIO_INHERIT
+
+/* Define to 1 if you have the `pthread_setname_np' function. */
+#undef HAVE_PTHREAD_SETNAME_NP
+
+/* Define to 1 if you have the `pthread_sigmask' function. */
+#undef HAVE_PTHREAD_SIGMASK
+
+/* Define to 1 if you have the `ptrace64' function. */
+#undef HAVE_PTRACE64
+
+/* Define if sys/ptrace.h defines the PTRACE_GETFPXREGS request. */
+#undef HAVE_PTRACE_GETFPXREGS
+
+/* Define if sys/ptrace.h defines the PTRACE_GETREGS request. */
+#undef HAVE_PTRACE_GETREGS
+
+/* Define to 1 if you have the <ptrace.h> header file. */
+#undef HAVE_PTRACE_H
+
+/* Define if sys/ptrace.h defines the PT_GETDBREGS request. */
+#undef HAVE_PT_GETDBREGS
+
+/* Define if sys/ptrace.h defines the PT_GETXMMREGS request. */
+#undef HAVE_PT_GETXMMREGS
+
+/* Define to 1 if you have the `pt_insn_event' function. */
+#undef HAVE_PT_INSN_EVENT
+
+/* Define to 1 if you have the `pwrite' function. */
+#undef HAVE_PWRITE
+
+/* Define if Python interpreter is being linked in. */
+#undef HAVE_PYTHON
+
+/* Define to 1 if you have the `resize_term' function. */
+#undef HAVE_RESIZE_TERM
+
+/* Define to 1 if you have the `sbrk' function. */
+#undef HAVE_SBRK
+
+/* Define to 1 if you have the `scm_new_smob' function. */
+#undef HAVE_SCM_NEW_SMOB
+
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
+/* Define to 1 if you have the `setns' function. */
+#undef HAVE_SETNS
+
+/* Define to 1 if you have the `setpgid' function. */
+#undef HAVE_SETPGID
+
+/* Define to 1 if you have the `setpgrp' function. */
+#undef HAVE_SETPGRP
+
+/* Define to 1 if you have the `setrlimit' function. */
+#undef HAVE_SETRLIMIT
+
+/* Define to 1 if you have the `setsid' function. */
+#undef HAVE_SETSID
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Define to 1 if you have the `sigaltstack' function. */
+#undef HAVE_SIGALTSTACK
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Define to 1 if you have the `sigprocmask' function. */
+#undef HAVE_SIGPROCMASK
+
+/* Define if sigsetjmp is available. */
+#undef HAVE_SIGSETJMP
+
+/* Define to 1 if you have the `sigsetmask' function. */
+#undef HAVE_SIGSETMASK
+
+/* Define to 1 if you have the `socketpair' function. */
+#undef HAVE_SOCKETPAIR
+
+/* Define to 1 if the system has the type `socklen_t'. */
+#undef HAVE_SOCKLEN_T
+
+/* Define to 1 if the source-highlight library is available */
+#undef HAVE_SOURCE_HIGHLIGHT
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if your system has struct lwp. */
+#undef HAVE_STRUCT_LWP
+
+/* Define to 1 if `pl_syscall_code' is a member of `struct ptrace_lwpinfo'. */
+#undef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
+
+/* Define to 1 if `pl_tdname' is a member of `struct ptrace_lwpinfo'. */
+#undef HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME
+
+/* Define to 1 if `enabled' is a member of `struct pt_insn'. */
+#undef HAVE_STRUCT_PT_INSN_ENABLED
+
+/* Define to 1 if `resynced' is a member of `struct pt_insn'. */
+#undef HAVE_STRUCT_PT_INSN_RESYNCED
+
+/* Define to 1 if your system has struct reg in <machine/reg.h>. */
+#undef HAVE_STRUCT_REG
+
+/* Define to 1 if `r_fs' is a member of `struct reg'. */
+#undef HAVE_STRUCT_REG_R_FS
+
+/* Define to 1 if `r_gs' is a member of `struct reg'. */
+#undef HAVE_STRUCT_REG_R_GS
+
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if `st_blocks' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLOCKS
+
+/* Define to 1 if `td_pcb' is a member of `struct thread'. */
+#undef HAVE_STRUCT_THREAD_TD_PCB
+
+/* Define to 1 if `fs_base' is a member of `struct user_regs_struct'. */
+#undef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
+
+/* Define to 1 if `gs_base' is a member of `struct user_regs_struct'. */
+#undef HAVE_STRUCT_USER_REGS_STRUCT_GS_BASE
+
+/* Define to 1 if you have the <sys/debugreg.h> header file. */
+#undef HAVE_SYS_DEBUGREG_H
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define to 1 if you have the <sys/filio.h> header file. */
+#undef HAVE_SYS_FILIO_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#undef HAVE_SYS_POLL_H
+
+/* Define to 1 if you have the <sys/procfs.h> header file. */
+#undef HAVE_SYS_PROCFS_H
+
+/* Define to 1 if you have the <sys/ptrace.h> header file. */
+#undef HAVE_SYS_PTRACE_H
+
+/* Define to 1 if you have the <sys/reg.h> header file. */
+#undef HAVE_SYS_REG_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#undef HAVE_SYS_UN_H
+
+/* Define to 1 if you have the <sys/user.h> header file. */
+#undef HAVE_SYS_USER_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define to 1 if you have the <term.h> header file. */
+#undef HAVE_TERM_H
+
+/* Define to 1 if you have the <thread_db.h> header file. */
+#undef HAVE_THREAD_DB_H
+
+/* Define to 1 if you have the `ttrace' function. */
+#undef HAVE_TTRACE
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `use_default_colors' function. */
+#undef HAVE_USE_DEFAULT_COLORS
+
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
+
+/* Define to 1 if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
+
+/* Define to 1 if you have the `waitpid' function. */
+#undef HAVE_WAITPID
+
+/* Define to 1 if you have the <wait.h> header file. */
+#undef HAVE_WAIT_H
+
+/* Define to 1 if you have the `wborder' function. */
+#undef HAVE_WBORDER
+
+/* Define to 1 if you have the <windows.h> header file. */
+#undef HAVE_WINDOWS_H
+
+/* Define to 1 if `fork' works. */
+#undef HAVE_WORKING_FORK
+
+/* Define to 1 if `vfork' works. */
+#undef HAVE_WORKING_VFORK
+
+/* Define to 1 if you have the `wresize' function. */
+#undef HAVE_WRESIZE
+
+/* Define to 1 if you have the `XML_StopParser' function. */
+#undef HAVE_XML_STOPPARSER
+
+/* Define to 1 if your system has the _etext variable. */
+#undef HAVE__ETEXT
+
+/* Define to 1 if you have the `_mcleanup' function. */
+#undef HAVE__MCLEANUP
+
+/* Path of directory of iconv program. */
+#undef ICONV_BIN
+
+/* Define if the iconv directory should be relocated when GDB is moved. */
+#undef ICONV_BIN_RELOCATABLE
+
+/* Define as const if the declaration of iconv() needs const. */
+#undef ICONV_CONST
+
+/* directory to load the JIT readers from */
+#undef JIT_READER_DIR
+
+/* Define if the jit-reader-dir directory should be relocated when GDB is
+   moved. */
+#undef JIT_READER_DIR_RELOCATABLE
+
+/* Name of this package. */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Additional package description */
+#undef PKGVERSION
+
+/* Define to 1 if the "%H, %D and %DD" formats work to print decfloats. */
+#undef PRINTF_HAS_DECFLOAT
+
+/* Define to 1 if the "%Lg" format works to print long doubles. */
+#undef PRINTF_HAS_LONG_DOUBLE
+
+/* Define to 1 if the "%ll" format works to print long longs. */
+#undef PRINTF_HAS_LONG_LONG
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+   your system. */
+#undef PTHREAD_CREATE_JOINABLE
+
+/* Define to the type of arg 1 for ptrace. */
+#undef PTRACE_TYPE_ARG1
+
+/* Define to the type of arg 3 for ptrace. */
+#undef PTRACE_TYPE_ARG3
+
+/* Define to the type of arg 4 for ptrace. */
+#undef PTRACE_TYPE_ARG4
+
+/* Define to the type of arg 5 for ptrace. */
+#undef PTRACE_TYPE_ARG5
+
+/* Define as the return type of ptrace. */
+#undef PTRACE_TYPE_RET
+
+/* Define if the python directory should be relocated when GDB is moved. */
+#undef PYTHON_PATH_RELOCATABLE
+
+/* Relocated directory for source files. */
+#undef RELOC_SRCDIR
+
+/* Bug reporting address */
+#undef REPORT_BUGS_TO
+
+/* Define to 1 if the "%Lg" format works to scan long doubles. */
+#undef SCANF_HAS_LONG_DOUBLE
+
+/* Define to 1 if the `setpgrp' function takes no argument. */
+#undef SETPGRP_VOID
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* The size of `unsigned long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG
+
+/* The size of `unsigned long long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG_LONG
+
+/* The size of `unsigned __int128', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED___INT128
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* automatically load a system-wide gdbinit file */
+#undef SYSTEM_GDBINIT
+
+/* automatically load system-wide gdbinit files from this directory */
+#undef SYSTEM_GDBINIT_DIR
+
+/* Define if the system-gdbinit-dir directory should be relocated when GDB is
+   moved. */
+#undef SYSTEM_GDBINIT_DIR_RELOCATABLE
+
+/* Define if the system-gdbinit directory should be relocated when GDB is
+   moved. */
+#undef SYSTEM_GDBINIT_RELOCATABLE
+
+/* search for usr/lib et al within DIR */
+#undef TARGET_SYSTEM_ROOT
+
+/* Define if the sysroot directory should be relocated when GDB is moved. */
+#undef TARGET_SYSTEM_ROOT_RELOCATABLE
+
+/* Define if <thread_db.h> has the TD_NOTALLOC error code. */
+#undef THREAD_DB_HAS_TD_NOTALLOC
+
+/* Define if <thread_db.h> has the TD_NOTLS error code. */
+#undef THREAD_DB_HAS_TD_NOTLS
+
+/* Define if <thread_db.h> has the TD_VERSION error code. */
+#undef THREAD_DB_HAS_TD_VERSION
+
+/* Define to 1 if the regex included in libiberty should be used. */
+#undef USE_INCLUDED_REGEX
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define if we should use the Windows API, instead of the POSIX API. On
+   Windows, we use the Windows API when building for MinGW, but the POSIX API
+   when building for Cygwin. */
+#undef USE_WIN32API
+
+/* Define if the PPC simulator is being linked in. */
+#undef WITH_PPC_SIM
+
+/* Define if --with-python provides a path, either directly or via
+   python-config.py --exec-prefix. */
+#undef WITH_PYTHON_PATH
+
+/* Define if the simulator is being linked in. */
+#undef WITH_SIM
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+#  undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define as `fork' if `vfork' does not work. */
+#undef vfork
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index da8c313c360..9e661d8e13c 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -1,496 +1,32 @@
-/* config.in.  Generated from configure.ac by autoheader.  */
+/* config.h for the remote server for GDB.
+   Copyright (C) 2020 Free Software Foundation, Inc.
 
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
-   systems. This function is required for `alloca.c' support on those systems.
-   */
-#undef CRAY_STACKSEG_END
+   This file is part of GDB.
 
-/* Define to 1 if std::thread works. */
-#undef CXX_STD_THREAD
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
 
-/* Define to 1 if using `alloca.c'. */
-#undef C_ALLOCA
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-/* Define if self-testing features should be enabled */
-#undef GDB_SELF_TEST
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* Define to 1 if you have `alloca', as a function or macro. */
-#undef HAVE_ALLOCA
+/* This file is automatically generated from config.in.  It exists so
+   that "#include <config.h>" in header files (including gnulib
+   headers), includes this file, which then includes our real config.h
+   (which is called gdb-config.h), along with gnulib's config.h.  */
 
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
-   */
-#undef HAVE_ALLOCA_H
+#include <build-gnulib-gdbserver/config.h>
 
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#undef HAVE_ARPA_INET_H
-
-/* define if the compiler supports basic C++11 syntax */
-#undef HAVE_CXX11
-
-/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
-   you don't. */
-#undef HAVE_DECL_ADDR_NO_RANDOMIZE
-
-/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_ASPRINTF
-
-/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if
-   you don't. */
-#undef HAVE_DECL_BASENAME
-
-/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
-#undef HAVE_DECL_FFS
-
-/* Define to 1 if you have the declaration of `perror', and to 0 if you don't.
-   */
-#undef HAVE_DECL_PERROR
-
-/* Define to 1 if you have the declaration of `ptrace', and to 0 if you don't.
-   */
-#undef HAVE_DECL_PTRACE
-
-/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_SNPRINTF
-
-/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
-   */
-#undef HAVE_DECL_STRSTR
-
-/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
-   */
-#undef HAVE_DECL_STRTOL
-
-/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOLL
-
-/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOUL
-
-/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOULL
-
-/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRVERSCMP
-
-/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_VASPRINTF
-
-/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_VSNPRINTF
-
-/* Define to 1 if you have the `dladdr' function. */
-#undef HAVE_DLADDR
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if the system has the type `Elf32_auxv_t'. */
-#undef HAVE_ELF32_AUXV_T
-
-/* Define to 1 if the system has the type `Elf64_auxv_t'. */
-#undef HAVE_ELF64_AUXV_T
-
-/* Define if <sys/procfs.h> has elf_fpregset_t. */
-#undef HAVE_ELF_FPREGSET_T
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define to 1 if you have the `fdwalk' function. */
-#undef HAVE_FDWALK
-
-/* Define to 1 if you have the `fork' function. */
-#undef HAVE_FORK
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#undef HAVE_FPREGSET_T
-
-/* Define to 1 if you have the `getauxval' function. */
-#undef HAVE_GETAUXVAL
-
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define to 1 if you have the `getrlimit' function. */
-#undef HAVE_GETRLIMIT
-
-/* Define to 1 if you have the `getrusage' function. */
-#undef HAVE_GETRUSAGE
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#undef HAVE_GREGSET_T
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if your system has the kinfo_getfile function. */
-#undef HAVE_KINFO_GETFILE
-
-/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
-#undef HAVE_LANGINFO_CODESET
-
-/* Define to 1 if you have the `dl' library (-ldl). */
-#undef HAVE_LIBDL
-
-/* Define if you have the ipt library. */
-#undef HAVE_LIBIPT
-
-/* Define if the target supports branch tracing. */
-#undef HAVE_LINUX_BTRACE
-
-/* Define to 1 if you have the <linux/elf.h> header file. */
-#undef HAVE_LINUX_ELF_H
-
-/* Define to 1 if you have the <linux/perf_event.h> header file. */
-#undef HAVE_LINUX_PERF_EVENT_H
-
-/* Define if the target supports register sets. */
-#undef HAVE_LINUX_REGSETS
-
-/* Define if the target supports PTRACE_PEEKUSR for register access. */
-#undef HAVE_LINUX_USRREGS
-
-/* Define to 1 if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
-/* Define to 1 if the system has the type `long long'. */
-#undef HAVE_LONG_LONG
-
-/* Define if <thread_db.h> has lwpid_t. */
-#undef HAVE_LWPID_T
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define to 1 if you have the <netdb.h> header file. */
-#undef HAVE_NETDB_H
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#undef HAVE_NETINET_IN_H
-
-/* Define to 1 if you have the <netinet/tcp.h> header file. */
-#undef HAVE_NETINET_TCP_H
-
-/* Define if you support the personality syscall. */
-#undef HAVE_PERSONALITY
-
-/* Define to 1 if you have the `pipe' function. */
-#undef HAVE_PIPE
-
-/* Define to 1 if you have the `pipe2' function. */
-#undef HAVE_PIPE2
-
-/* Define to 1 if you have the `pread' function. */
-#undef HAVE_PREAD
-
-/* Define to 1 if you have the `pread64' function. */
-#undef HAVE_PREAD64
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#undef HAVE_PRFPREGSET_T
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-#undef HAVE_PRGREGSET32_T
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#undef HAVE_PRGREGSET_T
-
-/* Define to 1 if you have the <proc_service.h> header file. */
-#undef HAVE_PROC_SERVICE_H
-
-/* Define if <thread_db.h> has psaddr_t. */
-#undef HAVE_PSADDR_T
-
-/* Have PTHREAD_PRIO_INHERIT. */
-#undef HAVE_PTHREAD_PRIO_INHERIT
-
-/* Define to 1 if you have the `pthread_setname_np' function. */
-#undef HAVE_PTHREAD_SETNAME_NP
-
-/* Define to 1 if you have the `pthread_sigmask' function. */
-#undef HAVE_PTHREAD_SIGMASK
-
-/* Define to 1 if you have the `ptrace64' function. */
-#undef HAVE_PTRACE64
-
-/* Define if the target supports PTRACE_GETFPXREGS for extended register
-   access. */
-#undef HAVE_PTRACE_GETFPXREGS
-
-/* Define if the target supports PTRACE_GETREGS for register access. */
-#undef HAVE_PTRACE_GETREGS
-
-/* Define to 1 if you have the <ptrace.h> header file. */
-#undef HAVE_PTRACE_H
-
-/* Define to 1 if you have the `pt_insn_event' function. */
-#undef HAVE_PT_INSN_EVENT
-
-/* Define to 1 if you have the `pwrite' function. */
-#undef HAVE_PWRITE
-
-/* Define to 1 if you have the `sbrk' function. */
-#undef HAVE_SBRK
-
-/* Define to 1 if you have the `setns' function. */
-#undef HAVE_SETNS
-
-/* Define to 1 if you have the `setpgid' function. */
-#undef HAVE_SETPGID
-
-/* Define to 1 if you have the `setpgrp' function. */
-#undef HAVE_SETPGRP
-
-/* Define to 1 if you have the `sigaction' function. */
-#undef HAVE_SIGACTION
-
-/* Define to 1 if you have the `sigaltstack' function. */
-#undef HAVE_SIGALTSTACK
-
-/* Define to 1 if you have the <signal.h> header file. */
-#undef HAVE_SIGNAL_H
-
-/* Define to 1 if you have the `sigprocmask' function. */
-#undef HAVE_SIGPROCMASK
-
-/* Define if sigsetjmp is available. */
-#undef HAVE_SIGSETJMP
-
-/* Define to 1 if you have the `socketpair' function. */
-#undef HAVE_SOCKETPAIR
-
-/* Define to 1 if the system has the type `socklen_t'. */
-#undef HAVE_SOCKLEN_T
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if `enabled' is a member of `struct pt_insn'. */
-#undef HAVE_STRUCT_PT_INSN_ENABLED
-
-/* Define to 1 if `resynced' is a member of `struct pt_insn'. */
-#undef HAVE_STRUCT_PT_INSN_RESYNCED
-
-/* Define to 1 if `st_blksize' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BLKSIZE
-
-/* Define to 1 if `st_blocks' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BLOCKS
-
-/* Define to 1 if `fs_base' is a member of `struct user_regs_struct'. */
-#undef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
-
-/* Define to 1 if `gs_base' is a member of `struct user_regs_struct'. */
-#undef HAVE_STRUCT_USER_REGS_STRUCT_GS_BASE
-
-/* Define to 1 if the target supports __sync_*_compare_and_swap */
-#undef HAVE_SYNC_BUILTINS
-
-/* Define to 1 if you have the <sys/file.h> header file. */
-#undef HAVE_SYS_FILE_H
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/procfs.h> header file. */
-#undef HAVE_SYS_PROCFS_H
-
-/* Define to 1 if you have the <sys/ptrace.h> header file. */
-#undef HAVE_SYS_PTRACE_H
-
-/* Define to 1 if you have the <sys/reg.h> header file. */
-#undef HAVE_SYS_REG_H
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#undef HAVE_SYS_RESOURCE_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/un.h> header file. */
-#undef HAVE_SYS_UN_H
-
-/* Define to 1 if you have the <sys/wait.h> header file. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define if TD_VERSION is available. */
-#undef HAVE_TD_VERSION
-
-/* Define to 1 if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
-
-/* Define to 1 if you have the <thread_db.h> header file. */
-#undef HAVE_THREAD_DB_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define if UST is available */
-#undef HAVE_UST
-
-/* Define to 1 if you have the `vfork' function. */
-#undef HAVE_VFORK
-
-/* Define to 1 if you have the <vfork.h> header file. */
-#undef HAVE_VFORK_H
-
-/* Define to 1 if you have the <wait.h> header file. */
-#undef HAVE_WAIT_H
-
-/* Define to 1 if `fork' works. */
-#undef HAVE_WORKING_FORK
-
-/* Define to 1 if `vfork' works. */
-#undef HAVE_WORKING_VFORK
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
 #undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
+#undef PACKAGE
+#undef PACKAGE_VERSION
 #undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Additional package description */
-#undef PKGVERSION
-
-/* Define to necessary symbol if this constant uses a non-standard name on
-   your system. */
-#undef PTHREAD_CREATE_JOINABLE
-
-/* Define to the type of arg 1 for ptrace. */
-#undef PTRACE_TYPE_ARG1
-
-/* Define to the type of arg 3 for ptrace. */
-#undef PTRACE_TYPE_ARG3
-
-/* Define to the type of arg 4 for ptrace. */
-#undef PTRACE_TYPE_ARG4
-
-/* Define to the type of arg 5 for ptrace. */
-#undef PTRACE_TYPE_ARG5
-
-/* Define as the return type of ptrace. */
-#undef PTRACE_TYPE_RET
-
-/* Bug reporting address */
-#undef REPORT_BUGS_TO
-
-/* The size of `long long', as computed by sizeof. */
-#undef SIZEOF_LONG_LONG
-
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at runtime.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-#undef STACK_DIRECTION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if we should use libthread_db directly. */
-#undef USE_LIBTHREAD_DB_DIRECTLY
-
-/* Enable extensions on AIX 3, Interix.  */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them.  */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris.  */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop.  */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
-/* Define if we should use libthread_db. */
-#undef USE_THREAD_DB
-
-/* Define if we should use the Windows API, instead of the POSIX API. On
-   Windows, we use the Windows API when building for MinGW, but the POSIX API
-   when building for Cygwin. */
-#undef USE_WIN32API
-
-/* Define if an XML target description is available. */
-#undef USE_XML
-
-/* Enable large inode numbers on Mac OS X 10.5.  */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
-   this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
-
-/* Define as `fork' if `vfork' does not work. */
-#undef vfork
+#include "gdbserver-config.h"
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 0bdc2145098..54dce062522 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -2695,7 +2695,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_headers="$ac_config_headers config.h:config.in"
+ac_config_headers="$ac_config_headers gdbserver-config.h:gdbserver-config.in"
+
+ac_config_files="$ac_config_files config.h:config.in"
 
 
 
@@ -11438,7 +11440,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
-    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
+    "gdbserver-config.h") CONFIG_HEADERS="$CONFIG_HEADERS gdbserver-config.h:gdbserver-config.in" ;;
+    "config.h") CONFIG_FILES="$CONFIG_FILES config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "gdbdepdir") CONFIG_COMMANDS="$CONFIG_COMMANDS gdbdepdir" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
@@ -11997,7 +12000,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
 
   case $ac_file$ac_mode in
-    "config.h":H) echo > stamp-h ;;
+    "gdbserver-config.h":H) echo > stamp-h ;;
     "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;;
     "gdbdepdir":C)
   for subdir in ${CONFIG_SRC_SUBDIR}
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 969354308c7..3afa6c1e37c 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -19,7 +19,8 @@ dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
 dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT(server.c)
-AC_CONFIG_HEADERS(config.h:config.in, [echo > stamp-h])
+AC_CONFIG_HEADERS(gdbserver-config.h:gdbserver-config.in, [echo > stamp-h])
+AC_CONFIG_FILES([config.h:config.in])
 
 AM_MAINTAINER_MODE
 
diff --git a/gdb/gdbserver/gdbserver-config.in b/gdb/gdbserver/gdbserver-config.in
new file mode 100644
index 00000000000..da8c313c360
--- /dev/null
+++ b/gdb/gdbserver/gdbserver-config.in
@@ -0,0 +1,496 @@
+/* config.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if std::thread works. */
+#undef CXX_STD_THREAD
+
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Define if self-testing features should be enabled */
+#undef GDB_SELF_TEST
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+   */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* define if the compiler supports basic C++11 syntax */
+#undef HAVE_CXX11
+
+/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
+   you don't. */
+#undef HAVE_DECL_ADDR_NO_RANDOMIZE
+
+/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_ASPRINTF
+
+/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if
+   you don't. */
+#undef HAVE_DECL_BASENAME
+
+/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
+#undef HAVE_DECL_FFS
+
+/* Define to 1 if you have the declaration of `perror', and to 0 if you don't.
+   */
+#undef HAVE_DECL_PERROR
+
+/* Define to 1 if you have the declaration of `ptrace', and to 0 if you don't.
+   */
+#undef HAVE_DECL_PTRACE
+
+/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_SNPRINTF
+
+/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
+   */
+#undef HAVE_DECL_STRSTR
+
+/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
+   */
+#undef HAVE_DECL_STRTOL
+
+/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOLL
+
+/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOUL
+
+/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOULL
+
+/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRVERSCMP
+
+/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_VASPRINTF
+
+/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_VSNPRINTF
+
+/* Define to 1 if you have the `dladdr' function. */
+#undef HAVE_DLADDR
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if the system has the type `Elf32_auxv_t'. */
+#undef HAVE_ELF32_AUXV_T
+
+/* Define to 1 if the system has the type `Elf64_auxv_t'. */
+#undef HAVE_ELF64_AUXV_T
+
+/* Define if <sys/procfs.h> has elf_fpregset_t. */
+#undef HAVE_ELF_FPREGSET_T
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `fdwalk' function. */
+#undef HAVE_FDWALK
+
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define if <sys/procfs.h> has fpregset_t. */
+#undef HAVE_FPREGSET_T
+
+/* Define to 1 if you have the `getauxval' function. */
+#undef HAVE_GETAUXVAL
+
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define to 1 if you have the `getrlimit' function. */
+#undef HAVE_GETRLIMIT
+
+/* Define to 1 if you have the `getrusage' function. */
+#undef HAVE_GETRUSAGE
+
+/* Define if <sys/procfs.h> has gregset_t. */
+#undef HAVE_GREGSET_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if your system has the kinfo_getfile function. */
+#undef HAVE_KINFO_GETFILE
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
+/* Define to 1 if you have the `dl' library (-ldl). */
+#undef HAVE_LIBDL
+
+/* Define if you have the ipt library. */
+#undef HAVE_LIBIPT
+
+/* Define if the target supports branch tracing. */
+#undef HAVE_LINUX_BTRACE
+
+/* Define to 1 if you have the <linux/elf.h> header file. */
+#undef HAVE_LINUX_ELF_H
+
+/* Define to 1 if you have the <linux/perf_event.h> header file. */
+#undef HAVE_LINUX_PERF_EVENT_H
+
+/* Define if the target supports register sets. */
+#undef HAVE_LINUX_REGSETS
+
+/* Define if the target supports PTRACE_PEEKUSR for register access. */
+#undef HAVE_LINUX_USRREGS
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
+/* Define if <thread_db.h> has lwpid_t. */
+#undef HAVE_LWPID_T
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#undef HAVE_NETINET_TCP_H
+
+/* Define if you support the personality syscall. */
+#undef HAVE_PERSONALITY
+
+/* Define to 1 if you have the `pipe' function. */
+#undef HAVE_PIPE
+
+/* Define to 1 if you have the `pipe2' function. */
+#undef HAVE_PIPE2
+
+/* Define to 1 if you have the `pread' function. */
+#undef HAVE_PREAD
+
+/* Define to 1 if you have the `pread64' function. */
+#undef HAVE_PREAD64
+
+/* Define if <sys/procfs.h> has prfpregset_t. */
+#undef HAVE_PRFPREGSET_T
+
+/* Define if <sys/procfs.h> has prgregset32_t. */
+#undef HAVE_PRGREGSET32_T
+
+/* Define if <sys/procfs.h> has prgregset_t. */
+#undef HAVE_PRGREGSET_T
+
+/* Define to 1 if you have the <proc_service.h> header file. */
+#undef HAVE_PROC_SERVICE_H
+
+/* Define if <thread_db.h> has psaddr_t. */
+#undef HAVE_PSADDR_T
+
+/* Have PTHREAD_PRIO_INHERIT. */
+#undef HAVE_PTHREAD_PRIO_INHERIT
+
+/* Define to 1 if you have the `pthread_setname_np' function. */
+#undef HAVE_PTHREAD_SETNAME_NP
+
+/* Define to 1 if you have the `pthread_sigmask' function. */
+#undef HAVE_PTHREAD_SIGMASK
+
+/* Define to 1 if you have the `ptrace64' function. */
+#undef HAVE_PTRACE64
+
+/* Define if the target supports PTRACE_GETFPXREGS for extended register
+   access. */
+#undef HAVE_PTRACE_GETFPXREGS
+
+/* Define if the target supports PTRACE_GETREGS for register access. */
+#undef HAVE_PTRACE_GETREGS
+
+/* Define to 1 if you have the <ptrace.h> header file. */
+#undef HAVE_PTRACE_H
+
+/* Define to 1 if you have the `pt_insn_event' function. */
+#undef HAVE_PT_INSN_EVENT
+
+/* Define to 1 if you have the `pwrite' function. */
+#undef HAVE_PWRITE
+
+/* Define to 1 if you have the `sbrk' function. */
+#undef HAVE_SBRK
+
+/* Define to 1 if you have the `setns' function. */
+#undef HAVE_SETNS
+
+/* Define to 1 if you have the `setpgid' function. */
+#undef HAVE_SETPGID
+
+/* Define to 1 if you have the `setpgrp' function. */
+#undef HAVE_SETPGRP
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Define to 1 if you have the `sigaltstack' function. */
+#undef HAVE_SIGALTSTACK
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Define to 1 if you have the `sigprocmask' function. */
+#undef HAVE_SIGPROCMASK
+
+/* Define if sigsetjmp is available. */
+#undef HAVE_SIGSETJMP
+
+/* Define to 1 if you have the `socketpair' function. */
+#undef HAVE_SOCKETPAIR
+
+/* Define to 1 if the system has the type `socklen_t'. */
+#undef HAVE_SOCKLEN_T
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if `enabled' is a member of `struct pt_insn'. */
+#undef HAVE_STRUCT_PT_INSN_ENABLED
+
+/* Define to 1 if `resynced' is a member of `struct pt_insn'. */
+#undef HAVE_STRUCT_PT_INSN_RESYNCED
+
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if `st_blocks' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLOCKS
+
+/* Define to 1 if `fs_base' is a member of `struct user_regs_struct'. */
+#undef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
+
+/* Define to 1 if `gs_base' is a member of `struct user_regs_struct'. */
+#undef HAVE_STRUCT_USER_REGS_STRUCT_GS_BASE
+
+/* Define to 1 if the target supports __sync_*_compare_and_swap */
+#undef HAVE_SYNC_BUILTINS
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/procfs.h> header file. */
+#undef HAVE_SYS_PROCFS_H
+
+/* Define to 1 if you have the <sys/ptrace.h> header file. */
+#undef HAVE_SYS_PTRACE_H
+
+/* Define to 1 if you have the <sys/reg.h> header file. */
+#undef HAVE_SYS_REG_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#undef HAVE_SYS_UN_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define if TD_VERSION is available. */
+#undef HAVE_TD_VERSION
+
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define to 1 if you have the <thread_db.h> header file. */
+#undef HAVE_THREAD_DB_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if UST is available */
+#undef HAVE_UST
+
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
+
+/* Define to 1 if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
+
+/* Define to 1 if you have the <wait.h> header file. */
+#undef HAVE_WAIT_H
+
+/* Define to 1 if `fork' works. */
+#undef HAVE_WORKING_FORK
+
+/* Define to 1 if `vfork' works. */
+#undef HAVE_WORKING_VFORK
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Additional package description */
+#undef PKGVERSION
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+   your system. */
+#undef PTHREAD_CREATE_JOINABLE
+
+/* Define to the type of arg 1 for ptrace. */
+#undef PTRACE_TYPE_ARG1
+
+/* Define to the type of arg 3 for ptrace. */
+#undef PTRACE_TYPE_ARG3
+
+/* Define to the type of arg 4 for ptrace. */
+#undef PTRACE_TYPE_ARG4
+
+/* Define to the type of arg 5 for ptrace. */
+#undef PTRACE_TYPE_ARG5
+
+/* Define as the return type of ptrace. */
+#undef PTRACE_TYPE_RET
+
+/* Bug reporting address */
+#undef REPORT_BUGS_TO
+
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if we should use libthread_db directly. */
+#undef USE_LIBTHREAD_DB_DIRECTLY
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define if we should use libthread_db. */
+#undef USE_THREAD_DB
+
+/* Define if we should use the Windows API, instead of the POSIX API. On
+   Windows, we use the Windows API when building for MinGW, but the POSIX API
+   when building for Cygwin. */
+#undef USE_WIN32API
+
+/* Define if an XML target description is available. */
+#undef USE_XML
+
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define as `fork' if `vfork' does not work. */
+#undef vfork
diff --git a/gdb/unittests/scoped_fd-selftests.c b/gdb/unittests/scoped_fd-selftests.c
index 3f024764245..96ca9bf7f63 100644
--- a/gdb/unittests/scoped_fd-selftests.c
+++ b/gdb/unittests/scoped_fd-selftests.c
@@ -21,7 +21,6 @@
 
 #include "gdbsupport/filestuff.h"
 #include "gdbsupport/scoped_fd.h"
-#include "config.h"
 #include "gdbsupport/selftest.h"
 
 namespace selftests {
diff --git a/gdb/unittests/scoped_mmap-selftests.c b/gdb/unittests/scoped_mmap-selftests.c
index fa963d1b47f..7e479e2bc06 100644
--- a/gdb/unittests/scoped_mmap-selftests.c
+++ b/gdb/unittests/scoped_mmap-selftests.c
@@ -21,7 +21,6 @@
 
 #include "gdbsupport/filestuff.h"
 #include "gdbsupport/scoped_mmap.h"
-#include "config.h"
 
 #if defined(HAVE_SYS_MMAN_H)
 
diff --git a/gdbsupport/common-defs.h b/gdbsupport/common-defs.h
index d823c41607c..d6fc62be413 100644
--- a/gdbsupport/common-defs.h
+++ b/gdbsupport/common-defs.h
@@ -20,32 +20,8 @@
 #ifndef COMMON_COMMON_DEFS_H
 #define COMMON_COMMON_DEFS_H
 
-#ifdef GDBSERVER
-
-#include <build-gnulib-gdbserver/config.h>
-
-#undef PACKAGE_NAME
-#undef PACKAGE
-#undef PACKAGE_VERSION
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-
 #include <config.h>
 
-#else  /* GDBSERVER */
-
-#include <gdbsupport/support-config.h>
-
-#undef PACKAGE_NAME
-#undef PACKAGE
-#undef PACKAGE_VERSION
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-
-#include "gnulib/config.h"
-
-#endif /* GDBSERVER */
-
 /* From:
     https://www.gnu.org/software/gnulib/manual/html_node/stdint_002eh.html
 
diff --git a/gdbsupport/config.in b/gdbsupport/config.in
index 6a6b0bc74f0..e7abc0b5079 100644
--- a/gdbsupport/config.in
+++ b/gdbsupport/config.in
@@ -1,414 +1,33 @@
-/* config.in.  Generated from configure.ac by autoheader.  */
+/* config.h for gdbsupport.
+   Copyright (C) 2020 Free Software Foundation, Inc.
 
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
-   systems. This function is required for `alloca.c' support on those systems.
-   */
-#undef CRAY_STACKSEG_END
+   This file is part of GDB.
 
-/* Define to 1 if std::thread works. */
-#undef CXX_STD_THREAD
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
 
-/* Define to 1 if using `alloca.c'. */
-#undef C_ALLOCA
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-/* Define to 1 if translation of program messages to the user's native
-   language is requested. */
-#undef ENABLE_NLS
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* Define if self-testing features should be enabled */
-#undef GDB_SELF_TEST
+/* This file is automatically generated from config.in.  It exists so
+   that "#include <config.h>" in header files (including gnulib
+   headers), includes this file, which then includes our real config.h
+   (which is called support-config.h), along with gnulib's
+   config.h.  */
 
-/* Define to 1 if you have `alloca', as a function or macro. */
-#undef HAVE_ALLOCA
+#include "gnulib/config.h"
 
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
-   */
-#undef HAVE_ALLOCA_H
-
-/* define if the compiler supports basic C++11 syntax */
-#undef HAVE_CXX11
-
-/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
-   you don't. */
-#undef HAVE_DECL_ADDR_NO_RANDOMIZE
-
-/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_ASPRINTF
-
-/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if
-   you don't. */
-#undef HAVE_DECL_BASENAME
-
-/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
-#undef HAVE_DECL_FFS
-
-/* Define to 1 if you have the declaration of `ptrace', and to 0 if you don't.
-   */
-#undef HAVE_DECL_PTRACE
-
-/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_SNPRINTF
-
-/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
-   */
-#undef HAVE_DECL_STRSTR
-
-/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
-   */
-#undef HAVE_DECL_STRTOL
-
-/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOLL
-
-/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOUL
-
-/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRTOULL
-
-/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRVERSCMP
-
-/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_VASPRINTF
-
-/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
-   don't. */
-#undef HAVE_DECL_VSNPRINTF
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define if <sys/procfs.h> has elf_fpregset_t. */
-#undef HAVE_ELF_FPREGSET_T
-
-/* Define to 1 if you have the `fdwalk' function. */
-#undef HAVE_FDWALK
-
-/* Define to 1 if you have the `fork' function. */
-#undef HAVE_FORK
-
-/* Define if <sys/procfs.h> has fpregset_t. */
-#undef HAVE_FPREGSET_T
-
-/* Define to 1 if you have the `getauxval' function. */
-#undef HAVE_GETAUXVAL
-
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define to 1 if you have the `getrlimit' function. */
-#undef HAVE_GETRLIMIT
-
-/* Define to 1 if you have the `getrusage' function. */
-#undef HAVE_GETRUSAGE
-
-/* Define if <sys/procfs.h> has gregset_t. */
-#undef HAVE_GREGSET_T
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if your system has the kinfo_getfile function. */
-#undef HAVE_KINFO_GETFILE
-
-/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
-#undef HAVE_LANGINFO_CODESET
-
-/* Define if you have the ipt library. */
-#undef HAVE_LIBIPT
-
-/* Define to 1 if you have the <linux/elf.h> header file. */
-#undef HAVE_LINUX_ELF_H
-
-/* Define to 1 if you have the <linux/perf_event.h> header file. */
-#undef HAVE_LINUX_PERF_EVENT_H
-
-/* Define to 1 if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
-/* Define to 1 if the system has the type `long long'. */
-#undef HAVE_LONG_LONG
-
-/* Define if <sys/procfs.h> has lwpid_t. */
-#undef HAVE_LWPID_T
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define if you support the personality syscall. */
-#undef HAVE_PERSONALITY
-
-/* Define to 1 if you have the `pipe' function. */
-#undef HAVE_PIPE
-
-/* Define to 1 if you have the `pipe2' function. */
-#undef HAVE_PIPE2
-
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#undef HAVE_PRFPREGSET_T
-
-/* Define if <sys/procfs.h> has prgregset32_t. */
-#undef HAVE_PRGREGSET32_T
-
-/* Define if <sys/procfs.h> has prgregset_t. */
-#undef HAVE_PRGREGSET_T
-
-/* Define to 1 if you have the <proc_service.h> header file. */
-#undef HAVE_PROC_SERVICE_H
-
-/* Define if <sys/procfs.h> has psaddr_t. */
-#undef HAVE_PSADDR_T
-
-/* Have PTHREAD_PRIO_INHERIT. */
-#undef HAVE_PTHREAD_PRIO_INHERIT
-
-/* Define to 1 if you have the `pthread_setname_np' function. */
-#undef HAVE_PTHREAD_SETNAME_NP
-
-/* Define to 1 if you have the `pthread_sigmask' function. */
-#undef HAVE_PTHREAD_SIGMASK
-
-/* Define to 1 if you have the `ptrace64' function. */
-#undef HAVE_PTRACE64
-
-/* Define to 1 if you have the <ptrace.h> header file. */
-#undef HAVE_PTRACE_H
-
-/* Define to 1 if you have the `pt_insn_event' function. */
-#undef HAVE_PT_INSN_EVENT
-
-/* Define to 1 if you have the `sbrk' function. */
-#undef HAVE_SBRK
-
-/* Define to 1 if you have the `setns' function. */
-#undef HAVE_SETNS
-
-/* Define to 1 if you have the `setpgid' function. */
-#undef HAVE_SETPGID
-
-/* Define to 1 if you have the `setpgrp' function. */
-#undef HAVE_SETPGRP
-
-/* Define to 1 if you have the `sigaction' function. */
-#undef HAVE_SIGACTION
-
-/* Define to 1 if you have the `sigaltstack' function. */
-#undef HAVE_SIGALTSTACK
-
-/* Define to 1 if you have the <signal.h> header file. */
-#undef HAVE_SIGNAL_H
-
-/* Define to 1 if you have the `sigprocmask' function. */
-#undef HAVE_SIGPROCMASK
-
-/* Define if sigsetjmp is available. */
-#undef HAVE_SIGSETJMP
-
-/* Define to 1 if you have the `socketpair' function. */
-#undef HAVE_SOCKETPAIR
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if `enabled' is a member of `struct pt_insn'. */
-#undef HAVE_STRUCT_PT_INSN_ENABLED
-
-/* Define to 1 if `resynced' is a member of `struct pt_insn'. */
-#undef HAVE_STRUCT_PT_INSN_RESYNCED
-
-/* Define to 1 if `st_blksize' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BLKSIZE
-
-/* Define to 1 if `st_blocks' is a member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_BLOCKS
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/procfs.h> header file. */
-#undef HAVE_SYS_PROCFS_H
-
-/* Define to 1 if you have the <sys/ptrace.h> header file. */
-#undef HAVE_SYS_PTRACE_H
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#undef HAVE_SYS_RESOURCE_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/un.h> header file. */
-#undef HAVE_SYS_UN_H
-
-/* Define to 1 if you have the <sys/wait.h> header file. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define to 1 if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
-
-/* Define to 1 if you have the <thread_db.h> header file. */
-#undef HAVE_THREAD_DB_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the `vfork' function. */
-#undef HAVE_VFORK
-
-/* Define to 1 if you have the <vfork.h> header file. */
-#undef HAVE_VFORK_H
-
-/* Define to 1 if you have the <wait.h> header file. */
-#undef HAVE_WAIT_H
-
-/* Define to 1 if you have the <windows.h> header file. */
-#undef HAVE_WINDOWS_H
-
-/* Define to 1 if `fork' works. */
-#undef HAVE_WORKING_FORK
-
-/* Define to 1 if `vfork' works. */
-#undef HAVE_WORKING_VFORK
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
 #undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
+#undef PACKAGE
+#undef PACKAGE_VERSION
 #undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define to necessary symbol if this constant uses a non-standard name on
-   your system. */
-#undef PTHREAD_CREATE_JOINABLE
-
-/* Define to the type of arg 1 for ptrace. */
-#undef PTRACE_TYPE_ARG1
-
-/* Define to the type of arg 3 for ptrace. */
-#undef PTRACE_TYPE_ARG3
-
-/* Define to the type of arg 4 for ptrace. */
-#undef PTRACE_TYPE_ARG4
-
-/* Define to the type of arg 5 for ptrace. */
-#undef PTRACE_TYPE_ARG5
-
-/* Define as the return type of ptrace. */
-#undef PTRACE_TYPE_RET
-
-/* The size of `long long', as computed by sizeof. */
-#undef SIZEOF_LONG_LONG
-
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at runtime.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-#undef STACK_DIRECTION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define to the word size for the target. */
-#undef TARGET_WORD_SIZE
-
-/* Enable extensions on AIX 3, Interix.  */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them.  */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris.  */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop.  */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
-/* Define if we should use the Windows API, instead of the POSIX API. On
-   Windows, we use the Windows API when building for MinGW, but the POSIX API
-   when building for Cygwin. */
-#undef USE_WIN32API
-
-/* Version number of package */
-#undef VERSION
-
-/* Enable large inode numbers on Mac OS X 10.5.  */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
-   this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
-
-/* Define as `fork' if `vfork' does not work. */
-#undef vfork
+#include <gdbsupport/support-config.h>
diff --git a/gdbsupport/configure b/gdbsupport/configure
index a0df06bbd53..b077e736349 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -2713,7 +2713,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_headers="$ac_config_headers support-config.h:config.in"
+ac_config_headers="$ac_config_headers support-config.h:support-config.in"
+
+ac_config_files="$ac_config_files config.h:config.in"
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -9687,7 +9689,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5
 $as_echo_n "checking for sigsetjmp... " >&6; }
 if ${gdb_cv_func_sigsetjmp+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -9695,7 +9697,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <setjmp.h>
+  #include <setjmp.h>
 
 int
 main ()
@@ -9714,11 +9716,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_sigsetjmp" >&5
 $as_echo "$gdb_cv_func_sigsetjmp" >&6; }
-if test "$gdb_cv_func_sigsetjmp" = "yes"; then
+  if test "$gdb_cv_func_sigsetjmp" = "yes"; then
 
 $as_echo "#define HAVE_SIGSETJMP 1" >>confdefs.h
 
-fi
+  fi
 
 
 # Check whether --with-intel_pt was given.
@@ -9728,23 +9730,23 @@ else
   with_intel_pt=auto
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use intel pt" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use intel pt" >&5
 $as_echo_n "checking whether to use intel pt... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_intel_pt" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_intel_pt" >&5
 $as_echo "$with_intel_pt" >&6; }
 
-if test "${with_intel_pt}" = no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Intel Processor Trace support disabled; some features may be unavailable." >&5
+  if test "${with_intel_pt}" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Intel Processor Trace support disabled; some features may be unavailable." >&5
 $as_echo "$as_me: WARNING: Intel Processor Trace support disabled; some features may be unavailable." >&2;}
-  HAVE_LIBIPT=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    HAVE_LIBIPT=no
+  else
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <linux/perf_event.h>
-#ifndef PERF_ATTR_SIZE_VER5
-# error
-#endif
+  #include <linux/perf_event.h>
+  #ifndef PERF_ATTR_SIZE_VER5
+  # error
+  #endif
 
 _ACEOF
 if ac_fn_c_try_cpp "$LINENO"; then :
@@ -9753,14 +9755,14 @@ else
   perf_event=no
 fi
 rm -f conftest.err conftest.i conftest.$ac_ext
-  if test "$perf_event" != yes; then
-    if test "$with_intel_pt" = yes; then
-      as_fn_error $? "linux/perf_event.h missing or too old" "$LINENO" 5
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&5
+    if test "$perf_event" != yes; then
+      if test "$with_intel_pt" = yes; then
+ as_fn_error $? "linux/perf_event.h missing or too old" "$LINENO" 5
+      else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&5
 $as_echo "$as_me: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&2;}
+      fi
     fi
-  fi
 
 
 
@@ -10224,17 +10226,17 @@ $as_echo "$LIBIPT" >&6; }
 
 
 
-  if test "$HAVE_LIBIPT" != yes; then
-    if test "$with_intel_pt" = yes; then
-      as_fn_error $? "libipt is missing or unusable" "$LINENO" 5
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libipt is missing or unusable; some features may be unavailable." >&5
+    if test "$HAVE_LIBIPT" != yes; then
+      if test "$with_intel_pt" = yes; then
+ as_fn_error $? "libipt is missing or unusable" "$LINENO" 5
+      else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libipt is missing or unusable; some features may be unavailable." >&5
 $as_echo "$as_me: WARNING: libipt is missing or unusable; some features may be unavailable." >&2;}
-    fi
-  else
-    save_LIBS=$LIBS
-    LIBS="$LIBS $LIBIPT"
-    for ac_func in pt_insn_event
+      fi
+    else
+      save_LIBS=$LIBS
+      LIBS="$LIBS $LIBIPT"
+      for ac_func in pt_insn_event
 do :
   ac_fn_c_check_func "$LINENO" "pt_insn_event" "ac_cv_func_pt_insn_event"
 if test "x$ac_cv_func_pt_insn_event" = xyes; then :
@@ -10245,7 +10247,7 @@ _ACEOF
 fi
 done
 
-    ac_fn_c_check_member "$LINENO" "struct pt_insn" "enabled" "ac_cv_member_struct_pt_insn_enabled" "#include <intel-pt.h>
+      ac_fn_c_check_member "$LINENO" "struct pt_insn" "enabled" "ac_cv_member_struct_pt_insn_enabled" "#include <intel-pt.h>
 "
 if test "x$ac_cv_member_struct_pt_insn_enabled" = xyes; then :
 
@@ -10266,12 +10268,12 @@ _ACEOF
 
 fi
 
-    LIBS=$save_LIBS
+      LIBS=$save_LIBS
+    fi
   fi
-fi
 
-if test "$ac_cv_header_sys_procfs_h" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gregset_t in sys/procfs.h" >&5
+  if test "$ac_cv_header_sys_procfs_h" = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for gregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_gregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10308,7 +10310,7 @@ $as_echo "#define HAVE_GREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_gregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_gregset_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpregset_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for fpregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_fpregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10345,7 +10347,7 @@ $as_echo "#define HAVE_FPREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_fpregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_fpregset_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for prgregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_prgregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10382,7 +10384,7 @@ $as_echo "#define HAVE_PRGREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_prgregset_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prfpregset_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prfpregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for prfpregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_prfpregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10419,7 +10421,7 @@ $as_echo "#define HAVE_PRFPREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prfpregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_prfpregset_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset32_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset32_t in sys/procfs.h" >&5
 $as_echo_n "checking for prgregset32_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_prgregset32_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10456,7 +10458,7 @@ $as_echo "#define HAVE_PRGREGSET32_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset32_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_prgregset32_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpid_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpid_t in sys/procfs.h" >&5
 $as_echo_n "checking for lwpid_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_lwpid_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10493,7 +10495,7 @@ $as_echo "#define HAVE_LWPID_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_lwpid_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_lwpid_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psaddr_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psaddr_t in sys/procfs.h" >&5
 $as_echo_n "checking for psaddr_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_psaddr_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10530,7 +10532,7 @@ $as_echo "#define HAVE_PSADDR_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_psaddr_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_psaddr_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_fpregset_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_fpregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for elf_fpregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_elf_fpregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10567,7 +10569,7 @@ $as_echo "#define HAVE_ELF_FPREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6; }
 
-fi
+  fi
 
 
 # Check whether we will enable the inclusion of unit tests when
@@ -11563,7 +11565,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
-    "support-config.h") CONFIG_HEADERS="$CONFIG_HEADERS support-config.h:config.in" ;;
+    "support-config.h") CONFIG_HEADERS="$CONFIG_HEADERS support-config.h:support-config.in" ;;
+    "config.h") CONFIG_FILES="$CONFIG_FILES config.h:config.in" ;;
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
 
diff --git a/gdbsupport/configure.ac b/gdbsupport/configure.ac
index af14d7bb92d..27a6de67a0c 100644
--- a/gdbsupport/configure.ac
+++ b/gdbsupport/configure.ac
@@ -18,7 +18,8 @@ dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT([gdbsupport], 1.0)
 AC_CONFIG_SRCDIR(common-defs.h)
-AC_CONFIG_HEADER(support-config.h:config.in)
+AC_CONFIG_HEADER(support-config.h:support-config.in)
+AC_CONFIG_FILES([config.h:config.in])
 AC_CANONICAL_SYSTEM
 AM_MAINTAINER_MODE
 AC_CONFIG_AUX_DIR(..)
diff --git a/gdbsupport/support-config.in b/gdbsupport/support-config.in
new file mode 100644
index 00000000000..6a6b0bc74f0
--- /dev/null
+++ b/gdbsupport/support-config.in
@@ -0,0 +1,414 @@
+/* config.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if std::thread works. */
+#undef CXX_STD_THREAD
+
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
+#undef ENABLE_NLS
+
+/* Define if self-testing features should be enabled */
+#undef GDB_SELF_TEST
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+   */
+#undef HAVE_ALLOCA_H
+
+/* define if the compiler supports basic C++11 syntax */
+#undef HAVE_CXX11
+
+/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
+   you don't. */
+#undef HAVE_DECL_ADDR_NO_RANDOMIZE
+
+/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_ASPRINTF
+
+/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if
+   you don't. */
+#undef HAVE_DECL_BASENAME
+
+/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
+#undef HAVE_DECL_FFS
+
+/* Define to 1 if you have the declaration of `ptrace', and to 0 if you don't.
+   */
+#undef HAVE_DECL_PTRACE
+
+/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_SNPRINTF
+
+/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
+   */
+#undef HAVE_DECL_STRSTR
+
+/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
+   */
+#undef HAVE_DECL_STRTOL
+
+/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOLL
+
+/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOUL
+
+/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRTOULL
+
+/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRVERSCMP
+
+/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_VASPRINTF
+
+/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_VSNPRINTF
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define if <sys/procfs.h> has elf_fpregset_t. */
+#undef HAVE_ELF_FPREGSET_T
+
+/* Define to 1 if you have the `fdwalk' function. */
+#undef HAVE_FDWALK
+
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define if <sys/procfs.h> has fpregset_t. */
+#undef HAVE_FPREGSET_T
+
+/* Define to 1 if you have the `getauxval' function. */
+#undef HAVE_GETAUXVAL
+
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define to 1 if you have the `getrlimit' function. */
+#undef HAVE_GETRLIMIT
+
+/* Define to 1 if you have the `getrusage' function. */
+#undef HAVE_GETRUSAGE
+
+/* Define if <sys/procfs.h> has gregset_t. */
+#undef HAVE_GREGSET_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if your system has the kinfo_getfile function. */
+#undef HAVE_KINFO_GETFILE
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
+/* Define if you have the ipt library. */
+#undef HAVE_LIBIPT
+
+/* Define to 1 if you have the <linux/elf.h> header file. */
+#undef HAVE_LINUX_ELF_H
+
+/* Define to 1 if you have the <linux/perf_event.h> header file. */
+#undef HAVE_LINUX_PERF_EVENT_H
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
+/* Define if <sys/procfs.h> has lwpid_t. */
+#undef HAVE_LWPID_T
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define if you support the personality syscall. */
+#undef HAVE_PERSONALITY
+
+/* Define to 1 if you have the `pipe' function. */
+#undef HAVE_PIPE
+
+/* Define to 1 if you have the `pipe2' function. */
+#undef HAVE_PIPE2
+
+/* Define if <sys/procfs.h> has prfpregset_t. */
+#undef HAVE_PRFPREGSET_T
+
+/* Define if <sys/procfs.h> has prgregset32_t. */
+#undef HAVE_PRGREGSET32_T
+
+/* Define if <sys/procfs.h> has prgregset_t. */
+#undef HAVE_PRGREGSET_T
+
+/* Define to 1 if you have the <proc_service.h> header file. */
+#undef HAVE_PROC_SERVICE_H
+
+/* Define if <sys/procfs.h> has psaddr_t. */
+#undef HAVE_PSADDR_T
+
+/* Have PTHREAD_PRIO_INHERIT. */
+#undef HAVE_PTHREAD_PRIO_INHERIT
+
+/* Define to 1 if you have the `pthread_setname_np' function. */
+#undef HAVE_PTHREAD_SETNAME_NP
+
+/* Define to 1 if you have the `pthread_sigmask' function. */
+#undef HAVE_PTHREAD_SIGMASK
+
+/* Define to 1 if you have the `ptrace64' function. */
+#undef HAVE_PTRACE64
+
+/* Define to 1 if you have the <ptrace.h> header file. */
+#undef HAVE_PTRACE_H
+
+/* Define to 1 if you have the `pt_insn_event' function. */
+#undef HAVE_PT_INSN_EVENT
+
+/* Define to 1 if you have the `sbrk' function. */
+#undef HAVE_SBRK
+
+/* Define to 1 if you have the `setns' function. */
+#undef HAVE_SETNS
+
+/* Define to 1 if you have the `setpgid' function. */
+#undef HAVE_SETPGID
+
+/* Define to 1 if you have the `setpgrp' function. */
+#undef HAVE_SETPGRP
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Define to 1 if you have the `sigaltstack' function. */
+#undef HAVE_SIGALTSTACK
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Define to 1 if you have the `sigprocmask' function. */
+#undef HAVE_SIGPROCMASK
+
+/* Define if sigsetjmp is available. */
+#undef HAVE_SIGSETJMP
+
+/* Define to 1 if you have the `socketpair' function. */
+#undef HAVE_SOCKETPAIR
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if `enabled' is a member of `struct pt_insn'. */
+#undef HAVE_STRUCT_PT_INSN_ENABLED
+
+/* Define to 1 if `resynced' is a member of `struct pt_insn'. */
+#undef HAVE_STRUCT_PT_INSN_RESYNCED
+
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if `st_blocks' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLOCKS
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/procfs.h> header file. */
+#undef HAVE_SYS_PROCFS_H
+
+/* Define to 1 if you have the <sys/ptrace.h> header file. */
+#undef HAVE_SYS_PTRACE_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#undef HAVE_SYS_UN_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define to 1 if you have the <thread_db.h> header file. */
+#undef HAVE_THREAD_DB_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
+
+/* Define to 1 if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
+
+/* Define to 1 if you have the <wait.h> header file. */
+#undef HAVE_WAIT_H
+
+/* Define to 1 if you have the <windows.h> header file. */
+#undef HAVE_WINDOWS_H
+
+/* Define to 1 if `fork' works. */
+#undef HAVE_WORKING_FORK
+
+/* Define to 1 if `vfork' works. */
+#undef HAVE_WORKING_VFORK
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+   your system. */
+#undef PTHREAD_CREATE_JOINABLE
+
+/* Define to the type of arg 1 for ptrace. */
+#undef PTRACE_TYPE_ARG1
+
+/* Define to the type of arg 3 for ptrace. */
+#undef PTRACE_TYPE_ARG3
+
+/* Define to the type of arg 4 for ptrace. */
+#undef PTRACE_TYPE_ARG4
+
+/* Define to the type of arg 5 for ptrace. */
+#undef PTRACE_TYPE_ARG5
+
+/* Define as the return type of ptrace. */
+#undef PTRACE_TYPE_RET
+
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to the word size for the target. */
+#undef TARGET_WORD_SIZE
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define if we should use the Windows API, instead of the POSIX API. On
+   Windows, we use the Windows API when building for MinGW, but the POSIX API
+   when building for Cygwin. */
+#undef USE_WIN32API
+
+/* Version number of package */
+#undef VERSION
+
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define as `fork' if `vfork' does not work. */
+#undef vfork

base-commit: aad09917e04b33da463f1703aab8d057cfe3f54e
--
2.14.5

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Pedro Alves-7
On 1/15/20 9:35 PM, Pedro Alves wrote:

> On 1/15/20 8:23 PM, Pedro Alves wrote:
>> On 1/15/20 2:55 PM, Pedro Alves wrote:
>>> On 1/15/20 2:41 PM, Pedro Alves wrote:
>>>> Don't know what I think of gnulib headers including <config.h>.
>>>> Maybe we should rename gdb's config.h to gdb-config.h too.
>>>
>>> Hit reply to soon.  I meant to add,
>>>
>>> ... and then, add a manually-written config.h in the build
>>> dir that does:
>>>
>>>  #include <gdbsupport/support-config.h>
>>>  #include <gdb-config.h>
>>>
>>> We'd do the same to gdbsupport, add a config.h in its
>>> build dir that does:
>>>
>>>  #include "gnulib/config.h"
>>>  #include <support-config.h>
>>>
>>> Those config.h files would go in the build dirs so that
>>> they're not picked by other build directories.
>>>
>>> With that, any "#include <config.h>" in any header ends up
>>> picking the currently-being-built project's config.h, plus
>>> the dependencies' config.h files.
>>>
>>> Just a half-baked thought.  Not sure it's the best idea.
>>
>> I tried it and it seems to work OK.  Fixes the build at least.
>> Still not sure it's the best idea.  WDYT?
>>
>> The patch is actually quite small, but since I've rename
>> config.h -> gdb-config.h etc., and _then_ added new config.h
>> files, git doesn't notice the renames.
>>
>> I wonder whether there's anything could do to stop gnulib and
>> gdbsupport's configure from defining PACKAGE_NAME etc. in their
>> generated config.h files.
>>
> Here's an improved version, which fixes gdbserver's standalone
> build, simplifies gdbsupport's config.h (there's no need for
> #ifdef GDBSERVER stuff since gdbserver doesn't use gdbsupport
> as a library yet), and adds copyright/intro comments.
>

I put this in users/palves/config.h if you want to play with it.

Thanks,
Pedro Alves

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Pedro Alves-7
On 1/15/20 9:46 PM, Pedro Alves wrote:

> On 1/15/20 9:35 PM, Pedro Alves wrote:
>> On 1/15/20 8:23 PM, Pedro Alves wrote:
>>> On 1/15/20 2:55 PM, Pedro Alves wrote:
>>>> On 1/15/20 2:41 PM, Pedro Alves wrote:
>>>>> Don't know what I think of gnulib headers including <config.h>.
>>>>> Maybe we should rename gdb's config.h to gdb-config.h too.
>>>>
>>>> Hit reply to soon.  I meant to add,
>>>>
>>>> ... and then, add a manually-written config.h in the build
>>>> dir that does:
>>>>
>>>>  #include <gdbsupport/support-config.h>
>>>>  #include <gdb-config.h>
>>>>
>>>> We'd do the same to gdbsupport, add a config.h in its
>>>> build dir that does:
>>>>
>>>>  #include "gnulib/config.h"
>>>>  #include <support-config.h>
>>>>
>>>> Those config.h files would go in the build dirs so that
>>>> they're not picked by other build directories.
>>>>
>>>> With that, any "#include <config.h>" in any header ends up
>>>> picking the currently-being-built project's config.h, plus
>>>> the dependencies' config.h files.
>>>>
>>>> Just a half-baked thought.  Not sure it's the best idea.
>>>
>>> I tried it and it seems to work OK.  Fixes the build at least.
>>> Still not sure it's the best idea.  WDYT?
>>>
>>> The patch is actually quite small, but since I've rename
>>> config.h -> gdb-config.h etc., and _then_ added new config.h
>>> files, git doesn't notice the renames.
>>>
>>> I wonder whether there's anything could do to stop gnulib and
>>> gdbsupport's configure from defining PACKAGE_NAME etc. in their
>>> generated config.h files.
>>>
>> Here's an improved version, which fixes gdbserver's standalone
>> build, simplifies gdbsupport's config.h (there's no need for
>> #ifdef GDBSERVER stuff since gdbserver doesn't use gdbsupport
>> as a library yet), and adds copyright/intro comments.
>>
>
> I put this in users/palves/config.h if you want to play with it.

I've also pushed a patch there to fix the missing -std=gnu++11 issue.

Thanks,
Pedro Alves

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Sourceware - gdb-patches mailing list
On Wed, Jan 15, 2020 at 5:12 PM Pedro Alves <[hidden email]> wrote:

>
> On 1/15/20 9:46 PM, Pedro Alves wrote:
> > On 1/15/20 9:35 PM, Pedro Alves wrote:
> >> On 1/15/20 8:23 PM, Pedro Alves wrote:
> >>> On 1/15/20 2:55 PM, Pedro Alves wrote:
> >>>> On 1/15/20 2:41 PM, Pedro Alves wrote:
> >>>>> Don't know what I think of gnulib headers including <config.h>.
> >>>>> Maybe we should rename gdb's config.h to gdb-config.h too.
> >>>>
> >>>> Hit reply to soon.  I meant to add,
> >>>>
> >>>> ... and then, add a manually-written config.h in the build
> >>>> dir that does:
> >>>>
> >>>>  #include <gdbsupport/support-config.h>
> >>>>  #include <gdb-config.h>
> >>>>
> >>>> We'd do the same to gdbsupport, add a config.h in its
> >>>> build dir that does:
> >>>>
> >>>>  #include "gnulib/config.h"
> >>>>  #include <support-config.h>
> >>>>
> >>>> Those config.h files would go in the build dirs so that
> >>>> they're not picked by other build directories.
> >>>>
> >>>> With that, any "#include <config.h>" in any header ends up
> >>>> picking the currently-being-built project's config.h, plus
> >>>> the dependencies' config.h files.
> >>>>
> >>>> Just a half-baked thought.  Not sure it's the best idea.
> >>>
> >>> I tried it and it seems to work OK.  Fixes the build at least.
> >>> Still not sure it's the best idea.  WDYT?
> >>>
> >>> The patch is actually quite small, but since I've rename
> >>> config.h -> gdb-config.h etc., and _then_ added new config.h
> >>> files, git doesn't notice the renames.
> >>>
> >>> I wonder whether there's anything could do to stop gnulib and
> >>> gdbsupport's configure from defining PACKAGE_NAME etc. in their
> >>> generated config.h files.
> >>>
> >> Here's an improved version, which fixes gdbserver's standalone
> >> build, simplifies gdbsupport's config.h (there's no need for
> >> #ifdef GDBSERVER stuff since gdbserver doesn't use gdbsupport
> >> as a library yet), and adds copyright/intro comments.
> >>
> >
> > I put this in users/palves/config.h if you want to play with it.
>
> I've also pushed a patch there to fix the missing -std=gnu++11 issue.

For that patch, why not just use AM_CFLAGS/AM_CXXFLAGS?

Christian
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Simon Marchi-4
In reply to this post by Tom Tromey-2
On 2020-01-08 7:58 p.m., Tom Tromey wrote:

> Here is an update of the series to move gdbsupport to the top level.
> This is one step in the bigger projecct to move gdbserver to top
> level.
>
> In this patch, gdbsupport is given its own configure script --
> however, gdbserver still builds its own copy.  gdb and gdbserver won't
> share a gdbsupport library until the final series.
>
> This version of the patch fixes up the problems that Pedro pointed out
> in the shared nat/ and target/ code.  In particular, now they can
> simply rely on the shared config.h.  This is enforced by ensuring that
> the necessary defines are all available; the checker script I used to
> find the issues is provided in patch #5.
>
> I wasn't able to send this through the buildbot.  I did test it on
> x86-64 Fedora 29.  I also build it using a mingw cross.
>
> If you want to try it, it is on the branch
> submit/move-gdbsupport-to-top in my github.
>
> Let me know what you think.
>
> Tom

Hi Tom,

I think we are missing a dependency of the gdbsupport directory on the bfd
directory.  In a build from scratch, try to do "make all-gdbsupport".  You
should get:

make[2]: Entering directory '/home/simark/build/binutils-gdb/gdbsupport'
  CC       agent.o
In file included from /home/simark/src/binutils-gdb/gdbsupport/common-defs.h:109,
                 from /home/simark/src/binutils-gdb/gdbsupport/agent.c:20:
/home/simark/src/binutils-gdb/gdbsupport/common-types.h:35:10: fatal error: bfd.h: No such file or directory
   35 | #include "bfd.h"
      |          ^~~~~~~

Note that on my development machine, I didn't see this problem at first, but
then I realized that it was including /usr/include/bfd.h.  After I deleted it,
I got the error.

In the top-level Makefile, gdbsupport currently depends on configure-bfd.  I
suppose it should depend on all-bfd, since it needs for bfd.h to be generated?

Simon
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Simon Marchi-4
In reply to this post by Pedro Alves-7
On 2020-01-15 4:35 p.m., Pedro Alves wrote:
> Here's an improved version, which fixes gdbserver's standalone
> build, simplifies gdbsupport's config.h (there's no need for
> #ifdef GDBSERVER stuff since gdbserver doesn't use gdbsupport
> as a library yet), and adds copyright/intro comments.

I have to admit I'm a bit lost in the spaghetti of config.h inclusion.  I don't
understand, for example, why GDB needs to include gdbsupport's config.  All the
features that GDB needs are checked by its own configure script, aren't they?

I noticed that build/gdb/config.h doesn't get automatically regenerated from
src/gdb/config.in whenever the latter changes.  It could use a Makefile rule that
uses config.status to re-generate it, like there is for some other files.

There's also the variable "generated_files" in the Makefile, should gdb-support.h
be in there?

> diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
> index da8c313c360..9e661d8e13c 100644
> --- a/gdb/gdbserver/config.in
> +++ b/gdb/gdbserver/config.in
> @@ -1,496 +1,32 @@
> -/* config.in.  Generated from configure.ac by autoheader.  */
> +/* config.h for the remote server for GDB.
> +   Copyright (C) 2020 Free Software Foundation, Inc.
>  
> -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
> -   systems. This function is required for `alloca.c' support on those systems.
> -   */
> -#undef CRAY_STACKSEG_END
> +   This file is part of GDB.
>  
> -/* Define to 1 if std::thread works. */
> -#undef CXX_STD_THREAD
> +   This program is free software; you can redistribute it and/or modify
> +   it under the terms of the GNU General Public License as published by
> +   the Free Software Foundation; either version 3 of the License, or
> +   (at your option) any later version.
>  
> -/* Define to 1 if using `alloca.c'. */
> -#undef C_ALLOCA
> +   This program is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +   GNU General Public License for more details.
>  
> -/* Define if self-testing features should be enabled */
> -#undef GDB_SELF_TEST
> +   You should have received a copy of the GNU General Public License
> +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
>  
> -/* Define to 1 if you have `alloca', as a function or macro. */
> -#undef HAVE_ALLOCA
> +/* This file is automatically generated from config.in.  It exists so
> +   that "#include <config.h>" in header files (including gnulib
> +   headers), includes this file, which then includes our real config.h
> +   (which is called gdb-config.h), along with gnulib's config.h.  */

The gdb-config.h above should be gdbserver-config.h.

Simon
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2 0/6] Move gdbsupport to top level

Pedro Alves-7
On 1/16/20 4:23 AM, Simon Marchi wrote:
> On 2020-01-15 4:35 p.m., Pedro Alves wrote:
>> Here's an improved version, which fixes gdbserver's standalone
>> build, simplifies gdbsupport's config.h (there's no need for
>> #ifdef GDBSERVER stuff since gdbserver doesn't use gdbsupport
>> as a library yet), and adds copyright/intro comments.
>
> I have to admit I'm a bit lost in the spaghetti of config.h inclusion.  I don't
> understand, for example, why GDB needs to include gdbsupport's config.  All the
> features that GDB needs are checked by its own configure script, aren't they?

Good question.  I guess the idea is that instead of having all of gdb, gdbserver,
and gdbsupport share tests via gdbsupport/common.m4, having run them more
than once, we can run the tests only once by gdbsupport's configure, and then
include the support-config.h file.

I've given this another thought, and went through the process of thinking
that this more complicated patch isn't really necessary, and then concluded
that having it makes things more normalized between all the dirs.  But
we can simplify it -- don't need to generate the "trampoline" config.h.

My initial thought that led to the more complicated patch was to make
sure that that "#include <config.h>" in gnulib's libc-config.h picks up
gnulib config.h.  But it's really harmless if that picks some other config.h
instead as long as we're sure that the gnulib config.h is also included
somehow.  Which we are sure of, from the fact that common-defs.h
is always included as first thing in every .c file.

So while we're building gdbsupport, we don't have any config.h in the
include path other than the BFD one, and we hit the problem.  We could
add an empty gdbsupport/config/config.h file in the
source and add -Igdbsupport/config/ to gdbsupport's Makefile, or,
add gnulib's build dir to the include path, like in my original patch.

So the original solution of adding the gnulib dir to the include path
isn't that bad, though I call it a hack.

The gdbsupport/config/config.h approach is pedantically less of a hack
and more in line with the "solution" that we happen to have in gdb
and gdbserver's dirs currently, by chance.

OK, so I tried that.  And then, I realized, well, if we have that
new config.h file, then we could as well move the gnulib config.h inclusion
to that file, like I was doing in the complicated patch.  Essentially
it's the same as the complicated patch, except the "trampoline" config.h
isn't generated in the build dir, but instead is put in the source tree.
We'd do the same to gdb and gdbserver, for consistency.

(I actually named the new dirs "config.h", as there's already a config
dir under gdb.  It's more to the point, anyway.)

>
> I noticed that build/gdb/config.h doesn't get automatically regenerated from
> src/gdb/config.in whenever the latter changes.  It could use a Makefile rule that
> uses config.status to re-generate it, like there is for some other files.

Indeed.  I also noticed that I missed regenerating gdbsupport/Makefile.in ...

>
> There's also the variable "generated_files" in the Makefile, should gdb-support.h
> be in there?

Yeah, I guess so.

> The gdb-config.h above should be gdbserver-config.h.
Here's v2.  WDYT?  Which of all the approaches discussed would
you prefer?

(If we go this route, I should probably generalize the intro comments
a bit so that the multiple versions have the exact same comment.)

From a50c9d27d8aba77bc3cf619fc029776ea8658dbf Mon Sep 17 00:00:00 2001
From: Pedro Alves <[hidden email]>
Date: Wed, 15 Jan 2020 17:49:01 +0000
Subject: [PATCH v2] config.h

---
 gdb/Makefile.in                                  |  9 +--
 gdb/config.h/config.h                            | 40 +++++++++++
 gdb/configure                                    |  6 +-
 gdb/configure.ac                                 |  2 +-
 gdb/{config.in => gdb-config.in}                 |  0
 gdb/gdbserver/Makefile.in                        |  2 +-
 gdb/gdbserver/config.h/config.h                  | 32 +++++++++
 gdb/gdbserver/configure                          |  6 +-
 gdb/gdbserver/configure.ac                       |  2 +-
 gdb/gdbserver/{config.in => gdbserver-config.in} |  0
 gdb/unittests/scoped_fd-selftests.c              |  1 -
 gdb/unittests/scoped_mmap-selftests.c            |  1 -
 gdbsupport/Makefile.am                           |  2 +-
 gdbsupport/Makefile.in                           |  8 +--
 gdbsupport/common-defs.h                         | 24 -------
 gdbsupport/config.h/config.h                     | 32 +++++++++
 gdbsupport/configure                             | 92 ++++++++++++------------
 gdbsupport/configure.ac                          |  2 +-
 gdbsupport/{config.in => support-config.in}      |  0
 19 files changed, 170 insertions(+), 91 deletions(-)
 create mode 100644 gdb/config.h/config.h
 rename gdb/{config.in => gdb-config.in} (100%)
 create mode 100644 gdb/gdbserver/config.h/config.h
 rename gdb/gdbserver/{config.in => gdbserver-config.in} (100%)
 create mode 100644 gdbsupport/config.h/config.h
 rename gdbsupport/{config.in => support-config.in} (100%)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 45d1586e85e..b5e973f4cf5 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -563,7 +563,7 @@ CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
 # your system doesn't have fcntl.h in /usr/include (which is where it
 # should be according to Posix).
 DEFS = @DEFS@
-GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config \
+GDB_CFLAGS = -I$(srcdir)/config.h -I. -I$(srcdir) -I$(srcdir)/config \
  -DLOCALEDIR="\"$(localedir)\"" $(DEFS)
 
 # MH_CFLAGS, if defined, has host-dependent CFLAGS from the config directory.
@@ -1574,6 +1574,7 @@ DISTSTUFF = $(YYFILES)
 generated_files = \
  ada-lex.c \
  config.h \
+ gdb-config.h \
  jit-reader.h \
  $(NAT_GENERATED_FILES) \
  $(NM_H)
@@ -1974,9 +1975,9 @@ gdb-gdb.py: $(srcdir)/gdb-gdb.py.in
 gdb-gdb.gdb: $(srcdir)/gdb-gdb.gdb.in
  $(SHELL) config.status $@
 
-config.h: stamp-h ; @true
-stamp-h: $(srcdir)/config.in config.status
- $(SHELL) config.status config.h
+gdb-config.h: stamp-h ; @true
+stamp-h: $(srcdir)/gdb-config.in config.status
+ $(SHELL) config.status gdb-config.h
 
 nm.h: stamp-nmh ; @true
 stamp-nmh: config.status
diff --git a/gdb/config.h/config.h b/gdb/config.h/config.h
new file mode 100644
index 00000000000..f0c6cda4e00
--- /dev/null
+++ b/gdb/config.h/config.h
@@ -0,0 +1,40 @@
+/* config.h for GDB, the GNU debugger.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* This file exists so that "#include <config.h>" in header files
+   (including gnulib headers), includes this file, which then includes
+   our real config.h (which is called gdb-config.h), along with
+   gnulib's config.h and gdbsupport's config.h.  */
+
+#include "gnulib/config.h"
+
+#undef PACKAGE_NAME
+#undef PACKAGE
+#undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+
+#include <gdbsupport/support-config.h>
+
+#undef PACKAGE_NAME
+#undef PACKAGE
+#undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+
+#include "gdb-config.h"
diff --git a/gdb/configure b/gdb/configure
index 72ffad8d37b..1f2f3ab5f6d 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -2945,7 +2945,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_headers="$ac_config_headers config.h:config.in"
+ac_config_headers="$ac_config_headers gdb-config.h:gdb-config.in"
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
@@ -19729,7 +19729,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
-    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
+    "gdb-config.h") CONFIG_HEADERS="$CONFIG_HEADERS gdb-config.h:gdb-config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "jit-reader.h") CONFIG_FILES="$CONFIG_FILES jit-reader.h:jit-reader.in" ;;
     "nm.h") CONFIG_LINKS="$CONFIG_LINKS nm.h:$GDB_NM_FILE" ;;
@@ -20365,7 +20365,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
 
   case $ac_file$ac_mode in
-    "config.h":H) echo > stamp-h ;;
+    "gdb-config.h":H) echo > stamp-h ;;
     "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;;
     "nm.h":L) echo > stamp-nmh ;;
     "gcore":F) chmod +x gcore ;;
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 0ca169101b3..6627693a85d 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -19,7 +19,7 @@ dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
 dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT(main.c)
-AC_CONFIG_HEADERS(config.h:config.in, [echo > stamp-h])
+AC_CONFIG_HEADERS(gdb-config.h:gdb-config.in, [echo > stamp-h])
 AM_MAINTAINER_MODE
 
 # Set the 'development' global.
diff --git a/gdb/config.in b/gdb/gdb-config.in
similarity index 100%
rename from gdb/config.in
rename to gdb/gdb-config.in
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 38f30a02770..f53e6ef5737 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -120,7 +120,7 @@ INCSUPPORT = -I$(srcdir)/../.. -I../..
 # in those directories should be included with the subdirectory.
 # e.g.: "target/wait.h".
 #
-INCLUDE_CFLAGS = -I. -I${srcdir} \
+INCLUDE_CFLAGS = -I$(srcdir)/config.h -I. -I${srcdir} \
  -I$(srcdir)/../regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \
  $(INCGNU) $(INCSUPPORT)
 
diff --git a/gdb/gdbserver/config.h/config.h b/gdb/gdbserver/config.h/config.h
new file mode 100644
index 00000000000..ed4340eca3d
--- /dev/null
+++ b/gdb/gdbserver/config.h/config.h
@@ -0,0 +1,32 @@
+/* config.h for the remote server for GDB.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* This exists so that "#include <config.h>" in header files
+   (including gnulib headers), includes this file, which then includes
+   our real config.h (which is called gdbserver-config.h), along with
+   gnulib's config.h.  */
+
+#include <build-gnulib-gdbserver/config.h>
+
+#undef PACKAGE_NAME
+#undef PACKAGE
+#undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+
+#include "gdbserver-config.h"
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 0bdc2145098..f44c3661637 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -2695,7 +2695,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_headers="$ac_config_headers config.h:config.in"
+ac_config_headers="$ac_config_headers gdbserver-config.h:gdbserver-config.in"
 
 
 
@@ -11438,7 +11438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
-    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
+    "gdbserver-config.h") CONFIG_HEADERS="$CONFIG_HEADERS gdbserver-config.h:gdbserver-config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "gdbdepdir") CONFIG_COMMANDS="$CONFIG_COMMANDS gdbdepdir" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
@@ -11997,7 +11997,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
 
   case $ac_file$ac_mode in
-    "config.h":H) echo > stamp-h ;;
+    "gdbserver-config.h":H) echo > stamp-h ;;
     "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;;
     "gdbdepdir":C)
   for subdir in ${CONFIG_SRC_SUBDIR}
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 969354308c7..ed6e3dacdd4 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -19,7 +19,7 @@ dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
 dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT(server.c)
-AC_CONFIG_HEADERS(config.h:config.in, [echo > stamp-h])
+AC_CONFIG_HEADERS(gdbserver-config.h:gdbserver-config.in, [echo > stamp-h])
 
 AM_MAINTAINER_MODE
 
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/gdbserver-config.in
similarity index 100%
rename from gdb/gdbserver/config.in
rename to gdb/gdbserver/gdbserver-config.in
diff --git a/gdb/unittests/scoped_fd-selftests.c b/gdb/unittests/scoped_fd-selftests.c
index 3f024764245..96ca9bf7f63 100644
--- a/gdb/unittests/scoped_fd-selftests.c
+++ b/gdb/unittests/scoped_fd-selftests.c
@@ -21,7 +21,6 @@
 
 #include "gdbsupport/filestuff.h"
 #include "gdbsupport/scoped_fd.h"
-#include "config.h"
 #include "gdbsupport/selftest.h"
 
 namespace selftests {
diff --git a/gdb/unittests/scoped_mmap-selftests.c b/gdb/unittests/scoped_mmap-selftests.c
index fa963d1b47f..7e479e2bc06 100644
--- a/gdb/unittests/scoped_mmap-selftests.c
+++ b/gdb/unittests/scoped_mmap-selftests.c
@@ -21,7 +21,6 @@
 
 #include "gdbsupport/filestuff.h"
 #include "gdbsupport/scoped_mmap.h"
-#include "config.h"
 
 #if defined(HAVE_SYS_MMAN_H)
 
diff --git a/gdbsupport/Makefile.am b/gdbsupport/Makefile.am
index 1a001a00817..3180ddebd4d 100644
--- a/gdbsupport/Makefile.am
+++ b/gdbsupport/Makefile.am
@@ -20,7 +20,7 @@
 AUTOMAKE_OPTIONS = no-dist foreign
 ACLOCAL_AMFLAGS = -I . -I ../config
 
-AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir)/../gdb \
+AM_CPPFLAGS = -I$(srcdir)/config.h -I$(srcdir)/../include -I$(srcdir)/../gdb \
     -I../gnulib/import -I$(srcdir)/../gnulib/import \
     -I.. -I$(srcdir)/.. $(INCINTL) -I../bfd -I$(srcdir)/../bfd
 
diff --git a/gdbsupport/Makefile.in b/gdbsupport/Makefile.in
index 5723ae5e97e..f9931e1f102 100644
--- a/gdbsupport/Makefile.in
+++ b/gdbsupport/Makefile.in
@@ -195,7 +195,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
- $(LISP)config.in
+ $(LISP)support-config.in
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
 # *not* preserved.
@@ -346,7 +346,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = no-dist foreign
 ACLOCAL_AMFLAGS = -I . -I ../config
-AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir)/../gdb \
+AM_CPPFLAGS = -I$(srcdir)/config.h -I$(srcdir)/../include -I$(srcdir)/../gdb \
     -I../gnulib/import -I$(srcdir)/../gnulib/import \
     -I.. -I$(srcdir)/.. $(INCINTL) -I../bfd -I$(srcdir)/../bfd
 
@@ -431,10 +431,10 @@ support-config.h: stamp-h1
  @test -f $@ || rm -f stamp-h1
  @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
 
-stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status
+stamp-h1: $(srcdir)/support-config.in $(top_builddir)/config.status
  @rm -f stamp-h1
  cd $(top_builddir) && $(SHELL) ./config.status support-config.h
-$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+$(srcdir)/support-config.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
  ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
  rm -f stamp-h1
  touch $@
diff --git a/gdbsupport/common-defs.h b/gdbsupport/common-defs.h
index d823c41607c..d6fc62be413 100644
--- a/gdbsupport/common-defs.h
+++ b/gdbsupport/common-defs.h
@@ -20,32 +20,8 @@
 #ifndef COMMON_COMMON_DEFS_H
 #define COMMON_COMMON_DEFS_H
 
-#ifdef GDBSERVER
-
-#include <build-gnulib-gdbserver/config.h>
-
-#undef PACKAGE_NAME
-#undef PACKAGE
-#undef PACKAGE_VERSION
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-
 #include <config.h>
 
-#else  /* GDBSERVER */
-
-#include <gdbsupport/support-config.h>
-
-#undef PACKAGE_NAME
-#undef PACKAGE
-#undef PACKAGE_VERSION
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-
-#include "gnulib/config.h"
-
-#endif /* GDBSERVER */
-
 /* From:
     https://www.gnu.org/software/gnulib/manual/html_node/stdint_002eh.html
 
diff --git a/gdbsupport/config.h/config.h b/gdbsupport/config.h/config.h
new file mode 100644
index 00000000000..e0b95221767
--- /dev/null
+++ b/gdbsupport/config.h/config.h
@@ -0,0 +1,32 @@
+/* config.h for gdbsupport.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* This exists so that "#include <config.h>" in header files
+   (including gnulib headers), includes this file, which then includes
+   our real config.h (which is called support-config.h), along with
+   gnulib's config.h.  */
+
+#include "gnulib/config.h"
+
+#undef PACKAGE_NAME
+#undef PACKAGE
+#undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+
+#include <gdbsupport/support-config.h>
diff --git a/gdbsupport/configure b/gdbsupport/configure
index a0df06bbd53..b5eb64b7837 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -2713,7 +2713,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_headers="$ac_config_headers support-config.h:config.in"
+ac_config_headers="$ac_config_headers support-config.h:support-config.in"
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -9687,7 +9687,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5
 $as_echo_n "checking for sigsetjmp... " >&6; }
 if ${gdb_cv_func_sigsetjmp+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -9695,7 +9695,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <setjmp.h>
+  #include <setjmp.h>
 
 int
 main ()
@@ -9714,11 +9714,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_sigsetjmp" >&5
 $as_echo "$gdb_cv_func_sigsetjmp" >&6; }
-if test "$gdb_cv_func_sigsetjmp" = "yes"; then
+  if test "$gdb_cv_func_sigsetjmp" = "yes"; then
 
 $as_echo "#define HAVE_SIGSETJMP 1" >>confdefs.h
 
-fi
+  fi
 
 
 # Check whether --with-intel_pt was given.
@@ -9728,23 +9728,23 @@ else
   with_intel_pt=auto
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use intel pt" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use intel pt" >&5
 $as_echo_n "checking whether to use intel pt... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_intel_pt" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_intel_pt" >&5
 $as_echo "$with_intel_pt" >&6; }
 
-if test "${with_intel_pt}" = no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Intel Processor Trace support disabled; some features may be unavailable." >&5
+  if test "${with_intel_pt}" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Intel Processor Trace support disabled; some features may be unavailable." >&5
 $as_echo "$as_me: WARNING: Intel Processor Trace support disabled; some features may be unavailable." >&2;}
-  HAVE_LIBIPT=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    HAVE_LIBIPT=no
+  else
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <linux/perf_event.h>
-#ifndef PERF_ATTR_SIZE_VER5
-# error
-#endif
+  #include <linux/perf_event.h>
+  #ifndef PERF_ATTR_SIZE_VER5
+  # error
+  #endif
 
 _ACEOF
 if ac_fn_c_try_cpp "$LINENO"; then :
@@ -9753,14 +9753,14 @@ else
   perf_event=no
 fi
 rm -f conftest.err conftest.i conftest.$ac_ext
-  if test "$perf_event" != yes; then
-    if test "$with_intel_pt" = yes; then
-      as_fn_error $? "linux/perf_event.h missing or too old" "$LINENO" 5
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&5
+    if test "$perf_event" != yes; then
+      if test "$with_intel_pt" = yes; then
+ as_fn_error $? "linux/perf_event.h missing or too old" "$LINENO" 5
+      else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&5
 $as_echo "$as_me: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&2;}
+      fi
     fi
-  fi
 
 
 
@@ -10224,17 +10224,17 @@ $as_echo "$LIBIPT" >&6; }
 
 
 
-  if test "$HAVE_LIBIPT" != yes; then
-    if test "$with_intel_pt" = yes; then
-      as_fn_error $? "libipt is missing or unusable" "$LINENO" 5
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libipt is missing or unusable; some features may be unavailable." >&5
+    if test "$HAVE_LIBIPT" != yes; then
+      if test "$with_intel_pt" = yes; then
+ as_fn_error $? "libipt is missing or unusable" "$LINENO" 5
+      else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libipt is missing or unusable; some features may be unavailable." >&5
 $as_echo "$as_me: WARNING: libipt is missing or unusable; some features may be unavailable." >&2;}
-    fi
-  else
-    save_LIBS=$LIBS
-    LIBS="$LIBS $LIBIPT"
-    for ac_func in pt_insn_event
+      fi
+    else
+      save_LIBS=$LIBS
+      LIBS="$LIBS $LIBIPT"
+      for ac_func in pt_insn_event
 do :
   ac_fn_c_check_func "$LINENO" "pt_insn_event" "ac_cv_func_pt_insn_event"
 if test "x$ac_cv_func_pt_insn_event" = xyes; then :
@@ -10245,7 +10245,7 @@ _ACEOF
 fi
 done
 
-    ac_fn_c_check_member "$LINENO" "struct pt_insn" "enabled" "ac_cv_member_struct_pt_insn_enabled" "#include <intel-pt.h>
+      ac_fn_c_check_member "$LINENO" "struct pt_insn" "enabled" "ac_cv_member_struct_pt_insn_enabled" "#include <intel-pt.h>
 "
 if test "x$ac_cv_member_struct_pt_insn_enabled" = xyes; then :
 
@@ -10266,12 +10266,12 @@ _ACEOF
 
 fi
 
-    LIBS=$save_LIBS
+      LIBS=$save_LIBS
+    fi
   fi
-fi
 
-if test "$ac_cv_header_sys_procfs_h" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gregset_t in sys/procfs.h" >&5
+  if test "$ac_cv_header_sys_procfs_h" = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for gregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_gregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10308,7 +10308,7 @@ $as_echo "#define HAVE_GREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_gregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_gregset_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpregset_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for fpregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_fpregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10345,7 +10345,7 @@ $as_echo "#define HAVE_FPREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_fpregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_fpregset_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for prgregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_prgregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10382,7 +10382,7 @@ $as_echo "#define HAVE_PRGREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_prgregset_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prfpregset_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prfpregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for prfpregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_prfpregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10419,7 +10419,7 @@ $as_echo "#define HAVE_PRFPREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prfpregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_prfpregset_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset32_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset32_t in sys/procfs.h" >&5
 $as_echo_n "checking for prgregset32_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_prgregset32_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10456,7 +10456,7 @@ $as_echo "#define HAVE_PRGREGSET32_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset32_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_prgregset32_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpid_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpid_t in sys/procfs.h" >&5
 $as_echo_n "checking for lwpid_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_lwpid_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10493,7 +10493,7 @@ $as_echo "#define HAVE_LWPID_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_lwpid_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_lwpid_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psaddr_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psaddr_t in sys/procfs.h" >&5
 $as_echo_n "checking for psaddr_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_psaddr_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10530,7 +10530,7 @@ $as_echo "#define HAVE_PSADDR_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_psaddr_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_psaddr_t" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_fpregset_t in sys/procfs.h" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_fpregset_t in sys/procfs.h" >&5
 $as_echo_n "checking for elf_fpregset_t in sys/procfs.h... " >&6; }
  if ${bfd_cv_have_sys_procfs_type_elf_fpregset_t+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10567,7 +10567,7 @@ $as_echo "#define HAVE_ELF_FPREGSET_T 1" >>confdefs.h
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&5
 $as_echo "$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6; }
 
-fi
+  fi
 
 
 # Check whether we will enable the inclusion of unit tests when
@@ -11563,7 +11563,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
-    "support-config.h") CONFIG_HEADERS="$CONFIG_HEADERS support-config.h:config.in" ;;
+    "support-config.h") CONFIG_HEADERS="$CONFIG_HEADERS support-config.h:support-config.in" ;;
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
 
diff --git a/gdbsupport/configure.ac b/gdbsupport/configure.ac
index af14d7bb92d..ffa0f836027 100644
--- a/gdbsupport/configure.ac
+++ b/gdbsupport/configure.ac
@@ -18,7 +18,7 @@ dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT([gdbsupport], 1.0)
 AC_CONFIG_SRCDIR(common-defs.h)
-AC_CONFIG_HEADER(support-config.h:config.in)
+AC_CONFIG_HEADER(support-config.h:support-config.in)
 AC_CANONICAL_SYSTEM
 AM_MAINTAINER_MODE
 AC_CONFIG_AUX_DIR(..)
diff --git a/gdbsupport/config.in b/gdbsupport/support-config.in
similarity index 100%
rename from gdbsupport/config.in
rename to gdbsupport/support-config.in

base-commit: aad09917e04b33da463f1703aab8d057cfe3f54e
--
2.14.5

12