public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files
@ 2020-10-26  2:14 Simon Marchi
  2020-10-26  2:14 ` [PATCH 01/13] gdb, gdbserver, gdbsupport: use AC_CANONICAL_{BUILD, HOST, TARGET} instead of AC_CANONICAL_SYSTEM Simon Marchi
                   ` (11 more replies)
  0 siblings, 12 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:14 UTC (permalink / raw)
  To: gdb-patches

I'd like to give a shot at autoconf 2.69c (the preview version of the
upcoming 2.70 version) to make sure that if we hit some problems, we can
report them before the final release is out.

Before doing so, I'd like to make `autoreconf -vf -Wall` clean, to make
sure we use what's recommended today.  This first patch series changes
things in gdb, gdbserver and gdbsupport to remove some warnings.  The
remaining warnings need changes outside these directories, and will need
to be sent to binutils and maybe gcc, so I'll do them later.

Simon Marchi (13):
  gdb, gdbserver, gdbsupport: use AC_CANONICAL_{BUILD,HOST,TARGET}
    instead of AC_CANONICAL_SYSTEM
  gdb: use AC_PROG_CC_STDC instead of AM_PROG_CC_STDC
  gdbserver: modernize configure.ac
  gdb: modernize configure.ac
  gdb/testsuite: modernize configure.ac
  gdb: modernize acinclude.m4
  gdbsupport: re-indent ptrace.m4
  gdbsupport: replace AC_TRY_COMPILE in ptrace.m4
  gdbsupport: replace AC_TRY_COMPILE in warning.m4
  gdbsupport: use AC_FUNC_FORK instead of AC_FUNC_VFORK
  gdbsupport: replace AC_TRY_COMPILE in common.m4
  gdb: replace AC_TRY_LINK in sanitize.m4
  gdbserver: replace AC_TRY_COMPILE in acinclude.m4

 gdb/acinclude.m4           | 156 ++----
 gdb/configure              | 302 ++++++------
 gdb/configure.ac           | 378 +++++++++------
 gdb/sanitize.m4            |   6 +-
 gdb/testsuite/configure    |   1 +
 gdb/testsuite/configure.ac |   3 +-
 gdbserver/acinclude.m4     |  32 +-
 gdbserver/configure        | 135 +++---
 gdbserver/configure.ac     | 108 +++--
 gdbsupport/aclocal.m4      |  29 --
 gdbsupport/common.m4       |  21 +-
 gdbsupport/configure       | 943 +++++--------------------------------
 gdbsupport/configure.ac    |  12 +-
 gdbsupport/ptrace.m4       | 105 +++--
 gdbsupport/warning.m4      |  24 +-
 15 files changed, 818 insertions(+), 1437 deletions(-)

-- 
2.29.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 01/13] gdb, gdbserver, gdbsupport: use AC_CANONICAL_{BUILD, HOST, TARGET} instead of AC_CANONICAL_SYSTEM
  2020-10-26  2:14 [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
@ 2020-10-26  2:14 ` Simon Marchi
  2020-10-26  2:14 ` [PATCH 02/13] gdb: use AC_PROG_CC_STDC instead of AM_PROG_CC_STDC Simon Marchi
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:14 UTC (permalink / raw)
  To: gdb-patches

`autoreconf -Wall` notes that AC_CANONICAL_SYSTEM is obsolete:

    configure.ac:36: warning: The macro `AC_CANONICAL_SYSTEM' is obsolete.

Replace it by AC_CANONICAL_BUILD, AC_CANONICAL_HOST and
AC_CANONICAL_TARGET in configure.ac files in gdb, gdbserver and
gdbsupport.  All three macros may not be needed everywhere, but it is
hard to completely audit the configure files to see which are required,
so I think it's better (and that there's no downside) to just call all
three.

gdb/ChangeLog:

	* configure.ac: Use AC_CANONICAL_{BUILD,HOST,TARGET} instead of
	AC_CANONICAL_SYSTEM.
	* configure: Re-generate.

gdbserver/ChangeLog:

	* configure.ac: Use AC_CANONICAL_{BUILD,HOST,TARGET} instead of
	AC_CANONICAL_SYSTEM.
	* configure: Re-generate.

gdbsupport/ChangeLog:

	* configure.ac: Use AC_CANONICAL_{BUILD,HOST,TARGET} instead of
	AC_CANONICAL_SYSTEM.
	* configure: Re-generate.

Change-Id: Ifd0e21f1e478634e768b5de1b8ee06a7f690d863
---
 gdb/configure           |  9 +++++++++
 gdb/configure.ac        | 11 ++++++++++-
 gdbserver/configure     |  6 +++++-
 gdbserver/configure.ac  |  9 ++++++++-
 gdbsupport/configure    |  6 ++++++
 gdbsupport/configure.ac | 11 ++++++++++-
 6 files changed, 48 insertions(+), 4 deletions(-)

diff --git a/gdb/configure b/gdb/configure
index a8942ecbd5d6..d943424ca5bb 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -5249,6 +5249,15 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
 
+# Set build, build_cpu, build_vendor and build_os.
+
+
+# Set host, host_cpu, host_vendor, and host_os.
+
+
+# Set target, target_cpu, target_vendor, and target_os.
+
+
 test "$program_prefix" != NONE &&
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 6b4b0fa85109..1d34d08ee431 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -33,7 +33,16 @@ AM_PROG_CC_STDC
 AM_PROG_INSTALL_STRIP
 
 AC_CONFIG_AUX_DIR(..)
-AC_CANONICAL_SYSTEM
+
+# Set build, build_cpu, build_vendor and build_os.
+AC_CANONICAL_BUILD
+
+# Set host, host_cpu, host_vendor, and host_os.
+AC_CANONICAL_HOST
+
+# Set target, target_cpu, target_vendor, and target_os.
+AC_CANONICAL_TARGET
+
 AC_ARG_PROGRAM
 
 # We require a C++11 compiler.  Check if one is available, and if
diff --git a/gdbserver/configure b/gdbserver/configure
index 95086d0f0a51..4b7ef288d065 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -4588,6 +4588,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 
 
+# Set build, build_cpu, build_vendor and build_os.
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
   as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
@@ -4626,6 +4627,8 @@ IFS=$ac_save_IFS
 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
+
+# Set host, host_cpu, host_vendor, and host_os.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
 if ${ac_cv_host+:} false; then :
@@ -4659,6 +4662,8 @@ IFS=$ac_save_IFS
 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
+
+# Set target, target_cpu, target_vendor, and target_os.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
 $as_echo_n "checking target system type... " >&6; }
 if ${ac_cv_target+:} false; then :
@@ -4699,7 +4704,6 @@ test -n "$target_alias" &&
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
-
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
 # incompatible versions:
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
index 4c7e392bbced..c4748703dcda 100644
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -29,7 +29,14 @@ AC_GNU_SOURCE
 AC_SYS_LARGEFILE
 AM_PROG_INSTALL_STRIP
 
-AC_CANONICAL_SYSTEM
+# Set build, build_cpu, build_vendor and build_os.
+AC_CANONICAL_BUILD
+
+# Set host, host_cpu, host_vendor, and host_os.
+AC_CANONICAL_HOST
+
+# Set target, target_cpu, target_vendor, and target_os.
+AC_CANONICAL_TARGET
 
 AC_PROG_INSTALL
 AC_CHECK_TOOL(AR, ar)
diff --git a/gdbsupport/configure b/gdbsupport/configure
index a37f3c232ce5..cce6f51701b4 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -2728,6 +2728,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 ac_config_headers="$ac_config_headers config.h:config.in"
 
+
+# Set build, build_cpu, build_vendor and build_os.
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
   if test -f "$ac_dir/install-sh"; then
@@ -2795,6 +2797,8 @@ IFS=$ac_save_IFS
 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
+
+# Set host, host_cpu, host_vendor, and host_os.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
 if ${ac_cv_host+:} false; then :
@@ -2828,6 +2832,8 @@ IFS=$ac_save_IFS
 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
+
+# Set target, target_cpu, target_vendor, and target_os.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
 $as_echo_n "checking target system type... " >&6; }
 if ${ac_cv_target+:} false; then :
diff --git a/gdbsupport/configure.ac b/gdbsupport/configure.ac
index 401e16f821da..a62a130fe996 100644
--- a/gdbsupport/configure.ac
+++ b/gdbsupport/configure.ac
@@ -19,7 +19,16 @@ 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(config.h:config.in)
-AC_CANONICAL_SYSTEM
+
+# Set build, build_cpu, build_vendor and build_os.
+AC_CANONICAL_BUILD
+
+# Set host, host_cpu, host_vendor, and host_os.
+AC_CANONICAL_HOST
+
+# Set target, target_cpu, target_vendor, and target_os.
+AC_CANONICAL_TARGET
+
 AM_MAINTAINER_MODE
 AC_CONFIG_AUX_DIR(..)
 AM_INIT_AUTOMAKE
-- 
2.29.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 02/13] gdb: use AC_PROG_CC_STDC instead of AM_PROG_CC_STDC
  2020-10-26  2:14 [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
  2020-10-26  2:14 ` [PATCH 01/13] gdb, gdbserver, gdbsupport: use AC_CANONICAL_{BUILD, HOST, TARGET} instead of AC_CANONICAL_SYSTEM Simon Marchi
@ 2020-10-26  2:14 ` Simon Marchi
  2020-10-26  2:14 ` [PATCH 03/13] gdbserver: modernize configure.ac Simon Marchi
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:14 UTC (permalink / raw)
  To: gdb-patches

`autoconf -Wall` notes that AM_PROG_CC_STDC is obsolete:
Fixes this autoconf warning:

    configure.ac:40: warning: 'AM_PROG_CC_STDC': this macro is obsolete.
    configure.ac:40: You should simply use the 'AC_PROG_CC' macro instead.
    configure.ac:40: Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
    configure.ac:40: but upon 'ac_cv_prog_cc_stdc'.
    aclocal.m4:770: AM_PROG_CC_STDC is expanded from...
    configure.ac:40: the top level

Since we build with a C++ compiler now, I don't think this is relevant.
If you look at the messages removed from gdbsupport/aclocal.m4, it says
that this functionality is now integrated in AC_PROG_CC, which we
already call.  So it might not even make a difference.

We had a local version of AM_PROG_CC_STDC, in gdb/acinclude.m4 (only
used by gdb/configure.ac), remove it.

gdb/ChangeLog:

	* acinclude.m4 (AM_PROG_CC_STDC): Remove.
	* configure: Re-generate.
	* configure.ac: Remove AM_PROG_CC_STDC.

gdbsupport/ChangeLog:

	* aclocal.m4: Re-generate.
	* configure: Re-generate.
	* configure.ac: Remove AM_PROG_CC_STDC.

Change-Id: Ic824393598805d4f78cda9d119f8af46096e9c73
---
 gdb/acinclude.m4        | 108 ------
 gdb/configure           |  82 -----
 gdb/configure.ac        |   1 -
 gdbsupport/aclocal.m4   |  29 --
 gdbsupport/configure    | 733 +---------------------------------------
 gdbsupport/configure.ac |   1 -
 6 files changed, 1 insertion(+), 953 deletions(-)

diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index 9aa32e6d1470..a557d6bc8666 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -78,114 +78,6 @@ m4_include(ax_cxx_compile_stdcxx.m4)
 
 m4_include([../config/ax_pthread.m4])
 
-## ----------------------------------------- ##
-## ANSIfy the C compiler whenever possible.  ##
-## From Franc,ois Pinard                     ##
-## ----------------------------------------- ##
-
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
-
-# 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 2, 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/>.
-
-# serial 1
-
-# @defmac AC_PROG_CC_STDC
-# @maindex PROG_CC_STDC
-# @ovindex CC
-# If the C compiler in not in ANSI C mode by default, try to add an option
-# to output variable @code{CC} to make it so.  This macro tries various
-# options that select ANSI C on some system or another.  It considers the
-# compiler to be in ANSI C mode if it handles function prototypes correctly.
-#
-# If you use this macro, you should check after calling it whether the C
-# compiler has been set to accept ANSI C; if not, the shell variable
-# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
-# code in ANSI C, you can make an un-ANSIfied copy of it by using the
-# program @code{ansi2knr}, which comes with Ghostscript.
-# @end defmac
-
-AC_DEFUN([AM_PROG_CC_STDC],
-[AC_REQUIRE([AC_PROG_CC])
-AC_BEFORE([$0], [AC_C_INLINE])
-AC_BEFORE([$0], [AC_C_CONST])
-dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
-dnl a magic option to avoid problems with ANSI preprocessor commands
-dnl like #elif.
-dnl FIXME: can't do this because then AC_AIX won't work due to a
-dnl circular dependency.
-dnl AC_BEFORE([$0], [AC_PROG_CPP])
-AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
-AC_CACHE_VAL(am_cv_prog_cc_stdc,
-[am_cv_prog_cc_stdc=no
-ac_save_CC="$CC"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX 10.20 and later	-Ae
-# HP-UX older versions	-Aa -D_HPUX_SOURCE
-# SVR4			-Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  AC_TRY_COMPILE(
-[#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-], [
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-],
-[am_cv_prog_cc_stdc="$ac_arg"; break])
-done
-CC="$ac_save_CC"
-])
-if test -z "$am_cv_prog_cc_stdc"; then
-  AC_MSG_RESULT([none needed])
-else
-  AC_MSG_RESULT([$am_cv_prog_cc_stdc])
-fi
-case "x$am_cv_prog_cc_stdc" in
-  x|xno) ;;
-  *) CC="$CC $am_cv_prog_cc_stdc" ;;
-esac
-])
-
 dnl written by Guido Draheim <guidod@gmx.de>, original by Alexandre Oliva 
 dnl Version 1.3 (2001/03/02)
 dnl source http://www.gnu.org/software/ac-archive/Miscellaneous/ac_define_dir.html
diff --git a/gdb/configure b/gdb/configure
index d943424ca5bb..990fe3eb07d5 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -5024,88 +5024,6 @@ rm -rf conftest*
 fi
 
 
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${CC-cc} option to accept ANSI C" >&5
-$as_echo_n "checking for ${CC-cc} option to accept ANSI C... " >&6; }
-if ${am_cv_prog_cc_stdc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  am_cv_prog_cc_stdc=no
-ac_save_CC="$CC"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX 10.20 and later	-Ae
-# HP-UX older versions	-Aa -D_HPUX_SOURCE
-# SVR4			-Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-
-int
-main ()
-{
-
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  am_cv_prog_cc_stdc="$ac_arg"; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-CC="$ac_save_CC"
-
-fi
-
-if test -z "$am_cv_prog_cc_stdc"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_stdc" >&5
-$as_echo "$am_cv_prog_cc_stdc" >&6; }
-fi
-case "x$am_cv_prog_cc_stdc" in
-  x|xno) ;;
-  *) CC="$CC $am_cv_prog_cc_stdc" ;;
-esac
-
 # Expand $ac_aux_dir to an absolute path.
 am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 1d34d08ee431..c1073f867990 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -29,7 +29,6 @@ AC_PROG_CXX
 
 AC_USE_SYSTEM_EXTENSIONS
 ACX_LARGEFILE
-AM_PROG_CC_STDC
 AM_PROG_INSTALL_STRIP
 
 AC_CONFIG_AUX_DIR(..)
diff --git a/gdbsupport/aclocal.m4 b/gdbsupport/aclocal.m4
index 57bf21a3d331..cb0059799298 100644
--- a/gdbsupport/aclocal.m4
+++ b/gdbsupport/aclocal.m4
@@ -751,35 +751,6 @@ else
 fi
 ])
 
-#  -*- Autoconf -*-
-# Obsolete and "removed" macros, that must however still report explicit
-# error messages when used, to smooth transition.
-#
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([AM_CONFIG_HEADER],
-[AC_DIAGNOSE([obsolete],
-['$0': this macro is obsolete.
-You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl
-AC_CONFIG_HEADERS($@)])
-
-AC_DEFUN([AM_PROG_CC_STDC],
-[AC_PROG_CC
-am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
-AC_DIAGNOSE([obsolete],
-['$0': this macro is obsolete.
-You should simply use the 'AC][_PROG_CC' macro instead.
-Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
-but upon 'ac_cv_prog_cc_stdc'.])])
-
-AC_DEFUN([AM_C_PROTOTYPES],
-         [AC_FATAL([automatic de-ANSI-fication support has been removed])])
-AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
-
 # Helper functions for option handling.                     -*- Autoconf -*-
 
 # Copyright (C) 2001-2017 Free Software Foundation, Inc.
diff --git a/gdbsupport/configure b/gdbsupport/configure
index cce6f51701b4..24e6e3e71958 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -5888,734 +5888,6 @@ rm -rf conftest*
 fi
 
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
-          if test -n "$ac_tool_prefix"; then
-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  fi
-fi
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC="cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
-  fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl.exe
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$CC" && break
-  done
-fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl.exe
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_CC" && break
-done
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_compiler_gnu=yes
-else
-  ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GCC=yes
-else
-  GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_c_werror_flag=$ac_c_werror_flag
-   ac_c_werror_flag=yes
-   ac_cv_prog_cc_g=no
-   CFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-else
-  CFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  ac_c_werror_flag=$ac_save_c_werror_flag
-	 CFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
-if ${am_cv_prog_cc_c_o+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-  # Make sure it works both with $CC and with simple cc.
-  # Following AC_PROG_CC_C_O, we do the test twice because some
-  # compilers refuse to overwrite an existing .o file with -o,
-  # though they will create one.
-  am_cv_prog_cc_c_o=yes
-  for am_i in 1 2; do
-    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
-   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } \
-         && test -f conftest2.$ac_objext; then
-      : OK
-    else
-      am_cv_prog_cc_c_o=no
-      break
-    fi
-  done
-  rm -f core conftest*
-  unset am_i
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
-$as_echo "$am_cv_prog_cc_c_o" >&6; }
-if test "$am_cv_prog_cc_c_o" != yes; then
-   # Losing compiler, so override with the script.
-   # FIXME: It is wrong to rewrite CC.
-   # But if we don't then we get into trouble of one sort or another.
-   # A longer-term fix would be to have automake use am__CC in this case,
-   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
-   CC="$am_aux_dir/compile $CC"
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-depcc="$CC"   am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named 'D' -- because '-MD' means "put the output
-  # in D".
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CC_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  am__universal=false
-  case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac
-
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
-      # Solaris 10 /bin/sh.
-      echo '/* dummy */' > sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    # We check with '-c' and '-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle '-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs.
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # After this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested.
-      if test "x$enable_dependency_tracking" = xyes; then
-	continue
-      else
-	break
-      fi
-      ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok '-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CC_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
-  am__fastdepCC_TRUE=
-  am__fastdepCC_FALSE='#'
-else
-  am__fastdepCC_TRUE='#'
-  am__fastdepCC_FALSE=
-fi
-
-
-am_cv_prog_cc_stdc=$ac_cv_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.
@@ -11189,6 +10461,7 @@ DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
+U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
@@ -11235,10 +10508,6 @@ if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
   as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${SELFTEST_TRUE}" && test -z "${SELFTEST_FALSE}"; then
   as_fn_error $? "conditional \"SELFTEST\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/gdbsupport/configure.ac b/gdbsupport/configure.ac
index a62a130fe996..37e5c0c4e967 100644
--- a/gdbsupport/configure.ac
+++ b/gdbsupport/configure.ac
@@ -40,7 +40,6 @@ 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.
-- 
2.29.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 03/13] gdbserver: modernize configure.ac
  2020-10-26  2:14 [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
  2020-10-26  2:14 ` [PATCH 01/13] gdb, gdbserver, gdbsupport: use AC_CANONICAL_{BUILD, HOST, TARGET} instead of AC_CANONICAL_SYSTEM Simon Marchi
  2020-10-26  2:14 ` [PATCH 02/13] gdb: use AC_PROG_CC_STDC instead of AM_PROG_CC_STDC Simon Marchi
@ 2020-10-26  2:14 ` Simon Marchi
  2020-10-26  2:14 ` [PATCH 04/13] gdb: " Simon Marchi
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:14 UTC (permalink / raw)
  To: gdb-patches

Run autoupdate on gdbserver/configure.ac and then tweak it to use easier
to read indentation.  This removes a few warnings when running
`autoreconf -vf -Wall`.

  * Replace AC_INIT with AC_INIT and no arguments plus AC_CONFIG_SRCDIR.
  * Replace AC_GNU_SOURCE with AC_USE_SYSTEM_EXTENSIONS.
  * Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.
  * Replace AC_TRY_LINK with AC_LINK_IFELSE.

autoupdate gets it right, except this one here:

    --- a/gdbserver/configure.ac
    +++ b/gdbserver/configure.ac
    @@ -304,7 +304,7 @@ if test "$srv_linux_thread_db" = "yes"; then
         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[found="-Wl,--dynamic-list"
                     RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'],[RDYNAMIC="-rdynamic"
                     LDFLAGS="$old_LDFLAGS $RDYNAMIC"
    -                AC_TRY_LINK([], [],
    +                _au_m4_changequote([,])AC_TRY_LINK([], [],
                                 [found="-rdynamic"],
                                 [found="no"
                                  RDYNAMIC=""])])

... which I had to convert manually.

The changes in the generated configure file only contain insignificant
whitespace changes, so that gives confidence that the conversion is
correct.

gdbserver/ChangeLog:

	* configure.ac: Modernize.
	* configure: Re-generate.

Change-Id: Ia769aaec2aafac595504f477da955e91dffa4d8f
---
 gdbserver/configure    | 33 ++++++++++----
 gdbserver/configure.ac | 99 +++++++++++++++++++++++++++---------------
 2 files changed, 89 insertions(+), 43 deletions(-)

diff --git a/gdbserver/configure b/gdbserver/configure
index 4b7ef288d065..c91ce71c943e 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -2713,6 +2713,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+
 ac_config_headers="$ac_config_headers config.h:config.in"
 
 
@@ -4245,7 +4246,6 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
   $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
 
 
-
 # Check whether --enable-largefile was given.
 if test "${enable_largefile+set}" = set; then :
   enableval=$enable_largefile;
@@ -9653,6 +9653,7 @@ int
 main ()
 {
 
+
   ;
   return 0;
 }
@@ -9660,11 +9661,14 @@ _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; };
+
 $as_echo "#define HAVE_UST 1" >>confdefs.h
 
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }; ustlibs= ; ustinc=
+$as_echo "no" >&6; }
+     ustlibs= ; ustinc=
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   CFLAGS="$saved_CFLAGS"
@@ -10314,8 +10318,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdbsrv_cv_have_ptrace_getregs=yes
 else
   gdbsrv_cv_have_ptrace_getregs=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdbsrv_cv_have_ptrace_getregs" >&5
@@ -10346,8 +10352,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdbsrv_cv_have_ptrace_getfpxregs=yes
 else
   gdbsrv_cv_have_ptrace_getfpxregs=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdbsrv_cv_have_ptrace_getfpxregs" >&5
@@ -10513,11 +10521,11 @@ main ()
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   found="-Wl,--dynamic-list"
-		 RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'
+       RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'
 else
   RDYNAMIC="-rdynamic"
-		 LDFLAGS="$old_LDFLAGS $RDYNAMIC"
-		 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+       LDFLAGS="$old_LDFLAGS $RDYNAMIC"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -10532,10 +10540,12 @@ if ac_fn_c_try_link "$LINENO"; then :
   found="-rdynamic"
 else
   found="no"
-			      RDYNAMIC=""
+	  RDYNAMIC=""
+
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
@@ -10571,8 +10581,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdbsrv_cv_have_td_version=yes
 else
   gdbsrv_cv_have_td_version=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdbsrv_cv_have_td_version" >&5
 $as_echo "$gdbsrv_cv_have_td_version" >&6; }
@@ -10619,14 +10631,15 @@ $as_echo_n "checking whether the target supports __sync_*_compare_and_swap... "
 if ${gdbsrv_cv_have_sync_builtins+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
 main ()
 {
-int foo, bar; bar = __sync_val_compare_and_swap(&foo, 0, 1);
+int foo, bar;
+	 bar = __sync_val_compare_and_swap(&foo, 0, 1);
+
   ;
   return 0;
 }
@@ -10635,9 +10648,11 @@ if ac_fn_c_try_link "$LINENO"; then :
   gdbsrv_cv_have_sync_builtins=yes
 else
   gdbsrv_cv_have_sync_builtins=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdbsrv_cv_have_sync_builtins" >&5
 $as_echo "$gdbsrv_cv_have_sync_builtins" >&6; }
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
index c4748703dcda..dd646cffa1a3 100644
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -18,14 +18,15 @@ 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.cc)
+AC_INIT
+AC_CONFIG_SRCDIR([server.cc])
 AC_CONFIG_HEADERS(config.h:config.in, [echo > stamp-h])
 
 AM_MAINTAINER_MODE
 
 AC_PROG_CC
 AC_PROG_CXX
-AC_GNU_SOURCE
+AC_USE_SYSTEM_EXTENSIONS
 AC_SYS_LARGEFILE
 AM_PROG_INSTALL_STRIP
 
@@ -124,12 +125,19 @@ if test "x$with_ust" != "xno"; then
   saved_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS $ustinc"
   AC_MSG_CHECKING([for ust])
-  AC_TRY_COMPILE([
+  AC_COMPILE_IFELSE(
+    [AC_LANG_PROGRAM(
+       [
 #define CONFIG_UST_GDB_INTEGRATION
 #include <ust/ust.h>
-  ],[],
-  [AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_UST, 1, [Define if UST is available])],
-  [AC_MSG_RESULT([no]); ustlibs= ; ustinc= ])
+       ],
+       []
+     )],
+    [AC_MSG_RESULT([yes]);
+     AC_DEFINE(HAVE_UST, 1, [Define if UST is available])],
+    [AC_MSG_RESULT([no])
+     ustlibs= ; ustinc= ]
+  )
   CFLAGS="$saved_CFLAGS"
 fi
 
@@ -249,11 +257,14 @@ if test "${srv_linux_regsets}" = "yes"; then
 	    [Define if the target supports register sets.])
 
   AC_MSG_CHECKING(for PTRACE_GETREGS)
-  AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getregs,
-  [AC_TRY_COMPILE([#include <sys/ptrace.h>],
-		  [PTRACE_GETREGS;],
-		  [gdbsrv_cv_have_ptrace_getregs=yes],
-		  [gdbsrv_cv_have_ptrace_getregs=no])])
+  AC_CACHE_VAL(
+    [gdbsrv_cv_have_ptrace_getregs],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([#include <sys/ptrace.h>], [PTRACE_GETREGS;])],
+       [gdbsrv_cv_have_ptrace_getregs=yes],
+       [gdbsrv_cv_have_ptrace_getregs=no]
+     )]
+  )
   AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getregs)
   if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then
     AC_DEFINE(HAVE_PTRACE_GETREGS, 1,
@@ -262,11 +273,14 @@ if test "${srv_linux_regsets}" = "yes"; then
   fi
 
   AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
-  AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getfpxregs,
-  [AC_TRY_COMPILE([#include <sys/ptrace.h>],
-		  [PTRACE_GETFPXREGS;],
-		  [gdbsrv_cv_have_ptrace_getfpxregs=yes],
-		  [gdbsrv_cv_have_ptrace_getfpxregs=no])])
+  AC_CACHE_VAL(
+    [gdbsrv_cv_have_ptrace_getfpxregs],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([#include <sys/ptrace.h>], [PTRACE_GETFPXREGS;])],
+       [gdbsrv_cv_have_ptrace_getfpxregs=yes],
+       [gdbsrv_cv_have_ptrace_getfpxregs=no]
+     )]
+  )
   AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs)
   if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then
     AC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1,
@@ -308,15 +322,19 @@ if test "$srv_linux_thread_db" = "yes"; then
     # supported there.
     RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list"
     LDFLAGS="$LDFLAGS $RDYNAMIC"
-    AC_TRY_LINK([], [],
-		[found="-Wl,--dynamic-list"
-		 RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'],
-		[RDYNAMIC="-rdynamic"
-		 LDFLAGS="$old_LDFLAGS $RDYNAMIC"
-		 AC_TRY_LINK([], [],
-			     [found="-rdynamic"],
-			     [found="no"
-			      RDYNAMIC=""])])
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM([],[])],
+      [found="-Wl,--dynamic-list"
+       RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'],
+      [RDYNAMIC="-rdynamic"
+       LDFLAGS="$old_LDFLAGS $RDYNAMIC"
+       AC_LINK_IFELSE(
+	 [AC_LANG_PROGRAM([], [])],
+	 [found="-rdynamic"],
+	 [found="no"
+	  RDYNAMIC=""]
+       )]
+    )
     AC_SUBST(RDYNAMIC)
     LDFLAGS="$old_LDFLAGS"
     AC_MSG_RESULT($found)
@@ -326,10 +344,15 @@ if test "$srv_linux_thread_db" = "yes"; then
 
   srv_thread_depfiles="thread-db.o proc-service.o"
   AC_DEFINE(USE_THREAD_DB, 1, [Define if we should use libthread_db.])
-  AC_CACHE_CHECK([for TD_VERSION], gdbsrv_cv_have_td_version,
-  [AC_TRY_COMPILE([#include <thread_db.h>], [TD_VERSION;],
-		  [gdbsrv_cv_have_td_version=yes],
-		  [gdbsrv_cv_have_td_version=no])])
+  AC_CACHE_CHECK(
+    [for TD_VERSION],
+    [gdbsrv_cv_have_td_version],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([#include <thread_db.h>], [TD_VERSION;])],
+       [gdbsrv_cv_have_td_version=yes],
+       [gdbsrv_cv_have_td_version=no]
+     )]
+  )
   if test "$gdbsrv_cv_have_td_version" = yes; then
     AC_DEFINE(HAVE_TD_VERSION, 1, [Define if TD_VERSION is available.])
   fi
@@ -360,11 +383,19 @@ GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_dep
 GDBSERVER_LIBS="$srv_libs"
 
 dnl Check whether the target supports __sync_*_compare_and_swap.
-AC_CACHE_CHECK([whether the target supports __sync_*_compare_and_swap],
-		gdbsrv_cv_have_sync_builtins, [
-AC_TRY_LINK([], [int foo, bar; bar = __sync_val_compare_and_swap(&foo, 0, 1);],
-		gdbsrv_cv_have_sync_builtins=yes,
-		gdbsrv_cv_have_sync_builtins=no)])
+AC_CACHE_CHECK(
+  [whether the target supports __sync_*_compare_and_swap],
+  [gdbsrv_cv_have_sync_builtins],
+  [AC_LINK_IFELSE(
+     [AC_LANG_PROGRAM(
+	[],
+	[int foo, bar;
+	 bar = __sync_val_compare_and_swap(&foo, 0, 1);]
+      )],
+     [gdbsrv_cv_have_sync_builtins=yes],
+     [gdbsrv_cv_have_sync_builtins=no]
+   )]
+)
 if test "$gdbsrv_cv_have_sync_builtins" = yes; then
   AC_DEFINE(HAVE_SYNC_BUILTINS, 1,
     [Define to 1 if the target supports __sync_*_compare_and_swap])
-- 
2.29.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 04/13] gdb: modernize configure.ac
  2020-10-26  2:14 [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
                   ` (2 preceding siblings ...)
  2020-10-26  2:14 ` [PATCH 03/13] gdbserver: modernize configure.ac Simon Marchi
@ 2020-10-26  2:14 ` Simon Marchi
  2020-10-26  2:14 ` [PATCH 05/13] gdb/testsuite: " Simon Marchi
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:14 UTC (permalink / raw)
  To: gdb-patches

Run autoupdate on configure.ac and adjust the indentation of the result
for better readability.  This removes a bunch of warnings when running
`autoreconf -vf -Wall`.  The changes are:

    * Replace AC_INIT with AC_INIT and no arguments plus
      AC_CONFIG_SRCDIR.
    * Replace AC_ERROR with AC_MSG_ERROR.
    * Replace AC_TRY_LINK with AC_LINK_IFELSE.
    * Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.
    * Replace AC_HELP_STRING with AS_HELP_STRING.

autoupdate erroneously tries to replace AC_C_LONG_DOUBLE in a comment,
which I reverted manually.

All the changes in the generated configure file are insignificant
whitespaces changes.

gdb/ChangeLog:

	* configure.ac: Modernize.
	* configure: Re-generate.

Change-Id: Ie3a1409c8032a36a6383da964286a46ece9b546e
---
 gdb/configure    | 118 +++++++++------
 gdb/configure.ac | 366 ++++++++++++++++++++++++++++++-----------------
 2 files changed, 311 insertions(+), 173 deletions(-)

diff --git a/gdb/configure b/gdb/configure
index 990fe3eb07d5..5678deac68cc 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -2986,6 +2986,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+
 ac_config_headers="$ac_config_headers config.h:config.in"
 
 
@@ -7190,12 +7191,12 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
-extern char _etext;
-
+	 extern char _etext;
 int
 main ()
 {
 free (&_etext);
+
   ;
   return 0;
 }
@@ -7204,9 +7205,11 @@ if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_var__etext=yes
 else
   ac_cv_var__etext=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var__etext" >&5
 $as_echo "$ac_cv_var__etext" >&6; }
@@ -7223,12 +7226,12 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
-extern char etext;
-
+	 extern char etext;
 int
 main ()
 {
 free (&etext);
+
   ;
   return 0;
 }
@@ -7237,9 +7240,11 @@ if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_var_etext=yes
 else
   ac_cv_var_etext=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_etext" >&5
 $as_echo "$ac_cv_var_etext" >&6; }
@@ -7276,8 +7281,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_cc_supports_pg=yes
 else
   ac_cv_cc_supports_pg=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cc_supports_pg" >&5
 $as_echo "$ac_cv_cc_supports_pg" >&6; }
@@ -9182,7 +9189,7 @@ fi
 
 
 if test "$with_system_readline" = yes; then
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system readline is new enough" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system readline is new enough" >&5
 $as_echo_n "checking whether system readline is new enough... " >&6; }
 if ${gdb_cv_readline_ok+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -9190,13 +9197,14 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdio.h>
-#include <readline/readline.h>
+	   #include <readline/readline.h>
 int
 main ()
 {
 #if RL_VERSION_MAJOR < 7
-# error "readline version 7 required"
-#endif
+	   # error "readline version 7 required"
+	   #endif
+
   ;
   return 0;
 }
@@ -9205,8 +9213,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_readline_ok=yes
 else
   gdb_cv_readline_ok=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_readline_ok" >&5
 $as_echo "$gdb_cv_readline_ok" >&6; }
@@ -10642,7 +10652,7 @@ fi
 
 
       if test "${python_prog_path}" = missing; then
-        as_fn_error $? "unable to find python program ${python_prog}" "$LINENO" 5
+	as_fn_error $? "unable to find python program ${python_prog}" "$LINENO" 5
       fi
       ;;
     esac
@@ -10656,21 +10666,21 @@ fi
     if test $? != 0; then
       have_python_config=failed
       if test "${with_python}" != auto; then
-        as_fn_error $? "failure running python-config --includes" "$LINENO" 5
+	as_fn_error $? "failure running python-config --includes" "$LINENO" 5
       fi
     fi
     python_libs=`${python_prog} ${srcdir}/python/python-config.py --ldflags`
     if test $? != 0; then
       have_python_config=failed
       if test "${with_python}" != auto; then
-        as_fn_error $? "failure running python-config --ldflags" "$LINENO" 5
+	as_fn_error $? "failure running python-config --ldflags" "$LINENO" 5
       fi
     fi
     python_prefix=`${python_prog} ${srcdir}/python/python-config.py --exec-prefix`
     if test $? != 0; then
       have_python_config=failed
       if test "${with_python}" != auto; then
-        as_fn_error $? "failure running python-config --exec-prefix" "$LINENO" 5
+	as_fn_error $? "failure running python-config --exec-prefix" "$LINENO" 5
       fi
     fi
   else
@@ -15351,17 +15361,14 @@ if ${ac_cv_func_setpgrp_void+:} false; then :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
 #include <unistd.h>
-
 int
 main ()
 {
-
-  if (setpgrp(1,1) == -1)
-    exit (0);
-  else
-    exit (1);
+if (setpgrp(1,1) == -1)
+	     exit (0);
+	   else
+	     exit (1);
 
   ;
   return 0;
@@ -15371,8 +15378,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_func_setpgrp_void=no
 else
   ac_cv_func_setpgrp_void=yes
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5
 $as_echo "$ac_cv_func_setpgrp_void" >&6; }
@@ -15399,9 +15408,10 @@ int
 main ()
 {
 #define REGEX_INTERFACE_VERSION 1
-#if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION
-# error "Version mismatch"
-#endif
+	 #if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION
+	 # error "Version mismatch"
+	 #endif
+
   ;
   return 0;
 }
@@ -15410,8 +15420,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_have_gnu_regex=yes
 else
   gdb_cv_have_gnu_regex=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_gnu_regex" >&5
 $as_echo "$gdb_cv_have_gnu_regex" >&6; }
@@ -15457,12 +15469,13 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/param.h>
-#define _KMEMUSER
-#include <sys/lwp.h>
+	 #define _KMEMUSER
+	 #include <sys/lwp.h>
 int
 main ()
 {
 struct lwp l;
+
   ;
   return 0;
 }
@@ -15471,8 +15484,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_struct_lwp=yes
 else
   gdb_cv_struct_lwp=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_struct_lwp" >&5
 $as_echo "$gdb_cv_struct_lwp" >&6; }
@@ -15491,11 +15506,12 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
-#include <machine/reg.h>
+	 #include <machine/reg.h>
 int
 main ()
 {
 struct reg r;
+
   ;
   return 0;
 }
@@ -15504,8 +15520,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_struct_reg=yes
 else
   gdb_cv_struct_reg=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_struct_reg" >&5
 $as_echo "$gdb_cv_struct_reg" >&6; }
@@ -15562,8 +15580,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_have_ptrace_getregs=yes
 else
   gdb_cv_have_ptrace_getregs=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_ptrace_getregs" >&5
@@ -15595,8 +15615,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_have_ptrace_getfpxregs=yes
 else
   gdb_cv_have_ptrace_getfpxregs=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_ptrace_getfpxregs" >&5
@@ -15616,11 +15638,12 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
-#include <sys/ptrace.h>
+	 #include <sys/ptrace.h>
 int
 main ()
 {
 PT_GETDBREGS;
+
   ;
   return 0;
 }
@@ -15629,8 +15652,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_have_pt_getdbregs=yes
 else
   gdb_cv_have_pt_getdbregs=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_pt_getdbregs" >&5
@@ -15650,11 +15675,12 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
-#include <sys/ptrace.h>
+	 #include <sys/ptrace.h>
 int
 main ()
 {
 PT_GETXMMREGS;
+
   ;
   return 0;
 }
@@ -15663,8 +15689,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_have_pt_getxmmregs=yes
 else
   gdb_cv_have_pt_getxmmregs=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_pt_getxmmregs" >&5
@@ -15947,16 +15975,15 @@ $as_echo_n "checking for -bbigtoc option... " >&6; }
 if ${gdb_cv_bigtoc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
+  SAVE_LDFLAGS=$LDFLAGS
 
-    SAVE_LDFLAGS=$LDFLAGS
-
-    case $GCC in
-    yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
-    *) gdb_cv_bigtoc=-bbigtoc ;;
-    esac
+     case $GCC in
+       yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
+       *) gdb_cv_bigtoc=-bbigtoc ;;
+     esac
 
-    LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+     LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -15971,10 +15998,11 @@ if ac_fn_c_try_link "$LINENO"; then :
 
 else
   gdb_cv_bigtoc=
+
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-    LDFLAGS="${SAVE_LDFLAGS}"
+     LDFLAGS="${SAVE_LDFLAGS}"
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_bigtoc" >&5
@@ -16086,8 +16114,9 @@ int
 main ()
 {
 #ifndef PTHDB_VERSION_3
-                                    #error
-                                    #endif
+	       #error
+	       #endif
+
   ;
   return 0;
 }
@@ -16096,8 +16125,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_have_aix_thread_debug=yes
 else
   gdb_cv_have_aix_thread_debug=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_have_aix_thread_debug" >&5
@@ -16129,7 +16160,7 @@ _ACEOF
 fi
 
 if test "x$ac_cv_header_thread_db_h" = "xyes"; then
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <thread_db.h> has TD_NOTALLOC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <thread_db.h> has TD_NOTALLOC" >&5
 $as_echo_n "checking whether <thread_db.h> has TD_NOTALLOC... " >&6; }
 if ${gdb_cv_thread_db_h_has_td_notalloc+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -16141,6 +16172,7 @@ int
 main ()
 {
 int i = TD_NOTALLOC;
+
   ;
   return 0;
 }
@@ -16156,7 +16188,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_thread_db_h_has_td_notalloc" >&5
 $as_echo "$gdb_cv_thread_db_h_has_td_notalloc" >&6; }
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <thread_db.h> has TD_VERSION" >&5
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <thread_db.h> has TD_VERSION" >&5
 $as_echo_n "checking whether <thread_db.h> has TD_VERSION... " >&6; }
 if ${gdb_cv_thread_db_h_has_td_version+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -16168,6 +16201,7 @@ int
 main ()
 {
 int i = TD_VERSION;
+
   ;
   return 0;
 }
@@ -16183,7 +16217,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_thread_db_h_has_td_version" >&5
 $as_echo "$gdb_cv_thread_db_h_has_td_version" >&6; }
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <thread_db.h> has TD_NOTLS" >&5
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <thread_db.h> has TD_NOTLS" >&5
 $as_echo_n "checking whether <thread_db.h> has TD_NOTLS... " >&6; }
 if ${gdb_cv_thread_db_h_has_td_notls+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -16195,6 +16230,7 @@ int
 main ()
 {
 int i = TD_NOTLS;
+
   ;
   return 0;
 }
diff --git a/gdb/configure.ac b/gdb/configure.ac
index c1073f867990..bfc053ed0969 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -20,7 +20,8 @@ dnl Process this file with autoconf to produce a configure script.
 
 m4_include(../config/debuginfod.m4)
 
-AC_INIT(main.c)
+AC_INIT
+AC_CONFIG_SRCDIR([main.c])
 AC_CONFIG_HEADERS(config.h:config.in, [echo > stamp-h])
 AM_MAINTAINER_MODE
 
@@ -157,7 +158,7 @@ AC_CONFIG_SUBDIRS(testsuite)
 AC_ARG_ENABLE(targets,
 AS_HELP_STRING([--enable-targets=TARGETS], [alternative target configurations]),
 [case "${enableval}" in
-  yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
+  yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
             ;;
   no)       enable_targets= ;;
   *)        enable_targets=$enableval ;;
@@ -391,22 +392,36 @@ AS_HELP_STRING([--enable-profiling], [enable profiling of GDB]),
  [enable_profiling=no])
 
 AC_CHECK_FUNCS(monstartup _mcleanup)
-AC_CACHE_CHECK([for _etext], ac_cv_var__etext,
-[AC_TRY_LINK(
-[#include <stdlib.h>
-extern char _etext;
-],
-[free (&_etext);], ac_cv_var__etext=yes, ac_cv_var__etext=no)])
+AC_CACHE_CHECK(
+  [for _etext],
+  [ac_cv_var__etext],
+  [AC_LINK_IFELSE(
+     [AC_LANG_PROGRAM(
+	[#include <stdlib.h>
+	 extern char _etext;],
+	[free (&_etext);]
+      )],
+     [ac_cv_var__etext=yes],
+     [ac_cv_var__etext=no]
+   )]
+)
 if test "$ac_cv_var__etext" = yes; then
   AC_DEFINE(HAVE__ETEXT, 1,
             [Define to 1 if your system has the _etext variable. ])
 fi
-AC_CACHE_CHECK([for etext], ac_cv_var_etext,
-[AC_TRY_LINK(
-[#include <stdlib.h>
-extern char etext;
-],
-[free (&etext);], ac_cv_var_etext=yes, ac_cv_var_etext=no)])
+AC_CACHE_CHECK(
+  [for etext],
+  [ac_cv_var_etext],
+  [AC_LINK_IFELSE(
+     [AC_LANG_PROGRAM(
+	[#include <stdlib.h>
+	 extern char etext;],
+	[free (&etext);]
+      )],
+     [ac_cv_var_etext=yes],
+     [ac_cv_var_etext=no]
+   )]
+)
 if test "$ac_cv_var_etext" = yes; then
   AC_DEFINE(HAVE_ETEXT, 1,
             [Define to 1 if your system has the etext variable. ])
@@ -419,9 +434,15 @@ if test "$enable_profiling" = yes ; then
   OLD_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS $PROFILE_CFLAGS"
 
-  AC_CACHE_CHECK([whether $CC supports -pg], ac_cv_cc_supports_pg,
-    [AC_TRY_COMPILE([], [int x;], ac_cv_cc_supports_pg=yes,
-     ac_cv_cc_supports_pg=no)])
+  AC_CACHE_CHECK(
+    [whether $CC supports -pg],
+    [ac_cv_cc_supports_pg],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([], [int x;])],
+       [ac_cv_cc_supports_pg=yes],
+       [ac_cv_cc_supports_pg=no]
+     )]
+  )
 
   if test "$ac_cv_cc_supports_pg" = no; then
     AC_MSG_ERROR(--enable-profiling requires a compiler which supports -pg)
@@ -574,16 +595,21 @@ AC_ARG_WITH([system-readline],
                   [use installed readline library])])
 
 if test "$with_system_readline" = yes; then
-   AC_CACHE_CHECK([whether system readline is new enough],
-     [gdb_cv_readline_ok],
-     [AC_TRY_COMPILE(
-       [#include <stdio.h>
-#include <readline/readline.h>],
-       [#if RL_VERSION_MAJOR < 7
-# error "readline version 7 required"
-#endif],
-    gdb_cv_readline_ok=yes,
-    gdb_cv_readline_ok=no)])
+  AC_CACHE_CHECK(
+    [whether system readline is new enough],
+    [gdb_cv_readline_ok],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+	  [#include <stdio.h>
+	   #include <readline/readline.h>],
+	  [#if RL_VERSION_MAJOR < 7
+	   # error "readline version 7 required"
+	   #endif]
+	)],
+       [gdb_cv_readline_ok=yes],
+       [gdb_cv_readline_ok=no]
+     )]
+  )
   if test "$gdb_cv_readline_ok" != yes; then
     AC_MSG_ERROR([system readline is not new enough])
   fi
@@ -778,12 +804,12 @@ else
       python_prog=${with_python}
       python_prefix=
     else
-      AC_ERROR(invalid value for --with-python)
+      AC_MSG_ERROR(invalid value for --with-python)
     fi
     ;;
   */*)
     # Disallow --with-python=foo/bar.
-    AC_ERROR(invalid value for --with-python)
+    AC_MSG_ERROR(invalid value for --with-python)
     ;;
   *)
     # The user has either specified auto, yes, or the name of the python
@@ -811,7 +837,7 @@ else
       python_prog="${with_python}"
       AC_PATH_PROG(python_prog_path, ${python_prog}, missing)
       if test "${python_prog_path}" = missing; then
-        AC_ERROR(unable to find python program ${python_prog})
+	AC_MSG_ERROR(unable to find python program ${python_prog})
       fi
       ;;
     esac
@@ -825,21 +851,21 @@ else
     if test $? != 0; then
       have_python_config=failed
       if test "${with_python}" != auto; then
-        AC_ERROR(failure running python-config --includes)
+	AC_MSG_ERROR(failure running python-config --includes)
       fi
     fi
     python_libs=`${python_prog} ${srcdir}/python/python-config.py --ldflags`
     if test $? != 0; then
       have_python_config=failed
       if test "${with_python}" != auto; then
-        AC_ERROR(failure running python-config --ldflags)
+	AC_MSG_ERROR(failure running python-config --ldflags)
       fi
     fi
     python_prefix=`${python_prog} ${srcdir}/python/python-config.py --exec-prefix`
     if test $? != 0; then
       have_python_config=failed
       if test "${with_python}" != auto; then
-        AC_ERROR(failure running python-config --exec-prefix)
+	AC_MSG_ERROR(failure running python-config --exec-prefix)
       fi
     fi
   else
@@ -944,7 +970,11 @@ if test "${have_libpython}" != no; then
       # Check that the compiler accepts it
       saved_CFLAGS="$CFLAGS"
       CFLAGS="$CFLAGS $flag"
-      AC_TRY_COMPILE([],[],PYTHON_CFLAGS="${PYTHON_CFLAGS} $flag",)
+      AC_COMPILE_IFELSE(
+	[AC_LANG_PROGRAM([], [])],
+	[PYTHON_CFLAGS="${PYTHON_CFLAGS} $flag"],
+	[]
+      )
       CFLAGS="$saved_CFLAGS"
     done
     AC_MSG_RESULT(${PYTHON_CFLAGS})
@@ -1305,15 +1335,21 @@ dnl Instead, assume we will have a prototype for setpgrp if cross compiling.
 if test "$cross_compiling" = no; then
   AC_FUNC_SETPGRP
 else
-  AC_CACHE_CHECK([whether setpgrp takes no argument], ac_cv_func_setpgrp_void,
-    [AC_TRY_COMPILE([
-#include <unistd.h>
-], [
-  if (setpgrp(1,1) == -1)
-    exit (0);
-  else
-    exit (1);
-], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes)])
+  AC_CACHE_CHECK(
+    [whether setpgrp takes no argument],
+    [ac_cv_func_setpgrp_void],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+	  [#include <unistd.h>],
+	  [if (setpgrp(1,1) == -1)
+	     exit (0);
+	   else
+	     exit (1);]
+	)],
+       [ac_cv_func_setpgrp_void=no],
+       [ac_cv_func_setpgrp_void=yes]
+     )]
+  )
 if test "$ac_cv_func_setpgrp_void" = yes; then
   AC_DEFINE(SETPGRP_VOID, 1)
 fi
@@ -1327,14 +1363,18 @@ gdb_use_included_regex=yes
 AC_CACHE_CHECK(
   [for GNU regex],
   [gdb_cv_have_gnu_regex],
-  [AC_TRY_COMPILE(
-    [#include <gnu-versions.h>],
-    [#define REGEX_INTERFACE_VERSION 1
-#if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION
-# error "Version mismatch"
-#endif],
-    gdb_cv_have_gnu_regex=yes,
-    gdb_cv_have_gnu_regex=no)])
+  [AC_COMPILE_IFELSE(
+     [AC_LANG_PROGRAM(
+	[#include <gnu-versions.h>],
+	[#define REGEX_INTERFACE_VERSION 1
+	 #if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION
+	 # error "Version mismatch"
+	 #endif]
+      )],
+     [gdb_cv_have_gnu_regex=yes],
+     [gdb_cv_have_gnu_regex=no]
+   )]
+)
 if test "$gdb_cv_have_gnu_regex" = yes; then
   gdb_use_included_regex=no
 fi
@@ -1355,21 +1395,39 @@ AC_CHECK_MEMBERS([struct thread.td_pcb], [], [],
 ])
 
 # See if <sys/lwp.h> defines `struct lwp`.
-AC_CACHE_CHECK([for struct lwp], gdb_cv_struct_lwp,
-[AC_TRY_COMPILE([#include <sys/param.h>
-#define _KMEMUSER
-#include <sys/lwp.h>], [struct lwp l;],
-gdb_cv_struct_lwp=yes, gdb_cv_struct_lwp=no)])
+AC_CACHE_CHECK(
+  [for struct lwp],
+  [gdb_cv_struct_lwp],
+  [AC_COMPILE_IFELSE(
+     [AC_LANG_PROGRAM(
+	[#include <sys/param.h>
+	 #define _KMEMUSER
+	 #include <sys/lwp.h>],
+	[struct lwp l;]
+      )],
+     [gdb_cv_struct_lwp=yes],
+     [gdb_cv_struct_lwp=no]
+   )]
+)
 if test "$gdb_cv_struct_lwp" = yes; then
   AC_DEFINE(HAVE_STRUCT_LWP, 1,
             [Define to 1 if your system has struct lwp.])
 fi
 
 # See if <machine/reg.h> degines `struct reg'.
-AC_CACHE_CHECK([for struct reg in machine/reg.h], gdb_cv_struct_reg,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <machine/reg.h>], [struct reg r;],
-gdb_cv_struct_reg=yes, gdb_cv_struct_reg=no)])
+AC_CACHE_CHECK(
+  [for struct reg in machine/reg.h],
+  [gdb_cv_struct_reg],
+  [AC_COMPILE_IFELSE(
+     [AC_LANG_PROGRAM(
+	[#include <sys/types.h>
+	 #include <machine/reg.h>],
+	[struct reg r;]
+      )],
+     [gdb_cv_struct_reg=yes],
+     [gdb_cv_struct_reg=no]
+   )]
+)
 if test "$gdb_cv_struct_reg" = yes; then
   AC_DEFINE(HAVE_STRUCT_REG, 1,
             [Define to 1 if your system has struct reg in <machine/reg.h>.])
@@ -1383,11 +1441,14 @@ AC_CHECK_MEMBERS([struct reg.r_fs, struct reg.r_gs], [], [],
 
 # See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
 AC_MSG_CHECKING(for PTRACE_GETREGS)
-AC_CACHE_VAL(gdb_cv_have_ptrace_getregs,
-[AC_TRY_COMPILE([#include <sys/ptrace.h>],
-		[PTRACE_GETREGS;],
-		[gdb_cv_have_ptrace_getregs=yes],
-		[gdb_cv_have_ptrace_getregs=no])])
+AC_CACHE_VAL(
+  [gdb_cv_have_ptrace_getregs],
+  [AC_COMPILE_IFELSE(
+    [AC_LANG_PROGRAM([#include <sys/ptrace.h>], [PTRACE_GETREGS;])],
+    [gdb_cv_have_ptrace_getregs=yes],
+    [gdb_cv_have_ptrace_getregs=no]
+   )]
+)
 AC_MSG_RESULT($gdb_cv_have_ptrace_getregs)
 if test "$gdb_cv_have_ptrace_getregs" = yes; then
   AC_DEFINE(HAVE_PTRACE_GETREGS, 1,
@@ -1396,11 +1457,14 @@ fi
 
 # See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
 AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
-AC_CACHE_VAL(gdb_cv_have_ptrace_getfpxregs,
-[AC_TRY_COMPILE([#include <sys/ptrace.h>],
-		[PTRACE_GETFPXREGS;],
-		[gdb_cv_have_ptrace_getfpxregs=yes],
-		[gdb_cv_have_ptrace_getfpxregs=no])])
+AC_CACHE_VAL(
+  [gdb_cv_have_ptrace_getfpxregs],
+  [AC_COMPILE_IFELSE(
+     [AC_LANG_PROGRAM([#include <sys/ptrace.h>], [PTRACE_GETFPXREGS;])],
+     [gdb_cv_have_ptrace_getfpxregs=yes],
+     [gdb_cv_have_ptrace_getfpxregs=no]
+   )]
+)
 AC_MSG_RESULT($gdb_cv_have_ptrace_getfpxregs)
 if test "$gdb_cv_have_ptrace_getfpxregs" = yes; then
   AC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1,
@@ -1409,12 +1473,18 @@ fi
 
 # See if <sys/ptrace.h> provides the PT_GETDBREGS request.
 AC_MSG_CHECKING(for PT_GETDBREGS)
-AC_CACHE_VAL(gdb_cv_have_pt_getdbregs,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/ptrace.h>],
-		[PT_GETDBREGS;],
-		[gdb_cv_have_pt_getdbregs=yes],
-		[gdb_cv_have_pt_getdbregs=no])])
+AC_CACHE_VAL(
+  [gdb_cv_have_pt_getdbregs],
+  [AC_COMPILE_IFELSE(
+     [AC_LANG_PROGRAM(
+	[#include <sys/types.h>
+	 #include <sys/ptrace.h>],
+	[PT_GETDBREGS;]
+      )],
+     [gdb_cv_have_pt_getdbregs=yes],
+     [gdb_cv_have_pt_getdbregs=no]
+   )]
+)
 AC_MSG_RESULT($gdb_cv_have_pt_getdbregs)
 if test "$gdb_cv_have_pt_getdbregs" = yes; then
   AC_DEFINE(HAVE_PT_GETDBREGS, 1,
@@ -1423,12 +1493,18 @@ fi
 
 # See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
 AC_MSG_CHECKING(for PT_GETXMMREGS)
-AC_CACHE_VAL(gdb_cv_have_pt_getxmmregs,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/ptrace.h>],
-		[PT_GETXMMREGS;],
-		[gdb_cv_have_pt_getxmmregs=yes],
-		[gdb_cv_have_pt_getxmmregs=no])])
+AC_CACHE_VAL(
+  [gdb_cv_have_pt_getxmmregs],
+  [AC_COMPILE_IFELSE(
+     [AC_LANG_PROGRAM(
+	[#include <sys/types.h>
+	 #include <sys/ptrace.h>],
+	[PT_GETXMMREGS;]
+      )],
+     [gdb_cv_have_pt_getxmmregs=yes],
+     [gdb_cv_have_pt_getxmmregs=no]
+   )]
+)
 AC_MSG_RESULT($gdb_cv_have_pt_getxmmregs)
 if test "$gdb_cv_have_pt_getxmmregs" = yes; then
   AC_DEFINE(HAVE_PT_GETXMMREGS, 1,
@@ -1551,18 +1627,23 @@ fi
 
 case ${host_os} in
 aix*)
-  AC_CACHE_CHECK([for -bbigtoc option], [gdb_cv_bigtoc], [
-    SAVE_LDFLAGS=$LDFLAGS
-
-    case $GCC in
-    yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
-    *) gdb_cv_bigtoc=-bbigtoc ;;
-    esac
-
-    LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
-    AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=])
-    LDFLAGS="${SAVE_LDFLAGS}"
-  ])
+  AC_CACHE_CHECK(
+    [for -bbigtoc option], [gdb_cv_bigtoc],
+    [SAVE_LDFLAGS=$LDFLAGS
+
+     case $GCC in
+       yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
+       *) gdb_cv_bigtoc=-bbigtoc ;;
+     esac
+
+     LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
+     AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM([], [int i;])],
+       [],
+       [gdb_cv_bigtoc=]
+     )
+     LDFLAGS="${SAVE_LDFLAGS}"]
+  )
   CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}"
   ;;
 esac
@@ -1578,7 +1659,11 @@ if test "${gdb_native}" = yes; then
    RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list"
    LDFLAGS="$LDFLAGS $RDYNAMIC"
    if test "${have_libpython}" = no; then
-     AC_TRY_LINK([], [], [dynamic_list=true])
+     AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM([], [])],
+       [dynamic_list=true],
+       []
+     )
    else
      # Workaround http://bugs.python.org/issue4434 where static
      # libpythonX.Y.a would get its symbols required for
@@ -1631,13 +1716,19 @@ if test "${build}" = "${host}" -a "${host}" = "${target}" ; then
    case ${host_os} in
    aix*)
       AC_MSG_CHECKING(for AiX thread debugging library)
-      AC_CACHE_VAL(gdb_cv_have_aix_thread_debug,
-                   [AC_TRY_COMPILE([#include <sys/pthdebug.h>],
-                                   [#ifndef PTHDB_VERSION_3
-                                    #error
-                                    #endif],
-                                   gdb_cv_have_aix_thread_debug=yes,
-                                   gdb_cv_have_aix_thread_debug=no)])
+      AC_CACHE_VAL(
+	[gdb_cv_have_aix_thread_debug],
+	[AC_COMPILE_IFELSE(
+	   [AC_LANG_PROGRAM(
+	      [#include <sys/pthdebug.h>],
+	      [#ifndef PTHDB_VERSION_3
+	       #error
+	       #endif]
+	    )],
+	   [gdb_cv_have_aix_thread_debug=yes],
+	   [gdb_cv_have_aix_thread_debug=no]
+	 )]
+      )
       AC_MSG_RESULT($gdb_cv_have_aix_thread_debug)
       if test "$gdb_cv_have_aix_thread_debug" = yes; then
          CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c"
@@ -1657,33 +1748,44 @@ fi
 dnl See if we have a thread_db header file that has TD_NOTALLOC and
 dnl other error codes.
 if test "x$ac_cv_header_thread_db_h" = "xyes"; then
-   AC_CACHE_CHECK([whether <thread_db.h> has TD_NOTALLOC],
-                  gdb_cv_thread_db_h_has_td_notalloc,
-     AC_TRY_COMPILE(
-       [#include <thread_db.h>],
-       [int i = TD_NOTALLOC;],
-       gdb_cv_thread_db_h_has_td_notalloc=yes,
-       gdb_cv_thread_db_h_has_td_notalloc=no
-     )
-   )
-   AC_CACHE_CHECK([whether <thread_db.h> has TD_VERSION],
-                  gdb_cv_thread_db_h_has_td_version,
-     AC_TRY_COMPILE(
-       [#include <thread_db.h>],
-       [int i = TD_VERSION;],
-       gdb_cv_thread_db_h_has_td_version=yes,
-       gdb_cv_thread_db_h_has_td_version=no
-     )
-   )
-   AC_CACHE_CHECK([whether <thread_db.h> has TD_NOTLS],
-                  gdb_cv_thread_db_h_has_td_notls,
-     AC_TRY_COMPILE(
-       [#include <thread_db.h>],
-       [int i = TD_NOTLS;],
-       gdb_cv_thread_db_h_has_td_notls=yes,
-       gdb_cv_thread_db_h_has_td_notls=no
-     )
-   )
+  AC_CACHE_CHECK(
+    [whether <thread_db.h> has TD_NOTALLOC],
+    [gdb_cv_thread_db_h_has_td_notalloc],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+	  [#include <thread_db.h>],
+	  [int i = TD_NOTALLOC;]
+	)],
+       [gdb_cv_thread_db_h_has_td_notalloc=yes],
+       [gdb_cv_thread_db_h_has_td_notalloc=no]
+     )]
+  )
+
+  AC_CACHE_CHECK(
+    [whether <thread_db.h> has TD_VERSION],
+    [gdb_cv_thread_db_h_has_td_version],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+	  [#include <thread_db.h>],
+	  [int i = TD_VERSION;]
+	)],
+       [gdb_cv_thread_db_h_has_td_version=yes],
+       [gdb_cv_thread_db_h_has_td_version=no]
+     )]
+  )
+
+  AC_CACHE_CHECK(
+    [whether <thread_db.h> has TD_NOTLS],
+    [gdb_cv_thread_db_h_has_td_notls],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+	  [#include <thread_db.h>],
+	  [int i = TD_NOTLS;]
+	)],
+       [gdb_cv_thread_db_h_has_td_notls=yes],
+       [gdb_cv_thread_db_h_has_td_notls=no]
+     )]
+  )
 fi
 if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then
   AC_DEFINE(THREAD_DB_HAS_TD_NOTALLOC, 1,
@@ -2029,7 +2131,7 @@ fi
 
 # Check for babeltrace and babeltrace-ctf
 AC_ARG_WITH(babeltrace,
-  AC_HELP_STRING([--with-babeltrace], [include babeltrace support (auto/yes/no)]),
+  AS_HELP_STRING([--with-babeltrace], [include babeltrace support (auto/yes/no)]),
   [], [with_babeltrace=auto])
 AC_MSG_CHECKING([whether to use babeltrace])
 AC_MSG_RESULT([$with_babeltrace])
@@ -2072,7 +2174,7 @@ fi
 
 # Check for xxhash
 AC_ARG_WITH(xxhash,
-  AC_HELP_STRING([--with-xxhash], [use libxxhash for hashing (faster) (auto/yes/no)]),
+  AS_HELP_STRING([--with-xxhash], [use libxxhash for hashing (faster) (auto/yes/no)]),
   [], [with_xxhash=auto])
 
 GCC_ENABLE([libctf], [yes], [], [Handle .ctf type-info sections])
@@ -2133,7 +2235,7 @@ dnl Add dependency for xsltproc if building with maintainer-mode enabled.
 AC_PATH_PROGS(XSLTPROC, xsltproc, missing)
 if test "x$USE_MAINTAINER_MODE" = xyes; then
   if test "${XSLTPROC}" = missing; then
-    AC_ERROR(unable to find xsltproc.  maintainer-mode requires xsltproc.)
+    AC_MSG_ERROR(unable to find xsltproc.  maintainer-mode requires xsltproc.)
   fi
 fi
 AC_SUBST(XSLTPROC)
-- 
2.29.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 05/13] gdb/testsuite: modernize configure.ac
  2020-10-26  2:14 [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
                   ` (3 preceding siblings ...)
  2020-10-26  2:14 ` [PATCH 04/13] gdb: " Simon Marchi
@ 2020-10-26  2:14 ` Simon Marchi
  2020-10-26  2:14 ` [PATCH 06/13] gdb: modernize acinclude.m4 Simon Marchi
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:14 UTC (permalink / raw)
  To: gdb-patches

Run autoupdate, the only change is to split AC_INIT into AC_INIT and
AC_CONFIG_SRCDIR.

gdb/testsuite/ChangeLog:

	* configure.ac: Split AC_INIT into AC_INIT and AC_CONFIG_SRCDIR.
	* configure: Re-generate.

Change-Id: I6e40c0261bda4fe9144b896799ef460d23e22e09
---
 gdb/testsuite/configure    | 1 +
 gdb/testsuite/configure.ac | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure
index 0de607446003..3b0d4ed8ad35 100755
--- a/gdb/testsuite/configure
+++ b/gdb/testsuite/configure
@@ -2008,6 +2008,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
   if test -f "$ac_dir/install-sh"; then
diff --git a/gdb/testsuite/configure.ac b/gdb/testsuite/configure.ac
index cc62c3fc45b2..c1dd130e65cb 100644
--- a/gdb/testsuite/configure.ac
+++ b/gdb/testsuite/configure.ac
@@ -16,7 +16,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_INIT(gdb.base)
+AC_INIT
+AC_CONFIG_SRCDIR([gdb.base])
 
 AC_CANONICAL_BUILD
 AC_CANONICAL_HOST
-- 
2.29.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 06/13] gdb: modernize acinclude.m4
  2020-10-26  2:14 [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
                   ` (4 preceding siblings ...)
  2020-10-26  2:14 ` [PATCH 05/13] gdb/testsuite: " Simon Marchi
@ 2020-10-26  2:14 ` Simon Marchi
  2020-10-26  2:14 ` [PATCH 07/13] gdbsupport: re-indent ptrace.m4 Simon Marchi
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:14 UTC (permalink / raw)
  To: gdb-patches

Run autoupdate, fix indentation for readability.

gdb/ChangeLog:

	* acinclude.m4: Modernize.
	* configure: Re-generate.

Change-Id: I8949f885326a3206f414776b63a1fdba197bb19a
---
 gdb/acinclude.m4 | 48 ++++++++++++++++++++++++++++++++----------------
 gdb/configure    | 16 ++++++++++------
 2 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index a557d6bc8666..64574e263142 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -98,13 +98,22 @@ dnl to use a different cache variable name in this macro if it is invoked
 dnl in a different context somewhere else.
 dnl gcc_AC_CHECK_DECL(SYMBOL,
 dnl 	[ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]])
-AC_DEFUN([gcc_AC_CHECK_DECL],
-[AC_MSG_CHECKING([whether $1 is declared])
-AC_CACHE_VAL(gcc_cv_have_decl_$1,
-[AC_TRY_COMPILE([$4],
-[#ifndef $1
-char *(*pfn) = (char *(*)) $1 ;
-#endif], eval "gcc_cv_have_decl_$1=yes", eval "gcc_cv_have_decl_$1=no")])
+AC_DEFUN(
+  [gcc_AC_CHECK_DECL],
+  [AC_MSG_CHECKING([whether $1 is declared])
+   AC_CACHE_VAL(
+     [gcc_cv_have_decl_$1],
+     [AC_COMPILE_IFELSE(
+	[AC_LANG_PROGRAM(
+	   [$4],
+	   [#ifndef $1
+	    char *(*pfn) = (char *(*)) $1 ;
+	    #endif]
+	 )],
+	[eval "gcc_cv_have_decl_$1=yes"],
+	[eval "gcc_cv_have_decl_$1=no"]
+      )]
+   )
 if eval "test \"`echo '$gcc_cv_have_decl_'$1`\" = yes"; then
   AC_MSG_RESULT(yes) ; ifelse([$2], , :, [$2])
 else
@@ -159,7 +168,7 @@ AC_DEFUN([CY_AC_TCL_PRIVATE_HEADERS], [
   fi
 
   if test x"${private_dir}" = x; then
-    AC_ERROR(could not find private Tcl headers)
+    AC_MSG_ERROR(could not find private Tcl headers)
   else
     TCL_PRIVATE_INCLUDE="-I${private_dir}"
     AC_MSG_RESULT(${private_dir})
@@ -180,7 +189,7 @@ AC_DEFUN([CY_AC_TK_PRIVATE_HEADERS], [
   fi
 
   if test x"${private_dir}" = x; then
-    AC_ERROR(could not find Tk private headers)
+    AC_MSG_ERROR(could not find Tk private headers)
   else
     TK_PRIVATE_INCLUDE="-I${private_dir}"
     AC_MSG_RESULT(${private_dir})
@@ -251,13 +260,20 @@ AC_DEFUN([GDB_AC_CHECK_BFD], [
   LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
   intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
   LIBS="-lbfd -liberty -lz $intl $LIBS"
-  AC_CACHE_CHECK([$1], [$2],
-  [AC_TRY_LINK(
-  [#include <stdlib.h>
-  #include "bfd.h"
-  #include "$4"
-  ],
-  [return $3;], [[$2]=yes], [[$2]=no])])
+  AC_CACHE_CHECK(
+    [$1],
+    [$2],
+    [AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+	  [#include <stdlib.h>
+	   #include "bfd.h"
+	   #include "$4"],
+	  [return $3;]
+	)],
+       [[$2]=yes],
+       [[$2]=no]
+     )]
+  )
   CFLAGS=$OLD_CFLAGS
   LDFLAGS=$OLD_LDFLAGS
   LIBS=$OLD_LIBS])
diff --git a/gdb/configure b/gdb/configure
index 5678deac68cc..ec36cc190938 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -16734,13 +16734,13 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
-  #include "bfd.h"
-  #include "elf-bfd.h"
-
+	   #include "bfd.h"
+	   #include "elf-bfd.h"
 int
 main ()
 {
 return bfd_get_elf_phdr_upper_bound (NULL);
+
   ;
   return 0;
 }
@@ -16749,9 +16749,11 @@ if ac_fn_c_try_link "$LINENO"; then :
   gdb_cv_var_elf=yes
 else
   gdb_cv_var_elf=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_var_elf" >&5
 $as_echo "$gdb_cv_var_elf" >&6; }
@@ -16845,13 +16847,13 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
-  #include "bfd.h"
-  #include "mach-o.h"
-
+	   #include "bfd.h"
+	   #include "mach-o.h"
 int
 main ()
 {
 return bfd_mach_o_lookup_command (NULL, 0, NULL);
+
   ;
   return 0;
 }
@@ -16860,9 +16862,11 @@ if ac_fn_c_try_link "$LINENO"; then :
   gdb_cv_var_macho=yes
 else
   gdb_cv_var_macho=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_var_macho" >&5
 $as_echo "$gdb_cv_var_macho" >&6; }
-- 
2.29.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 07/13] gdbsupport: re-indent ptrace.m4
  2020-10-26  2:14 [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
                   ` (5 preceding siblings ...)
  2020-10-26  2:14 ` [PATCH 06/13] gdb: modernize acinclude.m4 Simon Marchi
@ 2020-10-26  2:14 ` Simon Marchi
  2020-10-26  2:14 ` [PATCH 08/13] gdbsupport: replace AC_TRY_COMPILE in ptrace.m4 Simon Marchi
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:14 UTC (permalink / raw)
  To: gdb-patches

For some reason, autoupdate isn't able to grok ptrace.m4:

    $ autoupdate ptrace.m4
    /usr/bin/m4:/tmp/auYjuodw/input.m4:171: ERROR: end of file in string
    autoupdate: /usr/bin/m4 failed with exit status: 1

Honestly, I'm unable to grok it either.  This patch re-indents it in a
way that I think is easier to read.  With this patch applied, autoupdate
becomes able to parse ptrace.m4, but I chose to keep this re-indent in a
patch of its own.

All the changes in generated configure files consist of insignificant
whitespace changes.

gdb/ChangeLog:

	* configure: Re-generate.

gdbserver/ChangeLog:

	* configure: Re-generate.

gdbsupport/ChangeLog:

	* configure: Re-generate.
	* ptrace.m4: Re-indent.

Change-Id: Ie2afab09fecc8b6d0cccccb47ac9756f3843881e
---
 gdb/configure        | 55 ++++++++++++-------------
 gdbserver/configure  | 55 ++++++++++++-------------
 gdbsupport/configure | 55 ++++++++++++-------------
 gdbsupport/ptrace.m4 | 95 ++++++++++++++++++++++++++------------------
 4 files changed, 141 insertions(+), 119 deletions(-)

diff --git a/gdb/configure b/gdb/configure
index ec36cc190938..4816b98919a0 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -15193,25 +15193,29 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_func_ptrace_ret='int'
 else
   gdb_cv_func_ptrace_ret='long'
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_ret" >&5
 $as_echo "$gdb_cv_func_ptrace_ret" >&6; }
 
+
 cat >>confdefs.h <<_ACEOF
 #define PTRACE_TYPE_RET $gdb_cv_func_ptrace_ret
 _ACEOF
 
+
 # Check argument types.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for ptrace" >&5
 $as_echo_n "checking types of arguments for ptrace... " >&6; }
 if ${gdb_cv_func_ptrace_args+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $gdb_ptrace_headers
@@ -15226,64 +15230,61 @@ _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_func_ptrace_args='enum __ptrace_request,int,long,long'
 else
-
-for gdb_arg1 in 'int' 'long'; do
- for gdb_arg2 in 'pid_t' 'int' 'long'; do
-  for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
-   for gdb_arg4 in 'int' 'long' 'void *'; do
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  for gdb_arg1 in 'int' 'long'; do
+	for gdb_arg2 in 'pid_t' 'int' 'long'; do
+	  for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
+	    for gdb_arg4 in 'int' 'long' 'void *'; do
+	      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $gdb_ptrace_headers
 int
 main ()
 {
-
-extern $gdb_cv_func_ptrace_ret
-  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
-
+extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4";
-    break 4;
+		 break 4;
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    for gdb_arg5 in 'int *' 'int' 'long'; do
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+	      for gdb_arg5 in 'int *' 'int' 'long'; do
+		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $gdb_ptrace_headers
 int
 main ()
 {
-
-extern $gdb_cv_func_ptrace_ret
-  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
-
+extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
+		   break 5;
 
-gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
-    break 5;
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    done
-   done
-  done
- done
-done
-# Provide a safe default value.
-: ${gdb_cv_func_ptrace_args='int,int,long,long'}
+	      done
+	    done
+	  done
+	done
+      done
+      # Provide a safe default value.
+      : ${gdb_cv_func_ptrace_args='int,int,long,long'}
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_args" >&5
 $as_echo "$gdb_cv_func_ptrace_args" >&6; }
+
 ac_save_IFS=$IFS; IFS=','
 set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'`
 IFS=$ac_save_IFS
diff --git a/gdbserver/configure b/gdbserver/configure
index c91ce71c943e..968642124b56 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -9475,25 +9475,29 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_func_ptrace_ret='int'
 else
   gdb_cv_func_ptrace_ret='long'
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_ret" >&5
 $as_echo "$gdb_cv_func_ptrace_ret" >&6; }
 
+
 cat >>confdefs.h <<_ACEOF
 #define PTRACE_TYPE_RET $gdb_cv_func_ptrace_ret
 _ACEOF
 
+
 # Check argument types.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for ptrace" >&5
 $as_echo_n "checking types of arguments for ptrace... " >&6; }
 if ${gdb_cv_func_ptrace_args+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $gdb_ptrace_headers
@@ -9508,64 +9512,61 @@ _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_func_ptrace_args='enum __ptrace_request,int,long,long'
 else
-
-for gdb_arg1 in 'int' 'long'; do
- for gdb_arg2 in 'pid_t' 'int' 'long'; do
-  for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
-   for gdb_arg4 in 'int' 'long' 'void *'; do
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  for gdb_arg1 in 'int' 'long'; do
+	for gdb_arg2 in 'pid_t' 'int' 'long'; do
+	  for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
+	    for gdb_arg4 in 'int' 'long' 'void *'; do
+	      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $gdb_ptrace_headers
 int
 main ()
 {
-
-extern $gdb_cv_func_ptrace_ret
-  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
-
+extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4";
-    break 4;
+		 break 4;
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    for gdb_arg5 in 'int *' 'int' 'long'; do
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+	      for gdb_arg5 in 'int *' 'int' 'long'; do
+		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $gdb_ptrace_headers
 int
 main ()
 {
-
-extern $gdb_cv_func_ptrace_ret
-  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
-
+extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
+		   break 5;
 
-gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
-    break 5;
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    done
-   done
-  done
- done
-done
-# Provide a safe default value.
-: ${gdb_cv_func_ptrace_args='int,int,long,long'}
+	      done
+	    done
+	  done
+	done
+      done
+      # Provide a safe default value.
+      : ${gdb_cv_func_ptrace_args='int,int,long,long'}
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_args" >&5
 $as_echo "$gdb_cv_func_ptrace_args" >&6; }
+
 ac_save_IFS=$IFS; IFS=','
 set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'`
 IFS=$ac_save_IFS
diff --git a/gdbsupport/configure b/gdbsupport/configure
index 24e6e3e71958..e51c7b596883 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -10044,25 +10044,29 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_func_ptrace_ret='int'
 else
   gdb_cv_func_ptrace_ret='long'
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_ret" >&5
 $as_echo "$gdb_cv_func_ptrace_ret" >&6; }
 
+
 cat >>confdefs.h <<_ACEOF
 #define PTRACE_TYPE_RET $gdb_cv_func_ptrace_ret
 _ACEOF
 
+
 # Check argument types.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for ptrace" >&5
 $as_echo_n "checking types of arguments for ptrace... " >&6; }
 if ${gdb_cv_func_ptrace_args+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $gdb_ptrace_headers
@@ -10077,64 +10081,61 @@ _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_func_ptrace_args='enum __ptrace_request,int,long,long'
 else
-
-for gdb_arg1 in 'int' 'long'; do
- for gdb_arg2 in 'pid_t' 'int' 'long'; do
-  for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
-   for gdb_arg4 in 'int' 'long' 'void *'; do
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  for gdb_arg1 in 'int' 'long'; do
+	for gdb_arg2 in 'pid_t' 'int' 'long'; do
+	  for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
+	    for gdb_arg4 in 'int' 'long' 'void *'; do
+	      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $gdb_ptrace_headers
 int
 main ()
 {
-
-extern $gdb_cv_func_ptrace_ret
-  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
-
+extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4";
-    break 4;
+		 break 4;
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    for gdb_arg5 in 'int *' 'int' 'long'; do
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+	      for gdb_arg5 in 'int *' 'int' 'long'; do
+		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $gdb_ptrace_headers
 int
 main ()
 {
-
-extern $gdb_cv_func_ptrace_ret
-  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
-
+extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
+		   break 5;
 
-gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
-    break 5;
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    done
-   done
-  done
- done
-done
-# Provide a safe default value.
-: ${gdb_cv_func_ptrace_args='int,int,long,long'}
+	      done
+	    done
+	  done
+	done
+      done
+      # Provide a safe default value.
+      : ${gdb_cv_func_ptrace_args='int,int,long,long'}
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_ptrace_args" >&5
 $as_echo "$gdb_cv_func_ptrace_args" >&6; }
+
 ac_save_IFS=$IFS; IFS=','
 set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'`
 IFS=$ac_save_IFS
diff --git a/gdbsupport/ptrace.m4 b/gdbsupport/ptrace.m4
index 0fcd855aa8fd..57ed80260ac0 100644
--- a/gdbsupport/ptrace.m4
+++ b/gdbsupport/ptrace.m4
@@ -34,45 +34,64 @@ gdb_ptrace_headers='
 
 # Check return type.  Varargs (used on GNU/Linux) conflict with the
 # empty argument list, so check for that explicitly.
-AC_CACHE_CHECK([return type of ptrace], gdb_cv_func_ptrace_ret,
-  AC_TRY_COMPILE($gdb_ptrace_headers,
-    [extern long ptrace (enum __ptrace_request, ...);],
-    gdb_cv_func_ptrace_ret='long',
-    AC_TRY_COMPILE($gdb_ptrace_headers,
-      [extern int ptrace ();],
-      gdb_cv_func_ptrace_ret='int',
-      gdb_cv_func_ptrace_ret='long')))
-AC_DEFINE_UNQUOTED(PTRACE_TYPE_RET, $gdb_cv_func_ptrace_ret,
-  [Define as the return type of ptrace.])
+AC_CACHE_CHECK(
+  [return type of ptrace],
+  [gdb_cv_func_ptrace_ret],
+  [AC_TRY_COMPILE(
+     [$gdb_ptrace_headers],
+     [extern long ptrace (enum __ptrace_request, ...);],
+     [gdb_cv_func_ptrace_ret='long'],
+     [AC_TRY_COMPILE(
+	[$gdb_ptrace_headers],
+	[extern int ptrace ();],
+	[gdb_cv_func_ptrace_ret='int'],
+	[gdb_cv_func_ptrace_ret='long']
+      )]
+   )]
+)
+
+AC_DEFINE_UNQUOTED(
+  [PTRACE_TYPE_RET],
+  [$gdb_cv_func_ptrace_ret],
+  [Define as the return type of ptrace.]
+)
+
 # Check argument types.
-AC_CACHE_CHECK([types of arguments for ptrace], gdb_cv_func_ptrace_args, [
-  AC_TRY_COMPILE($gdb_ptrace_headers,
-    [extern long ptrace (enum __ptrace_request, ...);],
-    [gdb_cv_func_ptrace_args='enum __ptrace_request,int,long,long'],[
-for gdb_arg1 in 'int' 'long'; do
- for gdb_arg2 in 'pid_t' 'int' 'long'; do
-  for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
-   for gdb_arg4 in 'int' 'long' 'void *'; do
-     AC_TRY_COMPILE($gdb_ptrace_headers, [
-extern $gdb_cv_func_ptrace_ret
-  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
-], [gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4";
-    break 4;])
-    for gdb_arg5 in 'int *' 'int' 'long'; do
-     AC_TRY_COMPILE($gdb_ptrace_headers, [
-extern $gdb_cv_func_ptrace_ret
-  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
-], [
-gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
-    break 5;])
-    done
-   done
-  done
- done
-done
-# Provide a safe default value.
-: ${gdb_cv_func_ptrace_args='int,int,long,long'}
-])])
+AC_CACHE_CHECK(
+  [types of arguments for ptrace],
+  [gdb_cv_func_ptrace_args],
+  [AC_TRY_COMPILE(
+     [$gdb_ptrace_headers],
+     [extern long ptrace (enum __ptrace_request, ...);],
+     [gdb_cv_func_ptrace_args='enum __ptrace_request,int,long,long'],
+     [for gdb_arg1 in 'int' 'long'; do
+	for gdb_arg2 in 'pid_t' 'int' 'long'; do
+	  for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
+	    for gdb_arg4 in 'int' 'long' 'void *'; do
+	      AC_TRY_COMPILE(
+		[$gdb_ptrace_headers],
+		[extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);],
+		[gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4";
+		 break 4;]
+	      )
+
+	      for gdb_arg5 in 'int *' 'int' 'long'; do
+		AC_TRY_COMPILE(
+		  [$gdb_ptrace_headers],
+		  [extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);],
+		  [gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
+		   break 5;]
+		)
+	      done
+	    done
+	  done
+	done
+      done
+      # Provide a safe default value.
+      : ${gdb_cv_func_ptrace_args='int,int,long,long'}]
+   )]
+)
+
 ac_save_IFS=$IFS; IFS=','
 set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'`
 IFS=$ac_save_IFS
-- 
2.29.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 08/13] gdbsupport: replace AC_TRY_COMPILE in ptrace.m4
  2020-10-26  2:14 [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
                   ` (6 preceding siblings ...)
  2020-10-26  2:14 ` [PATCH 07/13] gdbsupport: re-indent ptrace.m4 Simon Marchi
@ 2020-10-26  2:14 ` Simon Marchi
  2020-10-26  2:14 ` [PATCH 09/13] gdbsupport: replace AC_TRY_COMPILE in warning.m4 Simon Marchi
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:14 UTC (permalink / raw)
  To: gdb-patches

Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE + AC_LANG_PROGRAM.

All the changes in the generated configure files are insignificant
whitespace changes.

gdb/ChangeLog:

	* configure: Re-generate.

gdbserver/ChangeLog:

	* configure: Re-generate.

gdbsupport/ChangeLog:

	* configure: Re-generate.
	* ptrace.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE +
	AC_LANG_PROGRAM.

Change-Id: Ia782b5477fe49dad04e68c0f41c6d8ab3fde5bf0
---
 gdb/configure        |  7 ++++++-
 gdbserver/configure  |  7 ++++++-
 gdbsupport/configure |  7 ++++++-
 gdbsupport/ptrace.m4 | 40 +++++++++++++++++++++++++---------------
 4 files changed, 43 insertions(+), 18 deletions(-)

diff --git a/gdb/configure b/gdb/configure
index 4816b98919a0..65904baf8045 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -15166,11 +15166,12 @@ if ${gdb_cv_func_ptrace_ret+:} false; then :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$gdb_ptrace_headers
+ $gdb_ptrace_headers
 int
 main ()
 {
 extern long ptrace (enum __ptrace_request, ...);
+
   ;
   return 0;
 }
@@ -15185,6 +15186,7 @@ int
 main ()
 {
 extern int ptrace ();
+
   ;
   return 0;
 }
@@ -15223,6 +15225,7 @@ int
 main ()
 {
 extern long ptrace (enum __ptrace_request, ...);
+
   ;
   return 0;
 }
@@ -15241,6 +15244,7 @@ int
 main ()
 {
 extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
+
   ;
   return 0;
 }
@@ -15260,6 +15264,7 @@ int
 main ()
 {
 extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
+
   ;
   return 0;
 }
diff --git a/gdbserver/configure b/gdbserver/configure
index 968642124b56..3980ae762307 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -9448,11 +9448,12 @@ if ${gdb_cv_func_ptrace_ret+:} false; then :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$gdb_ptrace_headers
+ $gdb_ptrace_headers
 int
 main ()
 {
 extern long ptrace (enum __ptrace_request, ...);
+
   ;
   return 0;
 }
@@ -9467,6 +9468,7 @@ int
 main ()
 {
 extern int ptrace ();
+
   ;
   return 0;
 }
@@ -9505,6 +9507,7 @@ int
 main ()
 {
 extern long ptrace (enum __ptrace_request, ...);
+
   ;
   return 0;
 }
@@ -9523,6 +9526,7 @@ int
 main ()
 {
 extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
+
   ;
   return 0;
 }
@@ -9542,6 +9546,7 @@ int
 main ()
 {
 extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
+
   ;
   return 0;
 }
diff --git a/gdbsupport/configure b/gdbsupport/configure
index e51c7b596883..904403d13f12 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -10017,11 +10017,12 @@ if ${gdb_cv_func_ptrace_ret+:} false; then :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$gdb_ptrace_headers
+ $gdb_ptrace_headers
 int
 main ()
 {
 extern long ptrace (enum __ptrace_request, ...);
+
   ;
   return 0;
 }
@@ -10036,6 +10037,7 @@ int
 main ()
 {
 extern int ptrace ();
+
   ;
   return 0;
 }
@@ -10074,6 +10076,7 @@ int
 main ()
 {
 extern long ptrace (enum __ptrace_request, ...);
+
   ;
   return 0;
 }
@@ -10092,6 +10095,7 @@ int
 main ()
 {
 extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
+
   ;
   return 0;
 }
@@ -10111,6 +10115,7 @@ int
 main ()
 {
 extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
+
   ;
   return 0;
 }
diff --git a/gdbsupport/ptrace.m4 b/gdbsupport/ptrace.m4
index 57ed80260ac0..9f49cf6165bc 100644
--- a/gdbsupport/ptrace.m4
+++ b/gdbsupport/ptrace.m4
@@ -37,13 +37,17 @@ gdb_ptrace_headers='
 AC_CACHE_CHECK(
   [return type of ptrace],
   [gdb_cv_func_ptrace_ret],
-  [AC_TRY_COMPILE(
-     [$gdb_ptrace_headers],
-     [extern long ptrace (enum __ptrace_request, ...);],
-     [gdb_cv_func_ptrace_ret='long'],
-     [AC_TRY_COMPILE(
+  [AC_COMPILE_IFELSE(
+     [AC_LANG_PROGRAM(
 	[$gdb_ptrace_headers],
-	[extern int ptrace ();],
+	[extern long ptrace (enum __ptrace_request, ...);]
+      )],
+     [gdb_cv_func_ptrace_ret='long'],
+     [AC_COMPILE_IFELSE(
+	[AC_LANG_PROGRAM(
+	   [$gdb_ptrace_headers],
+	   [extern int ptrace ();]
+	 )],
 	[gdb_cv_func_ptrace_ret='int'],
 	[gdb_cv_func_ptrace_ret='long']
       )]
@@ -60,25 +64,31 @@ AC_DEFINE_UNQUOTED(
 AC_CACHE_CHECK(
   [types of arguments for ptrace],
   [gdb_cv_func_ptrace_args],
-  [AC_TRY_COMPILE(
-     [$gdb_ptrace_headers],
-     [extern long ptrace (enum __ptrace_request, ...);],
+  [AC_COMPILE_IFELSE(
+     [AC_LANG_PROGRAM(
+	[$gdb_ptrace_headers],
+	[extern long ptrace (enum __ptrace_request, ...);]
+      )],
      [gdb_cv_func_ptrace_args='enum __ptrace_request,int,long,long'],
      [for gdb_arg1 in 'int' 'long'; do
 	for gdb_arg2 in 'pid_t' 'int' 'long'; do
 	  for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
 	    for gdb_arg4 in 'int' 'long' 'void *'; do
-	      AC_TRY_COMPILE(
-		[$gdb_ptrace_headers],
-		[extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);],
+	      AC_COMPILE_IFELSE(
+		[AC_LANG_PROGRAM(
+		   [$gdb_ptrace_headers],
+		   [extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);]
+		 )],
 		[gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4";
 		 break 4;]
 	      )
 
 	      for gdb_arg5 in 'int *' 'int' 'long'; do
-		AC_TRY_COMPILE(
-		  [$gdb_ptrace_headers],
-		  [extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);],
+		AC_COMPILE_IFELSE(
+		  [AC_LANG_PROGRAM(
+		     [$gdb_ptrace_headers],
+		     [extern $gdb_cv_func_ptrace_ret ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);]
+		   )],
 		  [gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
 		   break 5;]
 		)
-- 
2.29.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 09/13] gdbsupport: replace AC_TRY_COMPILE in warning.m4
  2020-10-26  2:14 [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
                   ` (7 preceding siblings ...)
  2020-10-26  2:14 ` [PATCH 08/13] gdbsupport: replace AC_TRY_COMPILE in ptrace.m4 Simon Marchi
@ 2020-10-26  2:14 ` Simon Marchi
  2020-10-26  2:17 ` [PATCH 10/13] gdbsupport: use AC_FUNC_FORK instead of AC_FUNC_VFORK Simon Marchi
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:14 UTC (permalink / raw)
  To: gdb-patches

Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE + AC_LANG_PROGRAM.

All changes in generated configure files are insignificant whitespace
changes.

gdb/ChangeLog:

	* configure: Re-generate.

gdbserver/ChangeLog:

	* configure: Re-generate.

gdbsupport/ChangeLog:

	* configure: Re-generate.
	* warning.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE +
	AC_LANG_PROGRAM.

Change-Id: I517bd20ec3af960ad999a586761df0ac8959a3fc
---
 gdb/configure         |  7 ++++---
 gdbserver/configure   |  7 ++++---
 gdbsupport/configure  |  7 ++++---
 gdbsupport/warning.m4 | 24 ++++++++++++++++--------
 4 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/gdb/configure b/gdb/configure
index 65904baf8045..801e7a152e7b 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -16563,13 +16563,14 @@ $as_echo_n "checking compiler warning flags... " >&6; }
 	      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 struct scoped_restore_base {};
-                 struct scoped_restore_tmpl : public scoped_restore_base {
-		   ~scoped_restore_tmpl() {}
-		 };
+		    struct scoped_restore_tmpl : public scoped_restore_base {
+		      ~scoped_restore_tmpl() {}
+		    };
 int
 main ()
 {
 const scoped_restore_base &b = scoped_restore_tmpl();
+
   ;
   return 0;
 }
diff --git a/gdbserver/configure b/gdbserver/configure
index 3980ae762307..39ec4916df7e 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -9820,13 +9820,14 @@ $as_echo_n "checking compiler warning flags... " >&6; }
 	      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 struct scoped_restore_base {};
-                 struct scoped_restore_tmpl : public scoped_restore_base {
-		   ~scoped_restore_tmpl() {}
-		 };
+		    struct scoped_restore_tmpl : public scoped_restore_base {
+		      ~scoped_restore_tmpl() {}
+		    };
 int
 main ()
 {
 const scoped_restore_base &b = scoped_restore_tmpl();
+
   ;
   return 0;
 }
diff --git a/gdbsupport/configure b/gdbsupport/configure
index 904403d13f12..1452b350ae31 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -10306,13 +10306,14 @@ $as_echo_n "checking compiler warning flags... " >&6; }
 	      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 struct scoped_restore_base {};
-                 struct scoped_restore_tmpl : public scoped_restore_base {
-		   ~scoped_restore_tmpl() {}
-		 };
+		    struct scoped_restore_tmpl : public scoped_restore_base {
+		      ~scoped_restore_tmpl() {}
+		    };
 int
 main ()
 {
 const scoped_restore_base &b = scoped_restore_tmpl();
+
   ;
   return 0;
 }
diff --git a/gdbsupport/warning.m4 b/gdbsupport/warning.m4
index 649be7552dd1..c88d4c65a078 100644
--- a/gdbsupport/warning.m4
+++ b/gdbsupport/warning.m4
@@ -139,15 +139,23 @@ then
 	      # Check for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38958,
 	      # fixed in GCC 4.9.  This test is derived from the gdb
 	      # source code that triggered this bug in GCC.
-	      AC_TRY_COMPILE(
-	        [struct scoped_restore_base {};
-                 struct scoped_restore_tmpl : public scoped_restore_base {
-		   ~scoped_restore_tmpl() {}
-		 };],
-		[const scoped_restore_base &b = scoped_restore_tmpl();],
-		WARN_CFLAGS="${WARN_CFLAGS} $w",)
+	      AC_COMPILE_IFELSE(
+		[AC_LANG_PROGRAM(
+		   [struct scoped_restore_base {};
+		    struct scoped_restore_tmpl : public scoped_restore_base {
+		      ~scoped_restore_tmpl() {}
+		    };],
+		   [const scoped_restore_base &b = scoped_restore_tmpl();]
+		 )],
+		[WARN_CFLAGS="${WARN_CFLAGS} $w"],
+		[]
+	      )
 	    else
-	      AC_TRY_COMPILE([],[],WARN_CFLAGS="${WARN_CFLAGS} $w",)
+	      AC_COMPILE_IFELSE(
+		[AC_LANG_PROGRAM([], [])],
+		[WARN_CFLAGS="${WARN_CFLAGS} $w"],
+		[]
+	      )
 	    fi
 	    CFLAGS="$saved_CFLAGS"
 	    CXXFLAGS="$saved_CXXFLAGS"
-- 
2.29.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 10/13] gdbsupport: use AC_FUNC_FORK instead of AC_FUNC_VFORK
  2020-10-26  2:14 [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
                   ` (8 preceding siblings ...)
  2020-10-26  2:14 ` [PATCH 09/13] gdbsupport: replace AC_TRY_COMPILE in warning.m4 Simon Marchi
@ 2020-10-26  2:17 ` Simon Marchi
  2020-10-26  2:17   ` [PATCH 11/13] gdbsupport: replace AC_TRY_COMPILE in common.m4 Simon Marchi
                     ` (2 more replies)
  2020-10-26  2:22 ` [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
  2020-10-30 17:29 ` Tom Tromey
  11 siblings, 3 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:17 UTC (permalink / raw)
  To: gdb-patches

autoupdate does this change, it fixes this warning:

    configure.ac:50: warning: The macro `AC_FUNC_VFORK' is obsolete.
    configure.ac:50: You should run autoupdate.
    ../../lib/autoconf/functions.m4:1944: AC_FUNC_VFORK is expanded from...
    common.m4:20: GDB_AC_COMMON is expanded from...
    configure.ac:50: the top level

There are not changes in the generated configure files.

gdbsupport/ChangeLog:

	* common.m4: Replace AC_FUNC_VFORK with AC_FUNC_FORK.

Change-Id: I9de9f718c57e6d51c9734161f36c36ce39170325
---
 gdbsupport/common.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4
index 2b5750e81d1f..c265a9b94222 100644
--- a/gdbsupport/common.m4
+++ b/gdbsupport/common.m4
@@ -50,7 +50,7 @@ AC_DEFUN([GDB_AC_COMMON], [
 		   poll.h sys/poll.h sys/select.h)
 
   AC_FUNC_MMAP
-  AC_FUNC_VFORK
+  AC_FUNC_FORK
   AC_CHECK_FUNCS([fdwalk getrlimit pipe pipe2 poll socketpair sigaction \
 		  ptrace64 sbrk setns sigaltstack sigprocmask \
 		  setpgid setpgrp getrusage getauxval])
-- 
2.29.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 11/13] gdbsupport: replace AC_TRY_COMPILE in common.m4
  2020-10-26  2:17 ` [PATCH 10/13] gdbsupport: use AC_FUNC_FORK instead of AC_FUNC_VFORK Simon Marchi
@ 2020-10-26  2:17   ` Simon Marchi
  2020-10-26  2:20     ` Simon Marchi
  2020-10-26  2:17   ` [PATCH 12/13] gdb: replace AC_TRY_LINK in sanitize.m4 Simon Marchi
  2020-10-26  2:17   ` [PATCH 13/13] gdbserver: replace AC_TRY_COMPILE in acinclude.m4 Simon Marchi
  2 siblings, 1 reply; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:17 UTC (permalink / raw)
  To: gdb-patches

... with AC_COMPILE_IFELSE + AC_LANG_PROGRAM.  All the changes in the
generated configure files are insignificant whitespace changes.

gdb/ChangeLog:

	* configure: Re-generate.

gdbserver/ChangeLog:

	* configure: Re-generate.

gdbsupport/ChangeLog:

	* common.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE +
	AC_LANG_PROGRAM.
	* configure: Re-generate.

Change-Id: Id58e6e887f6be817d52b189921845838031dbd2a
---
 gdb/configure        | 11 +++++++----
 gdbserver/configure  | 11 +++++++----
 gdbsupport/common.m4 | 19 ++++++++++++++-----
 gdbsupport/configure | 11 +++++++----
 4 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/gdb/configure b/gdb/configure
index 801e7a152e7b..a08c8c57ae39 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -14232,13 +14232,14 @@ if ${gdb_cv_func_sigsetjmp+:} false; then :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-  #include <setjmp.h>
-
+#include <setjmp.h>
 int
 main ()
 {
-sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
+sigjmp_buf env;
+           while (! sigsetjmp (env, 1))
+             siglongjmp (env, 1);
+
   ;
   return 0;
 }
@@ -14247,8 +14248,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_func_sigsetjmp=yes
 else
   gdb_cv_func_sigsetjmp=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_sigsetjmp" >&5
 $as_echo "$gdb_cv_func_sigsetjmp" >&6; }
diff --git a/gdbserver/configure b/gdbserver/configure
index 39ec4916df7e..bd48d67973d0 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -8029,13 +8029,14 @@ if ${gdb_cv_func_sigsetjmp+:} false; then :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-  #include <setjmp.h>
-
+#include <setjmp.h>
 int
 main ()
 {
-sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
+sigjmp_buf env;
+           while (! sigsetjmp (env, 1))
+             siglongjmp (env, 1);
+
   ;
   return 0;
 }
@@ -8044,8 +8045,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_func_sigsetjmp=yes
 else
   gdb_cv_func_sigsetjmp=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_sigsetjmp" >&5
 $as_echo "$gdb_cv_func_sigsetjmp" >&6; }
diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4
index c265a9b94222..4d7393802734 100644
--- a/gdbsupport/common.m4
+++ b/gdbsupport/common.m4
@@ -127,11 +127,20 @@ AC_DEFUN([GDB_AC_COMMON], [
 
   dnl Check if sigsetjmp is available.  Using AC_CHECK_FUNCS won't
   dnl do since sigsetjmp might only be defined as a macro.
-  AC_CACHE_CHECK([for sigsetjmp], gdb_cv_func_sigsetjmp,
-  [AC_TRY_COMPILE([
-  #include <setjmp.h>
-  ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
-  gdb_cv_func_sigsetjmp=yes, gdb_cv_func_sigsetjmp=no)])
+  AC_CACHE_CHECK(
+    [for sigsetjmp],
+    [gdb_cv_func_sigsetjmp],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [#include <setjmp.h>],
+          [sigjmp_buf env;
+           while (! sigsetjmp (env, 1))
+             siglongjmp (env, 1);]
+        )],
+       [gdb_cv_func_sigsetjmp=yes],
+       [gdb_cv_func_sigsetjmp=no]
+     )]
+  )
   if test "$gdb_cv_func_sigsetjmp" = "yes"; then
     AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
   fi
diff --git a/gdbsupport/configure b/gdbsupport/configure
index 1452b350ae31..9c5e59c5f103 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -9043,13 +9043,14 @@ if ${gdb_cv_func_sigsetjmp+:} false; then :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-  #include <setjmp.h>
-
+#include <setjmp.h>
 int
 main ()
 {
-sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
+sigjmp_buf env;
+           while (! sigsetjmp (env, 1))
+             siglongjmp (env, 1);
+
   ;
   return 0;
 }
@@ -9058,8 +9059,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gdb_cv_func_sigsetjmp=yes
 else
   gdb_cv_func_sigsetjmp=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_sigsetjmp" >&5
 $as_echo "$gdb_cv_func_sigsetjmp" >&6; }
-- 
2.29.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 12/13] gdb: replace AC_TRY_LINK in sanitize.m4
  2020-10-26  2:17 ` [PATCH 10/13] gdbsupport: use AC_FUNC_FORK instead of AC_FUNC_VFORK Simon Marchi
  2020-10-26  2:17   ` [PATCH 11/13] gdbsupport: replace AC_TRY_COMPILE in common.m4 Simon Marchi
@ 2020-10-26  2:17   ` Simon Marchi
  2020-10-26  2:17   ` [PATCH 13/13] gdbserver: replace AC_TRY_COMPILE in acinclude.m4 Simon Marchi
  2 siblings, 0 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:17 UTC (permalink / raw)
  To: gdb-patches

... with AC_LINK_IFELSE + AC_LANG_PROGRAM.

All changes in the generated configure file are insignificant whitespace
changes.

gdb/ChangeLog:

	* configure: Re-generate.
	* sanitize.m4: Replace AC_TRY_LINK with AC_LINK_IFELSE +
	AC_LANG_PROGRAM.

Change-Id: I6fc4c39e10b28d2ade964e0d59a7f8ec0d3a272a
---
 gdb/configure   | 1 +
 gdb/sanitize.m4 | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/configure b/gdb/configure
index a08c8c57ae39..aa89158d06d3 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -16655,6 +16655,7 @@ if ac_fn_cxx_try_link "$LINENO"; then :
   enable_ubsan=yes
 else
   enable_ubsan=no
+
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
diff --git a/gdb/sanitize.m4 b/gdb/sanitize.m4
index 78d00703ca70..87a4f3c9f212 100644
--- a/gdb/sanitize.m4
+++ b/gdb/sanitize.m4
@@ -34,7 +34,11 @@ if test "x$enable_ubsan" = xyes; then
   dnl A link check is required because it is possible to install gcc
   dnl without libubsan, leading to link failures when compiling with
   dnl -fsanitize=undefined.
-  AC_TRY_LINK([],[],enable_ubsan=yes,enable_ubsan=no)
+  AC_LINK_IFELSE(
+    [AC_LANG_PROGRAM([], [])],
+    [enable_ubsan=yes],
+    [enable_ubsan=no]
+  )
   CXXFLAGS="$saved_CXXFLAGS"
   AC_MSG_RESULT($enable_ubsan)
   if test "x$enable_ubsan" = xyes; then
-- 
2.29.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 13/13] gdbserver: replace AC_TRY_COMPILE in acinclude.m4
  2020-10-26  2:17 ` [PATCH 10/13] gdbsupport: use AC_FUNC_FORK instead of AC_FUNC_VFORK Simon Marchi
  2020-10-26  2:17   ` [PATCH 11/13] gdbsupport: replace AC_TRY_COMPILE in common.m4 Simon Marchi
  2020-10-26  2:17   ` [PATCH 12/13] gdb: replace AC_TRY_LINK in sanitize.m4 Simon Marchi
@ 2020-10-26  2:17   ` Simon Marchi
  2 siblings, 0 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:17 UTC (permalink / raw)
  To: gdb-patches

... with AC_COMPILE_IFELSE and AC_LANG_PROGRAM.

All changes in the generated configure file are insignificant
whitespace changes.

gdbserver/ChangeLog:

	* acinclude.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE +
	AC_LANG_PROGRAM.
	* configure: Re-generate.

Change-Id: Idab8b5e1a984046b5283940c02e5a22da2291d58
---
 gdbserver/acinclude.m4 | 32 +++++++++++++++++---------------
 gdbserver/configure    | 20 ++++++++++----------
 2 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/gdbserver/acinclude.m4 b/gdbserver/acinclude.m4
index f02a63cc70c3..e18ee9913a5c 100644
--- a/gdbserver/acinclude.m4
+++ b/gdbserver/acinclude.m4
@@ -42,18 +42,20 @@ m4_include(../config/gettext-sister.m4)
 dnl Check for existence of a type $1 in libthread_db.h
 dnl Based on BFD_HAVE_SYS_PROCFS_TYPE in bfd/bfd.m4.
 
-AC_DEFUN([GDBSERVER_HAVE_THREAD_DB_TYPE],
-[AC_MSG_CHECKING([for $1 in thread_db.h])
- AC_CACHE_VAL(gdbserver_cv_have_thread_db_type_$1,
-   [AC_TRY_COMPILE([
-#include <thread_db.h>],
-      [$1 avar],
-      gdbserver_cv_have_thread_db_type_$1=yes,
-      gdbserver_cv_have_thread_db_type_$1=no
-   )])
- if test $gdbserver_cv_have_thread_db_type_$1 = yes; then
-   AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
-	     [Define if <thread_db.h> has $1.])
- fi
- AC_MSG_RESULT($gdbserver_cv_have_thread_db_type_$1)
-])
+AC_DEFUN(
+  [GDBSERVER_HAVE_THREAD_DB_TYPE],
+  [AC_MSG_CHECKING([for $1 in thread_db.h])
+   AC_CACHE_VAL(
+     [gdbserver_cv_have_thread_db_type_$1],
+     [AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([#include <thread_db.h>], [$1 avar])],
+	[gdbserver_cv_have_thread_db_type_$1=yes],
+	[gdbserver_cv_have_thread_db_type_$1=no]
+      )]
+   )
+   if test $gdbserver_cv_have_thread_db_type_$1 = yes; then
+     AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
+	       [Define if <thread_db.h> has $1.])
+   fi
+   AC_MSG_RESULT($gdbserver_cv_have_thread_db_type_$1)]
+)
diff --git a/gdbserver/configure b/gdbserver/configure
index bd48d67973d0..0db0ad3f4fbd 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -10386,12 +10386,11 @@ fi
 if test "$bfd_cv_have_sys_procfs_type_lwpid_t" != yes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpid_t in thread_db.h" >&5
 $as_echo_n "checking for lwpid_t in thread_db.h... " >&6; }
- if ${gdbserver_cv_have_thread_db_type_lwpid_t+:} false; then :
+   if ${gdbserver_cv_have_thread_db_type_lwpid_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
 #include <thread_db.h>
 int
 main ()
@@ -10408,14 +10407,15 @@ else
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 
- if test $gdbserver_cv_have_thread_db_type_lwpid_t = yes; then
+   if test $gdbserver_cv_have_thread_db_type_lwpid_t = yes; then
 
 $as_echo "#define HAVE_LWPID_T 1" >>confdefs.h
 
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdbserver_cv_have_thread_db_type_lwpid_t" >&5
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdbserver_cv_have_thread_db_type_lwpid_t" >&5
 $as_echo "$gdbserver_cv_have_thread_db_type_lwpid_t" >&6; }
 
 fi
@@ -10423,12 +10423,11 @@ fi
 if test "$bfd_cv_have_sys_procfs_type_psaddr_t" != yes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psaddr_t in thread_db.h" >&5
 $as_echo_n "checking for psaddr_t in thread_db.h... " >&6; }
- if ${gdbserver_cv_have_thread_db_type_psaddr_t+:} false; then :
+   if ${gdbserver_cv_have_thread_db_type_psaddr_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
 #include <thread_db.h>
 int
 main ()
@@ -10445,14 +10444,15 @@ else
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 
- if test $gdbserver_cv_have_thread_db_type_psaddr_t = yes; then
+   if test $gdbserver_cv_have_thread_db_type_psaddr_t = yes; then
 
 $as_echo "#define HAVE_PSADDR_T 1" >>confdefs.h
 
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdbserver_cv_have_thread_db_type_psaddr_t" >&5
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdbserver_cv_have_thread_db_type_psaddr_t" >&5
 $as_echo "$gdbserver_cv_have_thread_db_type_psaddr_t" >&6; }
 
 fi
-- 
2.29.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 11/13] gdbsupport: replace AC_TRY_COMPILE in common.m4
  2020-10-26  2:17   ` [PATCH 11/13] gdbsupport: replace AC_TRY_COMPILE in common.m4 Simon Marchi
@ 2020-10-26  2:20     ` Simon Marchi
  0 siblings, 0 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:20 UTC (permalink / raw)
  To: gdb-patches

On 2020-10-25 10:17 p.m., Simon Marchi wrote:
> ... with AC_COMPILE_IFELSE + AC_LANG_PROGRAM.  All the changes in the
> generated configure files are insignificant whitespace changes.
>
> gdb/ChangeLog:
>
> 	* configure: Re-generate.
>
> gdbserver/ChangeLog:
>
> 	* configure: Re-generate.
>
> gdbsupport/ChangeLog:
>
> 	* common.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE +
> 	AC_LANG_PROGRAM.
> 	* configure: Re-generate.
>
> Change-Id: Id58e6e887f6be817d52b189921845838031dbd2a

Damn, I had to send the messages in two batches and I managed to mess up
the threading, sorry about that.

Simon


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files
  2020-10-26  2:14 [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
                   ` (9 preceding siblings ...)
  2020-10-26  2:17 ` [PATCH 10/13] gdbsupport: use AC_FUNC_FORK instead of AC_FUNC_VFORK Simon Marchi
@ 2020-10-26  2:22 ` Simon Marchi
  2020-10-30 17:29 ` Tom Tromey
  11 siblings, 0 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-26  2:22 UTC (permalink / raw)
  To: gdb-patches

On 2020-10-25 10:14 p.m., Simon Marchi wrote:
> I'd like to give a shot at autoconf 2.69c (the preview version of the
> upcoming 2.70 version) to make sure that if we hit some problems, we can
> report them before the final release is out.
>
> Before doing so, I'd like to make `autoreconf -vf -Wall` clean, to make
> sure we use what's recommended today.  This first patch series changes
> things in gdb, gdbserver and gdbsupport to remove some warnings.  The
> remaining warnings need changes outside these directories, and will need
> to be sent to binutils and maybe gcc, so I'll do them later.

I pushed this series on the users/simark/autoconf-warnings branch on
Sourceware.

Simon

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files
  2020-10-26  2:14 [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
                   ` (10 preceding siblings ...)
  2020-10-26  2:22 ` [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
@ 2020-10-30 17:29 ` Tom Tromey
  2020-10-31 12:32   ` Simon Marchi
  11 siblings, 1 reply; 18+ messages in thread
From: Tom Tromey @ 2020-10-30 17:29 UTC (permalink / raw)
  To: Simon Marchi via Gdb-patches

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> Before doing so, I'd like to make `autoreconf -vf -Wall` clean, to make
Simon> sure we use what's recommended today.  This first patch series changes
Simon> things in gdb, gdbserver and gdbsupport to remove some warnings.  The
Simon> remaining warnings need changes outside these directories, and will need
Simon> to be sent to binutils and maybe gcc, so I'll do them later.

This all looks fine to me.  Thanks for doing this.

Tom

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files
  2020-10-30 17:29 ` Tom Tromey
@ 2020-10-31 12:32   ` Simon Marchi
  0 siblings, 0 replies; 18+ messages in thread
From: Simon Marchi @ 2020-10-31 12:32 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi via Gdb-patches

On 2020-10-30 1:29 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon> Before doing so, I'd like to make `autoreconf -vf -Wall` clean, to make
> Simon> sure we use what's recommended today.  This first patch series changes
> Simon> things in gdb, gdbserver and gdbsupport to remove some warnings.  The
> Simon> remaining warnings need changes outside these directories, and will need
> Simon> to be sent to binutils and maybe gcc, so I'll do them later.
> 
> This all looks fine to me.  Thanks for doing this.
> 
> Tom
> 

Thanks, I pushed it.

Simon

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-10-31 12:33 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26  2:14 [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
2020-10-26  2:14 ` [PATCH 01/13] gdb, gdbserver, gdbsupport: use AC_CANONICAL_{BUILD, HOST, TARGET} instead of AC_CANONICAL_SYSTEM Simon Marchi
2020-10-26  2:14 ` [PATCH 02/13] gdb: use AC_PROG_CC_STDC instead of AM_PROG_CC_STDC Simon Marchi
2020-10-26  2:14 ` [PATCH 03/13] gdbserver: modernize configure.ac Simon Marchi
2020-10-26  2:14 ` [PATCH 04/13] gdb: " Simon Marchi
2020-10-26  2:14 ` [PATCH 05/13] gdb/testsuite: " Simon Marchi
2020-10-26  2:14 ` [PATCH 06/13] gdb: modernize acinclude.m4 Simon Marchi
2020-10-26  2:14 ` [PATCH 07/13] gdbsupport: re-indent ptrace.m4 Simon Marchi
2020-10-26  2:14 ` [PATCH 08/13] gdbsupport: replace AC_TRY_COMPILE in ptrace.m4 Simon Marchi
2020-10-26  2:14 ` [PATCH 09/13] gdbsupport: replace AC_TRY_COMPILE in warning.m4 Simon Marchi
2020-10-26  2:17 ` [PATCH 10/13] gdbsupport: use AC_FUNC_FORK instead of AC_FUNC_VFORK Simon Marchi
2020-10-26  2:17   ` [PATCH 11/13] gdbsupport: replace AC_TRY_COMPILE in common.m4 Simon Marchi
2020-10-26  2:20     ` Simon Marchi
2020-10-26  2:17   ` [PATCH 12/13] gdb: replace AC_TRY_LINK in sanitize.m4 Simon Marchi
2020-10-26  2:17   ` [PATCH 13/13] gdbserver: replace AC_TRY_COMPILE in acinclude.m4 Simon Marchi
2020-10-26  2:22 ` [PATCH 00/13] Modernize gdb/gdbserver/gdbsupport configure files Simon Marchi
2020-10-30 17:29 ` Tom Tromey
2020-10-31 12:32   ` Simon Marchi

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