From: Simon Marchi Date: Sat, 31 Oct 2020 12:30:58 +0000 (-0400) Subject: gdb: modernize acinclude.m4 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=294f26974867eca61ae6f98ede40ee20b6b3683b;p=binutils-gdb.git gdb: modernize acinclude.m4 Run autoupdate, fix indentation for readability. gdb/ChangeLog: * acinclude.m4: Modernize. * configure: Re-generate. Change-Id: I8949f885326a3206f414776b63a1fdba197bb19a --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ba47a12ddfc..b6071bf8cac 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-10-31 Simon Marchi + + * acinclude.m4: Modernize. + * configure: Re-generate. + 2020-10-31 Simon Marchi * configure.ac: Modernize. diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4 index a557d6bc866..64574e26314 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 - #include "bfd.h" - #include "$4" - ], - [return $3;], [[$2]=yes], [[$2]=no])]) + AC_CACHE_CHECK( + [$1], + [$2], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include + #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 5678deac68c..ec36cc19093 100755 --- a/gdb/configure +++ b/gdb/configure @@ -16734,13 +16734,13 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #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 - #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; }