[PATCH 06/13] gdb: modernize acinclude.m4
Simon Marchi
simon.marchi@polymtl.ca
Mon Oct 26 02:14:40 GMT 2020
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
More information about the Gdb-patches
mailing list