public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE
@ 2021-02-16 11:59 Naohiro Tamura
  2021-02-16 13:03 ` Andreas Schwab
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Naohiro Tamura @ 2021-02-16 11:59 UTC (permalink / raw)
  To: libc-alpha

This patch replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE.
It has been confirmed that GNU 'autoconf' 2.69 doesn't change any
'configure' files and suppressed obsolete warnings.
---
 configure.ac                                 | 16 ++++++++--------
 sysdeps/ieee754/ldbl-opt/configure.ac        |  8 ++++----
 sysdeps/mach/configure.ac                    |  8 ++++----
 sysdeps/mach/hurd/configure.ac               | 10 +++++-----
 sysdeps/s390/configure.ac                    |  4 ++--
 sysdeps/unix/sysv/linux/configure.ac         |  8 ++++----
 sysdeps/unix/sysv/linux/powerpc/configure    |  2 +-
 sysdeps/unix/sysv/linux/powerpc/configure.ac |  8 ++++----
 8 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/configure.ac b/configure.ac
index dfebb8a7cc..d8ccb6c119 100644
--- a/configure.ac
+++ b/configure.ac
@@ -466,10 +466,10 @@ AC_ARG_ENABLE([mathvec],
 	      [build_mathvec=$enableval],
 	      [build_mathvec=notset])
 
-AC_TRY_COMPILE([], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifndef __CET__
 # error no CET compiler support
-#endif],
+#endif]])],
 	       [libc_cv_compiler_default_cet=yes],
 	       [libc_cv_compiler_default_cet=no])
 
@@ -1018,10 +1018,10 @@ AC_CHECK_PROG_VER(BISON, bison, --version,
   [2.7*|[3-9].*|[1-9][0-9]*], critic_missing="$critic_missing bison")
 
 AC_CACHE_CHECK([if $CC is sufficient to build libc], libc_cv_compiler_ok, [
-AC_TRY_COMPILE([], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)
 #error insufficient compiler
-#endif],
+#endif]])],
 	       [libc_cv_compiler_ok=yes],
 	       [libc_cv_compiler_ok=no])])
 AS_IF([test $libc_cv_compiler_ok != yes],
@@ -1628,10 +1628,10 @@ dnl Check for silly hacked compilers predefining _FORTIFY_SOURCE.
 dnl Since we are building the implementations of the fortified functions here,
 dnl having the macro defined interacts very badly.
 AC_CACHE_CHECK([for _FORTIFY_SOURCE predefine], libc_cv_predef_fortify_source,
-[AC_TRY_COMPILE([], [
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifdef _FORTIFY_SOURCE
 # error bogon
-#endif],
+#endif]])],
 		[libc_cv_predef_fortify_source=no],
 		[libc_cv_predef_fortify_source=yes])])
 if test $libc_cv_predef_fortify_source = yes; then
@@ -1676,7 +1676,7 @@ fi
 AC_CACHE_CHECK(for __builtin_trap with no external dependencies,
 	       libc_cv_builtin_trap, [dnl
 libc_cv_builtin_trap=no
-AC_TRY_COMPILE([], [__builtin_trap ()], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[__builtin_trap ()]])],[
 libc_undefs=`$NM -u conftest.o |
   LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
     2>&AS_MESSAGE_LOG_FD` || {
@@ -1685,7 +1685,7 @@ libc_undefs=`$NM -u conftest.o |
 echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
 if test -z "$libc_undefs"; then
   libc_cv_builtin_trap=yes
-fi])])
+fi],[])])
 if test $libc_cv_builtin_trap = yes; then
   AC_DEFINE([HAVE_BUILTIN_TRAP])
 fi
diff --git a/sysdeps/ieee754/ldbl-opt/configure.ac b/sysdeps/ieee754/ldbl-opt/configure.ac
index a77fadd1c4..70e3b32dc6 100644
--- a/sysdeps/ieee754/ldbl-opt/configure.ac
+++ b/sysdeps/ieee754/ldbl-opt/configure.ac
@@ -6,13 +6,13 @@ AC_CACHE_CHECK(whether $CC $CFLAGS supports -mlong-double-128,
 	       libc_cv_mlong_double_128, [dnl
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -mlong-double-128"
-AC_TRY_COMPILE(, [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifndef __LONG_DOUBLE_128__
 # error "compiler did not predefine __LONG_DOUBLE_128__ as expected"
 #endif
-long double foobar (long double x) { return x; }],
-	       libc_cv_mlong_double_128=yes,
-	       libc_cv_mlong_double_128=no)
+long double foobar (long double x) { return x; }]])],
+	       [libc_cv_mlong_double_128=yes],
+	       [libc_cv_mlong_double_128=no])
 CFLAGS="$save_CFLAGS"])
 if test "$libc_cv_mlong_double_128" = no; then
   AC_MSG_ERROR([this configuration requires -mlong-double-128 support])
diff --git a/sysdeps/mach/configure.ac b/sysdeps/mach/configure.ac
index cadecae884..61b00d66b1 100644
--- a/sysdeps/mach/configure.ac
+++ b/sysdeps/mach/configure.ac
@@ -25,8 +25,8 @@ dnl If not, compile with -Dfoo_t=bar_t.
 dnl
 AC_DEFUN([mach_TYPE_CHECK], [dnl
 AC_CACHE_CHECK(for $1 in mach/mach_types.h, libc_cv_mach_$1,
-AC_TRY_COMPILE([#include <mach/mach_types.h>], [extern $1 foo;],
-libc_cv_mach_$1=$1, libc_cv_mach_$1=$2))
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/mach_types.h>]], [[extern $1 foo;]])],
+[libc_cv_mach_$1=$1], [libc_cv_mach_$1=$2]))
 if test [$]libc_cv_mach_$1 != $1; then
   DEFINES="$DEFINES -D$1=$2"
 fi])
@@ -42,10 +42,10 @@ dnl The creation_time field is a GNU Mach addition the other variants lack.
 dnl
 AC_CACHE_CHECK(for creation_time in task_basic_info,
 	       libc_cv_mach_task_creation_time, [dnl
-AC_TRY_COMPILE([#include <mach/task_info.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/task_info.h>]], [[
 extern struct task_basic_info *i;
 long s = i->creation_time.seconds;
-], libc_cv_mach_task_creation_time=yes, libc_cv_mach_task_creation_time=no)])
+]])], [libc_cv_mach_task_creation_time=yes], [libc_cv_mach_task_creation_time=no])])
 if test $libc_cv_mach_task_creation_time = no; then
   AC_MSG_ERROR([you need Mach headers supporting task_info.creation_time])
 fi
diff --git a/sysdeps/mach/hurd/configure.ac b/sysdeps/mach/hurd/configure.ac
index eab0e5b6c1..eb80210711 100644
--- a/sysdeps/mach/hurd/configure.ac
+++ b/sysdeps/mach/hurd/configure.ac
@@ -11,14 +11,14 @@ if test -n "$sysheaders"; then
 fi
 
 AC_CACHE_CHECK(Hurd header version, libc_cv_hurd_version, [dnl
-AC_TRY_COMPILE(dnl
-[#include <hurd/version.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(dnl
+[[#include <hurd/version.h>]], [[
 #define NEED_VERSION 20020609
 #if HURD_INTERFACE_VERSION < NEED_VERSION
 # error Hurd version too old: HURD_INTERFACE_VERSION < NEED_VERSION
-#endif],
-	       libc_cv_hurd_version=ok,
-	       libc_cv_hurd_version=bad)])
+#endif]])],
+	       [libc_cv_hurd_version=ok],
+	       [libc_cv_hurd_version=bad])])
 if test "x$libc_cv_hurd_version" != xok; then
   AC_MSG_ERROR(Hurd headers not installed or too old)
 fi
diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac
index dfe007a774..e502d34882 100644
--- a/sysdeps/s390/configure.ac
+++ b/sysdeps/s390/configure.ac
@@ -218,11 +218,11 @@ dnl overflow
 dnl (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269)
 AC_CACHE_CHECK([if $CC is sufficient to build libc on s390x],
 libc_cv_compiler_ok_on_s390x, [
-AC_TRY_COMPILE([], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #if !defined __GNUC__ || __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 1)
 #error insufficient compiler for building on s390x
 #endif
-],
+]])],
 	[libc_cv_compiler_ok_on_s390x=yes],
 	[libc_cv_compiler_ok_on_s390x=no])])
 if test "$libc_cv_compiler_ok_on_s390x" != yes; then
diff --git a/sysdeps/unix/sysv/linux/configure.ac b/sysdeps/unix/sysv/linux/configure.ac
index 13abda0a51..e1fffbf374 100644
--- a/sysdeps/unix/sysv/linux/configure.ac
+++ b/sysdeps/unix/sysv/linux/configure.ac
@@ -8,12 +8,12 @@ if test -n "$sysheaders"; then
 fi
 define([libc_cv_linuxVER], [libc_cv_linux]patsubst(LIBC_LINUX_VERSION,[\.]))dnl
 AC_CACHE_CHECK(installed Linux kernel header files, libc_cv_linuxVER, [dnl
-AC_TRY_COMPILE([#include <linux/version.h>
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <linux/version.h>
 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < ]dnl
 patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
 [ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
 # error kernel headers missing or too old
-#endif], [],
+#endif]], [[]])],
 	       [libc_cv_linuxVER='LIBC_LINUX_VERSION or later'],
 	       [libc_cv_linuxVER='missing or too old!'])])
 if test "$libc_cv_linuxVER" != 'LIBC_LINUX_VERSION or later'; then
@@ -52,10 +52,10 @@ changequote(,)dnl
 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
 changequote([,])dnl
-AC_TRY_COMPILE([#include <linux/version.h>
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <linux/version.h>
 #if LINUX_VERSION_CODE < $decnum
 # error kernel headers too old
-#endif], [], [libc_minimum_kernel=ok], [libc_minimum_kernel='too old!'])
+#endif]], [[]])], [libc_minimum_kernel=ok], [libc_minimum_kernel='too old!'])
 AC_MSG_RESULT($libc_minimum_kernel)
 if test "$libc_minimum_kernel" = ok; then
   AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
index 6f883de396..69423b6f70 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/configure
@@ -11,7 +11,7 @@ else
 CFLAGS="$CFLAGS -mlong-double-128"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <float.h>
+#include <float.h>[]
 int
 main ()
 {
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index b8e5f9ac32..1ced436dcc 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -6,11 +6,11 @@ AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
 	       libc_cv_mlong_double_128ibm, [dnl
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -mlong-double-128"
-AC_TRY_COMPILE([#include <float.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <float.h>[]], [[
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }],
+long double foobar (long double x) { return x; }]])],
 	       libc_cv_mlong_double_128ibm=yes,
 	       libc_cv_mlong_double_128ibm=no)
 CFLAGS="$save_CFLAGS"])
@@ -20,11 +20,11 @@ if test "$libc_cv_mlong_double_128ibm" = no; then
 		 libc_cv_mabi_ibmlongdouble, [dnl
   save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_TRY_COMPILE([#include <float.h>], [
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }],
+long double foobar (long double x) { return x; }]])],
 		 libc_cv_mabi_ibmlongdouble=yes,
 		 libc_cv_mabi_ibmlongdouble=no)
   CFLAGS="$save_CFLAGS"])
-- 
2.17.1


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

* Re: [PATCH 1/3] Replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE
  2021-02-16 11:59 [PATCH 1/3] Replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE Naohiro Tamura
@ 2021-02-16 13:03 ` Andreas Schwab
  2021-02-16 16:38 ` Zack Weinberg
  2021-02-17  1:17 ` [PATCH v2 " Naohiro Tamura
  2 siblings, 0 replies; 19+ messages in thread
From: Andreas Schwab @ 2021-02-16 13:03 UTC (permalink / raw)
  To: Naohiro Tamura; +Cc: libc-alpha

On Feb 16 2021, Naohiro Tamura wrote:

> diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
> index 6f883de396..69423b6f70 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/configure
> +++ b/sysdeps/unix/sysv/linux/powerpc/configure
> @@ -11,7 +11,7 @@ else
>  CFLAGS="$CFLAGS -mlong-double-128"
>  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
>  /* end confdefs.h.  */
> -#include <float.h>
> +#include <float.h>[]
>  int
>  main ()
>  {

That's a syntax error.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH 1/3] Replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE
  2021-02-16 11:59 [PATCH 1/3] Replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE Naohiro Tamura
  2021-02-16 13:03 ` Andreas Schwab
@ 2021-02-16 16:38 ` Zack Weinberg
  2021-02-17  1:05   ` naohirot
  2021-02-17  1:17 ` [PATCH v2 " Naohiro Tamura
  2 siblings, 1 reply; 19+ messages in thread
From: Zack Weinberg @ 2021-02-16 16:38 UTC (permalink / raw)
  To: Naohiro Tamura; +Cc: GNU C Library

On Tue, Feb 16, 2021 at 7:00 AM Naohiro Tamura <naohirot@fujitsu.com> wrote:
> This patch replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE.
> It has been confirmed that GNU 'autoconf' 2.69 doesn't change any
> 'configure' files and suppressed obsolete warnings.

Thanks for doing this work.

> +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
>  #ifndef __CET__
>  # error no CET compiler support
> -#endif],
> +#endif]])],

This, and any other check where the code is entirely preprocessor
directives, should be changed to AC_PREPROC_IFELSE for efficiency.

> -AC_TRY_COMPILE([#include <float.h>], [
> +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <float.h>[]], [[

Typo here: it should be

> +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[

I believe this is the root cause of the problem Andreas pointed out.

I did not proofread the entire patch.

zw

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

* RE: [PATCH 1/3] Replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE
  2021-02-16 16:38 ` Zack Weinberg
@ 2021-02-17  1:05   ` naohirot
  0 siblings, 0 replies; 19+ messages in thread
From: naohirot @ 2021-02-17  1:05 UTC (permalink / raw)
  To: 'Zack Weinberg', 'Andreas Schwab'; +Cc: GNU C Library

Andreas-san, Zack-san,

Thank you for the review.

> -----Original Message-----
> From: Zack Weinberg <zackw@panix.com>
> Sent: Wednesday, February 17, 2021 1:39 AM
> To: Tamura, Naohiro/田村 直広 <naohirot@fujitsu.com>
> Cc: GNU C Library <libc-alpha@sourceware.org>
> Subject: Re: [PATCH 1/3] Replaced obsolete AC_TRY_COMPILE to
> AC_COMPILE_IFELSE
> 
> On Tue, Feb 16, 2021 at 7:00 AM Naohiro Tamura <naohirot@fujitsu.com> wrote:
> > This patch replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE.
> > It has been confirmed that GNU 'autoconf' 2.69 doesn't change any
> > 'configure' files and suppressed obsolete warnings.
> 
> Thanks for doing this work.
> 
> > +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
> >  #ifndef __CET__
> >  # error no CET compiler support
> > -#endif],
> > +#endif]])],
> 
> This, and any other check where the code is entirely preprocessor directives,
> should be changed to AC_PREPROC_IFELSE for efficiency.
> 
> > -AC_TRY_COMPILE([#include <float.h>], [
> > +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <float.h>[]], [[
> 
> Typo here: it should be

I'll fix that.
Thanks!

> 
> > +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
> 
> I believe this is the root cause of the problem Andreas pointed out.
> 
> I did not proofread the entire patch.
> 
> zw

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

* [PATCH v2 1/3] Replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE
  2021-02-16 11:59 [PATCH 1/3] Replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE Naohiro Tamura
  2021-02-16 13:03 ` Andreas Schwab
  2021-02-16 16:38 ` Zack Weinberg
@ 2021-02-17  1:17 ` Naohiro Tamura
  2021-05-10 14:07   ` [PATCH v3] configure: Replaced obsolete AC_TRY_COMPILE Naohiro Tamura
  2 siblings, 1 reply; 19+ messages in thread
From: Naohiro Tamura @ 2021-02-17  1:17 UTC (permalink / raw)
  To: libc-alpha

This patch replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE.
It has been confirmed that GNU 'autoconf' 2.69 doesn't change any
'configure' files and suppressed obsolete warnings.
---
 configure.ac                                 | 16 ++++++++--------
 sysdeps/ieee754/ldbl-opt/configure.ac        |  8 ++++----
 sysdeps/mach/configure.ac                    |  8 ++++----
 sysdeps/mach/hurd/configure.ac               | 10 +++++-----
 sysdeps/s390/configure.ac                    |  4 ++--
 sysdeps/unix/sysv/linux/configure.ac         |  8 ++++----
 sysdeps/unix/sysv/linux/powerpc/configure.ac |  8 ++++----
 7 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/configure.ac b/configure.ac
index dfebb8a7cc..d8ccb6c119 100644
--- a/configure.ac
+++ b/configure.ac
@@ -466,10 +466,10 @@ AC_ARG_ENABLE([mathvec],
 	      [build_mathvec=$enableval],
 	      [build_mathvec=notset])
 
-AC_TRY_COMPILE([], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifndef __CET__
 # error no CET compiler support
-#endif],
+#endif]])],
 	       [libc_cv_compiler_default_cet=yes],
 	       [libc_cv_compiler_default_cet=no])
 
@@ -1018,10 +1018,10 @@ AC_CHECK_PROG_VER(BISON, bison, --version,
   [2.7*|[3-9].*|[1-9][0-9]*], critic_missing="$critic_missing bison")
 
 AC_CACHE_CHECK([if $CC is sufficient to build libc], libc_cv_compiler_ok, [
-AC_TRY_COMPILE([], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)
 #error insufficient compiler
-#endif],
+#endif]])],
 	       [libc_cv_compiler_ok=yes],
 	       [libc_cv_compiler_ok=no])])
 AS_IF([test $libc_cv_compiler_ok != yes],
@@ -1628,10 +1628,10 @@ dnl Check for silly hacked compilers predefining _FORTIFY_SOURCE.
 dnl Since we are building the implementations of the fortified functions here,
 dnl having the macro defined interacts very badly.
 AC_CACHE_CHECK([for _FORTIFY_SOURCE predefine], libc_cv_predef_fortify_source,
-[AC_TRY_COMPILE([], [
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifdef _FORTIFY_SOURCE
 # error bogon
-#endif],
+#endif]])],
 		[libc_cv_predef_fortify_source=no],
 		[libc_cv_predef_fortify_source=yes])])
 if test $libc_cv_predef_fortify_source = yes; then
@@ -1676,7 +1676,7 @@ fi
 AC_CACHE_CHECK(for __builtin_trap with no external dependencies,
 	       libc_cv_builtin_trap, [dnl
 libc_cv_builtin_trap=no
-AC_TRY_COMPILE([], [__builtin_trap ()], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[__builtin_trap ()]])],[
 libc_undefs=`$NM -u conftest.o |
   LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
     2>&AS_MESSAGE_LOG_FD` || {
@@ -1685,7 +1685,7 @@ libc_undefs=`$NM -u conftest.o |
 echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
 if test -z "$libc_undefs"; then
   libc_cv_builtin_trap=yes
-fi])])
+fi],[])])
 if test $libc_cv_builtin_trap = yes; then
   AC_DEFINE([HAVE_BUILTIN_TRAP])
 fi
diff --git a/sysdeps/ieee754/ldbl-opt/configure.ac b/sysdeps/ieee754/ldbl-opt/configure.ac
index a77fadd1c4..70e3b32dc6 100644
--- a/sysdeps/ieee754/ldbl-opt/configure.ac
+++ b/sysdeps/ieee754/ldbl-opt/configure.ac
@@ -6,13 +6,13 @@ AC_CACHE_CHECK(whether $CC $CFLAGS supports -mlong-double-128,
 	       libc_cv_mlong_double_128, [dnl
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -mlong-double-128"
-AC_TRY_COMPILE(, [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifndef __LONG_DOUBLE_128__
 # error "compiler did not predefine __LONG_DOUBLE_128__ as expected"
 #endif
-long double foobar (long double x) { return x; }],
-	       libc_cv_mlong_double_128=yes,
-	       libc_cv_mlong_double_128=no)
+long double foobar (long double x) { return x; }]])],
+	       [libc_cv_mlong_double_128=yes],
+	       [libc_cv_mlong_double_128=no])
 CFLAGS="$save_CFLAGS"])
 if test "$libc_cv_mlong_double_128" = no; then
   AC_MSG_ERROR([this configuration requires -mlong-double-128 support])
diff --git a/sysdeps/mach/configure.ac b/sysdeps/mach/configure.ac
index cadecae884..61b00d66b1 100644
--- a/sysdeps/mach/configure.ac
+++ b/sysdeps/mach/configure.ac
@@ -25,8 +25,8 @@ dnl If not, compile with -Dfoo_t=bar_t.
 dnl
 AC_DEFUN([mach_TYPE_CHECK], [dnl
 AC_CACHE_CHECK(for $1 in mach/mach_types.h, libc_cv_mach_$1,
-AC_TRY_COMPILE([#include <mach/mach_types.h>], [extern $1 foo;],
-libc_cv_mach_$1=$1, libc_cv_mach_$1=$2))
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/mach_types.h>]], [[extern $1 foo;]])],
+[libc_cv_mach_$1=$1], [libc_cv_mach_$1=$2]))
 if test [$]libc_cv_mach_$1 != $1; then
   DEFINES="$DEFINES -D$1=$2"
 fi])
@@ -42,10 +42,10 @@ dnl The creation_time field is a GNU Mach addition the other variants lack.
 dnl
 AC_CACHE_CHECK(for creation_time in task_basic_info,
 	       libc_cv_mach_task_creation_time, [dnl
-AC_TRY_COMPILE([#include <mach/task_info.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/task_info.h>]], [[
 extern struct task_basic_info *i;
 long s = i->creation_time.seconds;
-], libc_cv_mach_task_creation_time=yes, libc_cv_mach_task_creation_time=no)])
+]])], [libc_cv_mach_task_creation_time=yes], [libc_cv_mach_task_creation_time=no])])
 if test $libc_cv_mach_task_creation_time = no; then
   AC_MSG_ERROR([you need Mach headers supporting task_info.creation_time])
 fi
diff --git a/sysdeps/mach/hurd/configure.ac b/sysdeps/mach/hurd/configure.ac
index eab0e5b6c1..eb80210711 100644
--- a/sysdeps/mach/hurd/configure.ac
+++ b/sysdeps/mach/hurd/configure.ac
@@ -11,14 +11,14 @@ if test -n "$sysheaders"; then
 fi
 
 AC_CACHE_CHECK(Hurd header version, libc_cv_hurd_version, [dnl
-AC_TRY_COMPILE(dnl
-[#include <hurd/version.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(dnl
+[[#include <hurd/version.h>]], [[
 #define NEED_VERSION 20020609
 #if HURD_INTERFACE_VERSION < NEED_VERSION
 # error Hurd version too old: HURD_INTERFACE_VERSION < NEED_VERSION
-#endif],
-	       libc_cv_hurd_version=ok,
-	       libc_cv_hurd_version=bad)])
+#endif]])],
+	       [libc_cv_hurd_version=ok],
+	       [libc_cv_hurd_version=bad])])
 if test "x$libc_cv_hurd_version" != xok; then
   AC_MSG_ERROR(Hurd headers not installed or too old)
 fi
diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac
index dfe007a774..e502d34882 100644
--- a/sysdeps/s390/configure.ac
+++ b/sysdeps/s390/configure.ac
@@ -218,11 +218,11 @@ dnl overflow
 dnl (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269)
 AC_CACHE_CHECK([if $CC is sufficient to build libc on s390x],
 libc_cv_compiler_ok_on_s390x, [
-AC_TRY_COMPILE([], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #if !defined __GNUC__ || __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 1)
 #error insufficient compiler for building on s390x
 #endif
-],
+]])],
 	[libc_cv_compiler_ok_on_s390x=yes],
 	[libc_cv_compiler_ok_on_s390x=no])])
 if test "$libc_cv_compiler_ok_on_s390x" != yes; then
diff --git a/sysdeps/unix/sysv/linux/configure.ac b/sysdeps/unix/sysv/linux/configure.ac
index 13abda0a51..e1fffbf374 100644
--- a/sysdeps/unix/sysv/linux/configure.ac
+++ b/sysdeps/unix/sysv/linux/configure.ac
@@ -8,12 +8,12 @@ if test -n "$sysheaders"; then
 fi
 define([libc_cv_linuxVER], [libc_cv_linux]patsubst(LIBC_LINUX_VERSION,[\.]))dnl
 AC_CACHE_CHECK(installed Linux kernel header files, libc_cv_linuxVER, [dnl
-AC_TRY_COMPILE([#include <linux/version.h>
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <linux/version.h>
 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < ]dnl
 patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
 [ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
 # error kernel headers missing or too old
-#endif], [],
+#endif]], [[]])],
 	       [libc_cv_linuxVER='LIBC_LINUX_VERSION or later'],
 	       [libc_cv_linuxVER='missing or too old!'])])
 if test "$libc_cv_linuxVER" != 'LIBC_LINUX_VERSION or later'; then
@@ -52,10 +52,10 @@ changequote(,)dnl
 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
 changequote([,])dnl
-AC_TRY_COMPILE([#include <linux/version.h>
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <linux/version.h>
 #if LINUX_VERSION_CODE < $decnum
 # error kernel headers too old
-#endif], [], [libc_minimum_kernel=ok], [libc_minimum_kernel='too old!'])
+#endif]], [[]])], [libc_minimum_kernel=ok], [libc_minimum_kernel='too old!'])
 AC_MSG_RESULT($libc_minimum_kernel)
 if test "$libc_minimum_kernel" = ok; then
   AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index b8e5f9ac32..598e44ab71 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -6,11 +6,11 @@ AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
 	       libc_cv_mlong_double_128ibm, [dnl
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -mlong-double-128"
-AC_TRY_COMPILE([#include <float.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }],
+long double foobar (long double x) { return x; }]])],
 	       libc_cv_mlong_double_128ibm=yes,
 	       libc_cv_mlong_double_128ibm=no)
 CFLAGS="$save_CFLAGS"])
@@ -20,11 +20,11 @@ if test "$libc_cv_mlong_double_128ibm" = no; then
 		 libc_cv_mabi_ibmlongdouble, [dnl
   save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_TRY_COMPILE([#include <float.h>], [
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }],
+long double foobar (long double x) { return x; }]])],
 		 libc_cv_mabi_ibmlongdouble=yes,
 		 libc_cv_mabi_ibmlongdouble=no)
   CFLAGS="$save_CFLAGS"])
-- 
2.17.1


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

* [PATCH v3] configure: Replaced obsolete AC_TRY_COMPILE
  2021-02-17  1:17 ` [PATCH v2 " Naohiro Tamura
@ 2021-05-10 14:07   ` Naohiro Tamura
  2021-05-10 17:40     ` Joseph Myers
  2021-05-11  1:34     ` [PATCH v4] " Naohiro Tamura
  0 siblings, 2 replies; 19+ messages in thread
From: Naohiro Tamura @ 2021-05-10 14:07 UTC (permalink / raw)
  To: libc-alpha

This patch replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE or
AC_PREPROC_IFELSE.
It has been confirmed that GNU 'autoconf' 2.69 suppressed obsolete
warnings, updated the following files:
  - configure
  - sysdeps/mach/hurd/configure
  - sysdeps/s390/configure
  - sysdeps/unix/sysv/linux/configure
and didn't change the following files:
  - sysdeps/ieee754/ldbl-opt/configure
  - sysdeps/mach/configure
  - sysdeps/unix/sysv/linux/powerpc/configure
---
 configure                                    | 46 +++++++++++++++++--
 configure.ac                                 | 16 +++----
 sysdeps/ieee754/ldbl-opt/configure.ac        |  8 ++--
 sysdeps/mach/configure.ac                    |  8 ++--
 sysdeps/mach/hurd/configure                  | 43 +++++++++++++++++-
 sysdeps/mach/hurd/configure.ac               | 10 ++---
 sysdeps/s390/configure                       | 43 +++++++++++++++++-
 sysdeps/s390/configure.ac                    |  4 +-
 sysdeps/unix/sysv/linux/configure            | 47 ++++++++++++++++++--
 sysdeps/unix/sysv/linux/configure.ac         |  8 ++--
 sysdeps/unix/sysv/linux/powerpc/configure.ac |  8 ++--
 11 files changed, 198 insertions(+), 43 deletions(-)

diff --git a/configure b/configure
index 4cc462613c..1a3bad3c86 100755
--- a/configure
+++ b/configure
@@ -1746,6 +1746,43 @@ fi
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+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_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
@@ -3763,6 +3800,7 @@ else
 fi
 
 
+
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -3777,12 +3815,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_compiler_default_cet=yes
 else
   libc_cv_compiler_default_cet=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 # Check whether --enable-cet was given.
 if test "${enable_cet+set}" = set; then :
@@ -5158,12 +5196,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_compiler_ok=yes
 else
   libc_cv_compiler_ok=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok" >&5
 $as_echo "$libc_cv_compiler_ok" >&6; }
diff --git a/configure.ac b/configure.ac
index 64be29d877..c2cc075c52 100644
--- a/configure.ac
+++ b/configure.ac
@@ -466,10 +466,10 @@ AC_ARG_ENABLE([mathvec],
 	      [build_mathvec=$enableval],
 	      [build_mathvec=notset])
 
-AC_TRY_COMPILE([], [
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifndef __CET__
 # error no CET compiler support
-#endif],
+#endif]])],
 	       [libc_cv_compiler_default_cet=yes],
 	       [libc_cv_compiler_default_cet=no])
 
@@ -1034,10 +1034,10 @@ AC_CHECK_PROG_VER(BISON, bison, --version,
   [2.7*|[3-9].*|[1-9][0-9]*], critic_missing="$critic_missing bison")
 
 AC_CACHE_CHECK([if $CC is sufficient to build libc], libc_cv_compiler_ok, [
-AC_TRY_COMPILE([], [
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
 #if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)
 #error insufficient compiler
-#endif],
+#endif]])],
 	       [libc_cv_compiler_ok=yes],
 	       [libc_cv_compiler_ok=no])])
 AS_IF([test $libc_cv_compiler_ok != yes],
@@ -1649,10 +1649,10 @@ dnl Check for silly hacked compilers predefining _FORTIFY_SOURCE.
 dnl Since we are building the implementations of the fortified functions here,
 dnl having the macro defined interacts very badly.
 AC_CACHE_CHECK([for _FORTIFY_SOURCE predefine], libc_cv_predef_fortify_source,
-[AC_TRY_COMPILE([], [
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifdef _FORTIFY_SOURCE
 # error bogon
-#endif],
+#endif]])],
 		[libc_cv_predef_fortify_source=no],
 		[libc_cv_predef_fortify_source=yes])])
 if test $libc_cv_predef_fortify_source = yes; then
@@ -1720,7 +1720,7 @@ fi
 AC_CACHE_CHECK(for __builtin_trap with no external dependencies,
 	       libc_cv_builtin_trap, [dnl
 libc_cv_builtin_trap=no
-AC_TRY_COMPILE([], [__builtin_trap ()], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[__builtin_trap ()]])],[
 libc_undefs=`$NM -u conftest.o |
   LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
     2>&AS_MESSAGE_LOG_FD` || {
@@ -1729,7 +1729,7 @@ libc_undefs=`$NM -u conftest.o |
 echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
 if test -z "$libc_undefs"; then
   libc_cv_builtin_trap=yes
-fi])])
+fi],[])])
 if test $libc_cv_builtin_trap = yes; then
   AC_DEFINE([HAVE_BUILTIN_TRAP])
 fi
diff --git a/sysdeps/ieee754/ldbl-opt/configure.ac b/sysdeps/ieee754/ldbl-opt/configure.ac
index a77fadd1c4..70e3b32dc6 100644
--- a/sysdeps/ieee754/ldbl-opt/configure.ac
+++ b/sysdeps/ieee754/ldbl-opt/configure.ac
@@ -6,13 +6,13 @@ AC_CACHE_CHECK(whether $CC $CFLAGS supports -mlong-double-128,
 	       libc_cv_mlong_double_128, [dnl
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -mlong-double-128"
-AC_TRY_COMPILE(, [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifndef __LONG_DOUBLE_128__
 # error "compiler did not predefine __LONG_DOUBLE_128__ as expected"
 #endif
-long double foobar (long double x) { return x; }],
-	       libc_cv_mlong_double_128=yes,
-	       libc_cv_mlong_double_128=no)
+long double foobar (long double x) { return x; }]])],
+	       [libc_cv_mlong_double_128=yes],
+	       [libc_cv_mlong_double_128=no])
 CFLAGS="$save_CFLAGS"])
 if test "$libc_cv_mlong_double_128" = no; then
   AC_MSG_ERROR([this configuration requires -mlong-double-128 support])
diff --git a/sysdeps/mach/configure.ac b/sysdeps/mach/configure.ac
index cadecae884..61b00d66b1 100644
--- a/sysdeps/mach/configure.ac
+++ b/sysdeps/mach/configure.ac
@@ -25,8 +25,8 @@ dnl If not, compile with -Dfoo_t=bar_t.
 dnl
 AC_DEFUN([mach_TYPE_CHECK], [dnl
 AC_CACHE_CHECK(for $1 in mach/mach_types.h, libc_cv_mach_$1,
-AC_TRY_COMPILE([#include <mach/mach_types.h>], [extern $1 foo;],
-libc_cv_mach_$1=$1, libc_cv_mach_$1=$2))
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/mach_types.h>]], [[extern $1 foo;]])],
+[libc_cv_mach_$1=$1], [libc_cv_mach_$1=$2]))
 if test [$]libc_cv_mach_$1 != $1; then
   DEFINES="$DEFINES -D$1=$2"
 fi])
@@ -42,10 +42,10 @@ dnl The creation_time field is a GNU Mach addition the other variants lack.
 dnl
 AC_CACHE_CHECK(for creation_time in task_basic_info,
 	       libc_cv_mach_task_creation_time, [dnl
-AC_TRY_COMPILE([#include <mach/task_info.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/task_info.h>]], [[
 extern struct task_basic_info *i;
 long s = i->creation_time.seconds;
-], libc_cv_mach_task_creation_time=yes, libc_cv_mach_task_creation_time=no)])
+]])], [libc_cv_mach_task_creation_time=yes], [libc_cv_mach_task_creation_time=no])])
 if test $libc_cv_mach_task_creation_time = no; then
   AC_MSG_ERROR([you need Mach headers supporting task_info.creation_time])
 fi
diff --git a/sysdeps/mach/hurd/configure b/sysdeps/mach/hurd/configure
index 4876e1f176..fd84a36df8 100644
--- a/sysdeps/mach/hurd/configure
+++ b/sysdeps/mach/hurd/configure
@@ -1,3 +1,41 @@
+
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+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_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
 
 $as_echo "#define NO_RTLD_HIDDEN 1" >>confdefs.h
@@ -9,6 +47,7 @@ if test -n "$sysheaders"; then
 fi
 
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Hurd header version" >&5
 $as_echo_n "checking Hurd header version... " >&6; }
 if ${libc_cv_hurd_version+:} false; then :
@@ -29,12 +68,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_hurd_version=ok
 else
   libc_cv_hurd_version=bad
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_hurd_version" >&5
 $as_echo "$libc_cv_hurd_version" >&6; }
diff --git a/sysdeps/mach/hurd/configure.ac b/sysdeps/mach/hurd/configure.ac
index 9a049b1d86..82d085af33 100644
--- a/sysdeps/mach/hurd/configure.ac
+++ b/sysdeps/mach/hurd/configure.ac
@@ -11,14 +11,14 @@ if test -n "$sysheaders"; then
 fi
 
 AC_CACHE_CHECK(Hurd header version, libc_cv_hurd_version, [dnl
-AC_TRY_COMPILE(dnl
-[#include <hurd/version.h>], [
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM(dnl
+[[#include <hurd/version.h>]], [[
 #define NEED_VERSION 20020609
 #if HURD_INTERFACE_VERSION < NEED_VERSION
 # error Hurd version too old: HURD_INTERFACE_VERSION < NEED_VERSION
-#endif],
-	       libc_cv_hurd_version=ok,
-	       libc_cv_hurd_version=bad)])
+#endif]])],
+	       [libc_cv_hurd_version=ok],
+	       [libc_cv_hurd_version=bad])])
 if test "x$libc_cv_hurd_version" != xok; then
   AC_MSG_ERROR(Hurd headers not installed or too old)
 fi
diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure
index 7eaefbabcf..82c970a5df 100644
--- a/sysdeps/s390/configure
+++ b/sysdeps/s390/configure
@@ -1,3 +1,41 @@
+
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+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_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/s390.
 
@@ -301,6 +339,7 @@ then
 fi
 
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC is sufficient to build libc on s390x" >&5
 $as_echo_n "checking if $CC is sufficient to build libc on s390x... " >&6; }
 if ${libc_cv_compiler_ok_on_s390x+:} false; then :
@@ -322,12 +361,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_compiler_ok_on_s390x=yes
 else
   libc_cv_compiler_ok_on_s390x=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok_on_s390x" >&5
 $as_echo "$libc_cv_compiler_ok_on_s390x" >&6; }
diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac
index e6df624919..14948c81ed 100644
--- a/sysdeps/s390/configure.ac
+++ b/sysdeps/s390/configure.ac
@@ -222,11 +222,11 @@ dnl overflow
 dnl (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269)
 AC_CACHE_CHECK([if $CC is sufficient to build libc on s390x],
 libc_cv_compiler_ok_on_s390x, [
-AC_TRY_COMPILE([], [
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
 #if !defined __GNUC__ || __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 1)
 #error insufficient compiler for building on s390x
 #endif
-],
+]])],
 	[libc_cv_compiler_ok_on_s390x=yes],
 	[libc_cv_compiler_ok_on_s390x=no])])
 if test "$libc_cv_compiler_ok_on_s390x" != yes; then
diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
index cace758c01..0c0af35319 100644
--- a/sysdeps/unix/sysv/linux/configure
+++ b/sysdeps/unix/sysv/linux/configure
@@ -1,3 +1,41 @@
+
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+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_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/unix/sysv/linux.
 
@@ -6,6 +44,7 @@ if test -n "$sysheaders"; then
   CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
 fi
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking installed Linux kernel header files" >&5
 $as_echo_n "checking installed Linux kernel header files... " >&6; }
 if ${libc_cv_linux320+:} false; then :
@@ -25,12 +64,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_linux320='3.2.0 or later'
 else
   libc_cv_linux320='missing or too old!'
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_linux320" >&5
 $as_echo "$libc_cv_linux320" >&6; }
@@ -84,12 +123,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_minimum_kernel=ok
 else
   libc_minimum_kernel='too old!'
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_minimum_kernel" >&5
 $as_echo "$libc_minimum_kernel" >&6; }
 if test "$libc_minimum_kernel" = ok; then
diff --git a/sysdeps/unix/sysv/linux/configure.ac b/sysdeps/unix/sysv/linux/configure.ac
index 13abda0a51..197b7e66c8 100644
--- a/sysdeps/unix/sysv/linux/configure.ac
+++ b/sysdeps/unix/sysv/linux/configure.ac
@@ -8,12 +8,12 @@ if test -n "$sysheaders"; then
 fi
 define([libc_cv_linuxVER], [libc_cv_linux]patsubst(LIBC_LINUX_VERSION,[\.]))dnl
 AC_CACHE_CHECK(installed Linux kernel header files, libc_cv_linuxVER, [dnl
-AC_TRY_COMPILE([#include <linux/version.h>
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <linux/version.h>
 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < ]dnl
 patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
 [ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
 # error kernel headers missing or too old
-#endif], [],
+#endif]], [[]])],
 	       [libc_cv_linuxVER='LIBC_LINUX_VERSION or later'],
 	       [libc_cv_linuxVER='missing or too old!'])])
 if test "$libc_cv_linuxVER" != 'LIBC_LINUX_VERSION or later'; then
@@ -52,10 +52,10 @@ changequote(,)dnl
 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
 changequote([,])dnl
-AC_TRY_COMPILE([#include <linux/version.h>
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <linux/version.h>
 #if LINUX_VERSION_CODE < $decnum
 # error kernel headers too old
-#endif], [], [libc_minimum_kernel=ok], [libc_minimum_kernel='too old!'])
+#endif]], [[]])], [libc_minimum_kernel=ok], [libc_minimum_kernel='too old!'])
 AC_MSG_RESULT($libc_minimum_kernel)
 if test "$libc_minimum_kernel" = ok; then
   AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index b8e5f9ac32..598e44ab71 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -6,11 +6,11 @@ AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
 	       libc_cv_mlong_double_128ibm, [dnl
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -mlong-double-128"
-AC_TRY_COMPILE([#include <float.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }],
+long double foobar (long double x) { return x; }]])],
 	       libc_cv_mlong_double_128ibm=yes,
 	       libc_cv_mlong_double_128ibm=no)
 CFLAGS="$save_CFLAGS"])
@@ -20,11 +20,11 @@ if test "$libc_cv_mlong_double_128ibm" = no; then
 		 libc_cv_mabi_ibmlongdouble, [dnl
   save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_TRY_COMPILE([#include <float.h>], [
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }],
+long double foobar (long double x) { return x; }]])],
 		 libc_cv_mabi_ibmlongdouble=yes,
 		 libc_cv_mabi_ibmlongdouble=no)
   CFLAGS="$save_CFLAGS"])
-- 
2.17.1


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

* Re: [PATCH v3] configure: Replaced obsolete AC_TRY_COMPILE
  2021-05-10 14:07   ` [PATCH v3] configure: Replaced obsolete AC_TRY_COMPILE Naohiro Tamura
@ 2021-05-10 17:40     ` Joseph Myers
  2021-05-11  1:28       ` naohirot
  2021-05-11  1:34     ` [PATCH v4] " Naohiro Tamura
  1 sibling, 1 reply; 19+ messages in thread
From: Joseph Myers @ 2021-05-10 17:40 UTC (permalink / raw)
  To: Naohiro Tamura; +Cc: libc-alpha

On Mon, 10 May 2021, Naohiro Tamura wrote:

> diff --git a/sysdeps/mach/hurd/configure b/sysdeps/mach/hurd/configure
> index 4876e1f176..fd84a36df8 100644
> --- a/sysdeps/mach/hurd/configure
> +++ b/sysdeps/mach/hurd/configure
> @@ -1,3 +1,41 @@
> +
> +
> +# ac_fn_c_try_cpp LINENO
> +# ----------------------
> +# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
> +ac_fn_c_try_cpp ()
> +{

In general we try to avoid duplicating such autoconf-generated function 
definitions in sysdeps configure fragments.  See the definition of 
GLIBC_PROVIDES in aclocal.m4.  Maybe with a change to GLIBC_PROVIDES you 
can avoid this function definition getting added to such fragments (it 
looks like the relevant toplevel configure.ac code comes long before the 
sysdeps configure fragments are loaded).

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* RE: [PATCH v3] configure: Replaced obsolete AC_TRY_COMPILE
  2021-05-10 17:40     ` Joseph Myers
@ 2021-05-11  1:28       ` naohirot
  0 siblings, 0 replies; 19+ messages in thread
From: naohirot @ 2021-05-11  1:28 UTC (permalink / raw)
  To: 'Joseph Myers'; +Cc: libc-alpha

Hi Joseph,

Thank you for the review!

> From: Joseph Myers <joseph@codesourcery.com>
 
> On Mon, 10 May 2021, Naohiro Tamura wrote:
> 
> > diff --git a/sysdeps/mach/hurd/configure b/sysdeps/mach/hurd/configure
> > index 4876e1f176..fd84a36df8 100644
> > --- a/sysdeps/mach/hurd/configure
> > +++ b/sysdeps/mach/hurd/configure
> > @@ -1,3 +1,41 @@
> > +
> > +
> > +# ac_fn_c_try_cpp LINENO
> > +# ----------------------
> > +# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
> > +ac_fn_c_try_cpp ()
> > +{
> 
> In general we try to avoid duplicating such autoconf-generated function
> definitions in sysdeps configure fragments.  See the definition of
> GLIBC_PROVIDES in aclocal.m4.  Maybe with a change to GLIBC_PROVIDES
> you can avoid this function definition getting added to such fragments (it looks like
> the relevant toplevel configure.ac code comes long before the sysdeps configure
> fragments are loaded).

I'll fix that.

Thanks.
Naohiro


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

* [PATCH v4] configure: Replaced obsolete AC_TRY_COMPILE
  2021-05-10 14:07   ` [PATCH v3] configure: Replaced obsolete AC_TRY_COMPILE Naohiro Tamura
  2021-05-10 17:40     ` Joseph Myers
@ 2021-05-11  1:34     ` Naohiro Tamura
  2021-05-19  0:46       ` naohirot
                         ` (2 more replies)
  1 sibling, 3 replies; 19+ messages in thread
From: Naohiro Tamura @ 2021-05-11  1:34 UTC (permalink / raw)
  To: libc-alpha

This patch replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE or
AC_PREPROC_IFELSE.
It has been confirmed that GNU 'autoconf' 2.69 suppressed obsolete
warnings, updated the following files:
  - configure
  - sysdeps/mach/configure
  - sysdeps/mach/hurd/configure
  - sysdeps/s390/configure
  - sysdeps/unix/sysv/linux/configure
and didn't change the following files:
  - sysdeps/ieee754/ldbl-opt/configure
  - sysdeps/unix/sysv/linux/powerpc/configure
---
 aclocal.m4                                   |  1 +
 configure                                    | 46 ++++++++++++++++++--
 configure.ac                                 | 16 +++----
 sysdeps/ieee754/ldbl-opt/configure.ac        |  8 ++--
 sysdeps/mach/configure                       | 38 ----------------
 sysdeps/mach/configure.ac                    |  8 ++--
 sysdeps/mach/hurd/configure                  |  5 ++-
 sysdeps/mach/hurd/configure.ac               | 10 ++---
 sysdeps/s390/configure                       |  5 ++-
 sysdeps/s390/configure.ac                    |  4 +-
 sysdeps/unix/sysv/linux/configure            |  9 ++--
 sysdeps/unix/sysv/linux/configure.ac         |  8 ++--
 sysdeps/unix/sysv/linux/powerpc/configure.ac |  8 ++--
 13 files changed, 85 insertions(+), 81 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 08fa1ac6d0..c195c4db56 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -34,6 +34,7 @@ AC_PROVIDE([AS_SHELL_FN_as_fn_set_status])dnl
 AC_PROVIDE([AS_SHELL_FN_as_fn_exit])dnl
 AC_PROVIDE([AS_SHELL_FN_as_fn_arith])dnl
 AC_PROVIDE([AS_SHELL_FN_ac_fn_c_try_compile])dnl
+AC_PROVIDE([AS_SHELL_FN_ac_fn_c_try_cpp])dnl
 define([AS_MESSAGE_LOG_FD],5)dnl
 define([AS_MESSAGE_FD],6)dnl
 dnl Ripped out of AS_INIT, which does more cruft we do not want.
diff --git a/configure b/configure
index 4cc462613c..1a3bad3c86 100755
--- a/configure
+++ b/configure
@@ -1746,6 +1746,43 @@ fi
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+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_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
@@ -3763,6 +3800,7 @@ else
 fi
 
 
+
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -3777,12 +3815,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_compiler_default_cet=yes
 else
   libc_cv_compiler_default_cet=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 # Check whether --enable-cet was given.
 if test "${enable_cet+set}" = set; then :
@@ -5158,12 +5196,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_compiler_ok=yes
 else
   libc_cv_compiler_ok=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok" >&5
 $as_echo "$libc_cv_compiler_ok" >&6; }
diff --git a/configure.ac b/configure.ac
index 64be29d877..c2cc075c52 100644
--- a/configure.ac
+++ b/configure.ac
@@ -466,10 +466,10 @@ AC_ARG_ENABLE([mathvec],
 	      [build_mathvec=$enableval],
 	      [build_mathvec=notset])
 
-AC_TRY_COMPILE([], [
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifndef __CET__
 # error no CET compiler support
-#endif],
+#endif]])],
 	       [libc_cv_compiler_default_cet=yes],
 	       [libc_cv_compiler_default_cet=no])
 
@@ -1034,10 +1034,10 @@ AC_CHECK_PROG_VER(BISON, bison, --version,
   [2.7*|[3-9].*|[1-9][0-9]*], critic_missing="$critic_missing bison")
 
 AC_CACHE_CHECK([if $CC is sufficient to build libc], libc_cv_compiler_ok, [
-AC_TRY_COMPILE([], [
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
 #if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)
 #error insufficient compiler
-#endif],
+#endif]])],
 	       [libc_cv_compiler_ok=yes],
 	       [libc_cv_compiler_ok=no])])
 AS_IF([test $libc_cv_compiler_ok != yes],
@@ -1649,10 +1649,10 @@ dnl Check for silly hacked compilers predefining _FORTIFY_SOURCE.
 dnl Since we are building the implementations of the fortified functions here,
 dnl having the macro defined interacts very badly.
 AC_CACHE_CHECK([for _FORTIFY_SOURCE predefine], libc_cv_predef_fortify_source,
-[AC_TRY_COMPILE([], [
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifdef _FORTIFY_SOURCE
 # error bogon
-#endif],
+#endif]])],
 		[libc_cv_predef_fortify_source=no],
 		[libc_cv_predef_fortify_source=yes])])
 if test $libc_cv_predef_fortify_source = yes; then
@@ -1720,7 +1720,7 @@ fi
 AC_CACHE_CHECK(for __builtin_trap with no external dependencies,
 	       libc_cv_builtin_trap, [dnl
 libc_cv_builtin_trap=no
-AC_TRY_COMPILE([], [__builtin_trap ()], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[__builtin_trap ()]])],[
 libc_undefs=`$NM -u conftest.o |
   LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
     2>&AS_MESSAGE_LOG_FD` || {
@@ -1729,7 +1729,7 @@ libc_undefs=`$NM -u conftest.o |
 echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
 if test -z "$libc_undefs"; then
   libc_cv_builtin_trap=yes
-fi])])
+fi],[])])
 if test $libc_cv_builtin_trap = yes; then
   AC_DEFINE([HAVE_BUILTIN_TRAP])
 fi
diff --git a/sysdeps/ieee754/ldbl-opt/configure.ac b/sysdeps/ieee754/ldbl-opt/configure.ac
index a77fadd1c4..70e3b32dc6 100644
--- a/sysdeps/ieee754/ldbl-opt/configure.ac
+++ b/sysdeps/ieee754/ldbl-opt/configure.ac
@@ -6,13 +6,13 @@ AC_CACHE_CHECK(whether $CC $CFLAGS supports -mlong-double-128,
 	       libc_cv_mlong_double_128, [dnl
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -mlong-double-128"
-AC_TRY_COMPILE(, [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifndef __LONG_DOUBLE_128__
 # error "compiler did not predefine __LONG_DOUBLE_128__ as expected"
 #endif
-long double foobar (long double x) { return x; }],
-	       libc_cv_mlong_double_128=yes,
-	       libc_cv_mlong_double_128=no)
+long double foobar (long double x) { return x; }]])],
+	       [libc_cv_mlong_double_128=yes],
+	       [libc_cv_mlong_double_128=no])
 CFLAGS="$save_CFLAGS"])
 if test "$libc_cv_mlong_double_128" = no; then
   AC_MSG_ERROR([this configuration requires -mlong-double-128 support])
diff --git a/sysdeps/mach/configure b/sysdeps/mach/configure
index c6ea9be20b..739f1028a4 100644
--- a/sysdeps/mach/configure
+++ b/sysdeps/mach/configure
@@ -1,42 +1,4 @@
 
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_cpp conftest.$ac_ext"
-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_cpp conftest.$ac_ext") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } > conftest.i && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-    ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
 # ac_fn_c_check_header_preproc LINENO HEADER VAR
 # ----------------------------------------------
 # Tests whether HEADER is present, setting the cache variable VAR accordingly.
diff --git a/sysdeps/mach/configure.ac b/sysdeps/mach/configure.ac
index cadecae884..61b00d66b1 100644
--- a/sysdeps/mach/configure.ac
+++ b/sysdeps/mach/configure.ac
@@ -25,8 +25,8 @@ dnl If not, compile with -Dfoo_t=bar_t.
 dnl
 AC_DEFUN([mach_TYPE_CHECK], [dnl
 AC_CACHE_CHECK(for $1 in mach/mach_types.h, libc_cv_mach_$1,
-AC_TRY_COMPILE([#include <mach/mach_types.h>], [extern $1 foo;],
-libc_cv_mach_$1=$1, libc_cv_mach_$1=$2))
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/mach_types.h>]], [[extern $1 foo;]])],
+[libc_cv_mach_$1=$1], [libc_cv_mach_$1=$2]))
 if test [$]libc_cv_mach_$1 != $1; then
   DEFINES="$DEFINES -D$1=$2"
 fi])
@@ -42,10 +42,10 @@ dnl The creation_time field is a GNU Mach addition the other variants lack.
 dnl
 AC_CACHE_CHECK(for creation_time in task_basic_info,
 	       libc_cv_mach_task_creation_time, [dnl
-AC_TRY_COMPILE([#include <mach/task_info.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/task_info.h>]], [[
 extern struct task_basic_info *i;
 long s = i->creation_time.seconds;
-], libc_cv_mach_task_creation_time=yes, libc_cv_mach_task_creation_time=no)])
+]])], [libc_cv_mach_task_creation_time=yes], [libc_cv_mach_task_creation_time=no])])
 if test $libc_cv_mach_task_creation_time = no; then
   AC_MSG_ERROR([you need Mach headers supporting task_info.creation_time])
 fi
diff --git a/sysdeps/mach/hurd/configure b/sysdeps/mach/hurd/configure
index 4876e1f176..8d0702ad43 100644
--- a/sysdeps/mach/hurd/configure
+++ b/sysdeps/mach/hurd/configure
@@ -9,6 +9,7 @@ if test -n "$sysheaders"; then
 fi
 
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Hurd header version" >&5
 $as_echo_n "checking Hurd header version... " >&6; }
 if ${libc_cv_hurd_version+:} false; then :
@@ -29,12 +30,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_hurd_version=ok
 else
   libc_cv_hurd_version=bad
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_hurd_version" >&5
 $as_echo "$libc_cv_hurd_version" >&6; }
diff --git a/sysdeps/mach/hurd/configure.ac b/sysdeps/mach/hurd/configure.ac
index 9a049b1d86..82d085af33 100644
--- a/sysdeps/mach/hurd/configure.ac
+++ b/sysdeps/mach/hurd/configure.ac
@@ -11,14 +11,14 @@ if test -n "$sysheaders"; then
 fi
 
 AC_CACHE_CHECK(Hurd header version, libc_cv_hurd_version, [dnl
-AC_TRY_COMPILE(dnl
-[#include <hurd/version.h>], [
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM(dnl
+[[#include <hurd/version.h>]], [[
 #define NEED_VERSION 20020609
 #if HURD_INTERFACE_VERSION < NEED_VERSION
 # error Hurd version too old: HURD_INTERFACE_VERSION < NEED_VERSION
-#endif],
-	       libc_cv_hurd_version=ok,
-	       libc_cv_hurd_version=bad)])
+#endif]])],
+	       [libc_cv_hurd_version=ok],
+	       [libc_cv_hurd_version=bad])])
 if test "x$libc_cv_hurd_version" != xok; then
   AC_MSG_ERROR(Hurd headers not installed or too old)
 fi
diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure
index 7eaefbabcf..431088acad 100644
--- a/sysdeps/s390/configure
+++ b/sysdeps/s390/configure
@@ -301,6 +301,7 @@ then
 fi
 
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC is sufficient to build libc on s390x" >&5
 $as_echo_n "checking if $CC is sufficient to build libc on s390x... " >&6; }
 if ${libc_cv_compiler_ok_on_s390x+:} false; then :
@@ -322,12 +323,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_compiler_ok_on_s390x=yes
 else
   libc_cv_compiler_ok_on_s390x=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok_on_s390x" >&5
 $as_echo "$libc_cv_compiler_ok_on_s390x" >&6; }
diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac
index e6df624919..14948c81ed 100644
--- a/sysdeps/s390/configure.ac
+++ b/sysdeps/s390/configure.ac
@@ -222,11 +222,11 @@ dnl overflow
 dnl (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269)
 AC_CACHE_CHECK([if $CC is sufficient to build libc on s390x],
 libc_cv_compiler_ok_on_s390x, [
-AC_TRY_COMPILE([], [
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
 #if !defined __GNUC__ || __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 1)
 #error insufficient compiler for building on s390x
 #endif
-],
+]])],
 	[libc_cv_compiler_ok_on_s390x=yes],
 	[libc_cv_compiler_ok_on_s390x=no])])
 if test "$libc_cv_compiler_ok_on_s390x" != yes; then
diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
index cace758c01..4ff02c9b6d 100644
--- a/sysdeps/unix/sysv/linux/configure
+++ b/sysdeps/unix/sysv/linux/configure
@@ -6,6 +6,7 @@ if test -n "$sysheaders"; then
   CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
 fi
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking installed Linux kernel header files" >&5
 $as_echo_n "checking installed Linux kernel header files... " >&6; }
 if ${libc_cv_linux320+:} false; then :
@@ -25,12 +26,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_linux320='3.2.0 or later'
 else
   libc_cv_linux320='missing or too old!'
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_linux320" >&5
 $as_echo "$libc_cv_linux320" >&6; }
@@ -84,12 +85,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_minimum_kernel=ok
 else
   libc_minimum_kernel='too old!'
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_minimum_kernel" >&5
 $as_echo "$libc_minimum_kernel" >&6; }
 if test "$libc_minimum_kernel" = ok; then
diff --git a/sysdeps/unix/sysv/linux/configure.ac b/sysdeps/unix/sysv/linux/configure.ac
index 13abda0a51..197b7e66c8 100644
--- a/sysdeps/unix/sysv/linux/configure.ac
+++ b/sysdeps/unix/sysv/linux/configure.ac
@@ -8,12 +8,12 @@ if test -n "$sysheaders"; then
 fi
 define([libc_cv_linuxVER], [libc_cv_linux]patsubst(LIBC_LINUX_VERSION,[\.]))dnl
 AC_CACHE_CHECK(installed Linux kernel header files, libc_cv_linuxVER, [dnl
-AC_TRY_COMPILE([#include <linux/version.h>
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <linux/version.h>
 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < ]dnl
 patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
 [ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
 # error kernel headers missing or too old
-#endif], [],
+#endif]], [[]])],
 	       [libc_cv_linuxVER='LIBC_LINUX_VERSION or later'],
 	       [libc_cv_linuxVER='missing or too old!'])])
 if test "$libc_cv_linuxVER" != 'LIBC_LINUX_VERSION or later'; then
@@ -52,10 +52,10 @@ changequote(,)dnl
 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
 changequote([,])dnl
-AC_TRY_COMPILE([#include <linux/version.h>
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <linux/version.h>
 #if LINUX_VERSION_CODE < $decnum
 # error kernel headers too old
-#endif], [], [libc_minimum_kernel=ok], [libc_minimum_kernel='too old!'])
+#endif]], [[]])], [libc_minimum_kernel=ok], [libc_minimum_kernel='too old!'])
 AC_MSG_RESULT($libc_minimum_kernel)
 if test "$libc_minimum_kernel" = ok; then
   AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index b8e5f9ac32..598e44ab71 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -6,11 +6,11 @@ AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
 	       libc_cv_mlong_double_128ibm, [dnl
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -mlong-double-128"
-AC_TRY_COMPILE([#include <float.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }],
+long double foobar (long double x) { return x; }]])],
 	       libc_cv_mlong_double_128ibm=yes,
 	       libc_cv_mlong_double_128ibm=no)
 CFLAGS="$save_CFLAGS"])
@@ -20,11 +20,11 @@ if test "$libc_cv_mlong_double_128ibm" = no; then
 		 libc_cv_mabi_ibmlongdouble, [dnl
   save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_TRY_COMPILE([#include <float.h>], [
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }],
+long double foobar (long double x) { return x; }]])],
 		 libc_cv_mabi_ibmlongdouble=yes,
 		 libc_cv_mabi_ibmlongdouble=no)
   CFLAGS="$save_CFLAGS"])
-- 
2.17.1


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

* RE: [PATCH v4] configure: Replaced obsolete AC_TRY_COMPILE
  2021-05-11  1:34     ` [PATCH v4] " Naohiro Tamura
@ 2021-05-19  0:46       ` naohirot
  2021-05-22  1:11       ` Mike Frysinger
  2021-05-22  2:42       ` [PATCH v5] " Naohiro Tamura
  2 siblings, 0 replies; 19+ messages in thread
From: naohirot @ 2021-05-19  0:46 UTC (permalink / raw)
  To: 'Mike Frysinger', 'Zack Weinberg',
	'Joseph Myers'
  Cc: 'Carlos O'Donell', libc-alpha

Hi Mike, Zack, Joseph,
cc: Carlos

FYI: Fujitsu has received FSF signed assignment.
So the contract process has completed.

Thanks.
Naohiro


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

* Re: [PATCH v4] configure: Replaced obsolete AC_TRY_COMPILE
  2021-05-11  1:34     ` [PATCH v4] " Naohiro Tamura
  2021-05-19  0:46       ` naohirot
@ 2021-05-22  1:11       ` Mike Frysinger
  2021-05-22  1:32         ` naohirot
  2021-05-22  2:42       ` [PATCH v5] " Naohiro Tamura
  2 siblings, 1 reply; 19+ messages in thread
From: Mike Frysinger @ 2021-05-22  1:11 UTC (permalink / raw)
  To: Naohiro Tamura; +Cc: libc-alpha

On 11 May 2021 01:34, Naohiro Tamura wrote:
> --- a/configure.ac
> +++ b/configure.ac
> 
> -[AC_TRY_COMPILE([], [
> +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
>  #ifdef _FORTIFY_SOURCE
>  # error bogon
> -#endif],
> +#endif]])],

this can be AC_PREPROC_IFELSE
-mike

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

* Re: [PATCH v4] configure: Replaced obsolete AC_TRY_COMPILE
  2021-05-22  1:11       ` Mike Frysinger
@ 2021-05-22  1:32         ` naohirot
  2021-05-22  1:47           ` Mike Frysinger
  0 siblings, 1 reply; 19+ messages in thread
From: naohirot @ 2021-05-22  1:32 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: libc-alpha

Hi Mike,

Thanks for the comment.

> 
> On 11 May 2021 01:34, Naohiro Tamura wrote:
> > --- a/configure.ac
> > +++ b/configure.ac
> >
> > -[AC_TRY_COMPILE([], [
> > +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
> >  #ifdef _FORTIFY_SOURCE
> >  # error bogon
> > -#endif],
> > +#endif]])],
> 
> this can be AC_PREPROC_IFELSE

In case of _FORTIFY_SOURCE, it requires compiler optimize option more than -O1.

$ man  FEATURE_TEST_MACROS

   If _FORTIFY_SOURCE is set to 1, with compiler optimization level 1 (gcc -O1) and above, checks that shouldn't change the behavior  of  con‐
   forming programs are performed.  With _FORTIFY_SOURCE set to 2, some more checking is added, but some conforming programs might fail.

Thanks.
Naohiro

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

* Re: [PATCH v4] configure: Replaced obsolete AC_TRY_COMPILE
  2021-05-22  1:32         ` naohirot
@ 2021-05-22  1:47           ` Mike Frysinger
  2021-05-22  2:00             ` naohirot
  0 siblings, 1 reply; 19+ messages in thread
From: Mike Frysinger @ 2021-05-22  1:47 UTC (permalink / raw)
  To: naohirot; +Cc: libc-alpha

On 22 May 2021 01:32, naohirot@fujitsu.com wrote:
> > On 11 May 2021 01:34, Naohiro Tamura wrote:
> > > --- a/configure.ac
> > > +++ b/configure.ac
> > >
> > > -[AC_TRY_COMPILE([], [
> > > +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
> > >  #ifdef _FORTIFY_SOURCE
> > >  # error bogon
> > > -#endif],
> > > +#endif]])],
> > 
> > this can be AC_PREPROC_IFELSE
> 
> In case of _FORTIFY_SOURCE, it requires compiler optimize option more than -O1.
> 
> $ man  FEATURE_TEST_MACROS
> 
>    If _FORTIFY_SOURCE is set to 1, with compiler optimization level 1 (gcc -O1) and above, checks that shouldn't change the behavior  of  con‐
>    forming programs are performed.  With _FORTIFY_SOURCE set to 2, some more checking is added, but some conforming programs might fail.

you'll want to leave a dnl in there explaining why so the next person doesn't
try to "fix" it.
-mike

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

* Re: [PATCH v4] configure: Replaced obsolete AC_TRY_COMPILE
  2021-05-22  1:47           ` Mike Frysinger
@ 2021-05-22  2:00             ` naohirot
  0 siblings, 0 replies; 19+ messages in thread
From: naohirot @ 2021-05-22  2:00 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: libc-alpha

Hi Mike,

> On 22 May 2021 01:32, naohirot@fujitsu.com wrote:
> > > On 11 May 2021 01:34, Naohiro Tamura wrote:
> > > > --- a/configure.ac
> > > > +++ b/configure.ac
> > > >
> > > > -[AC_TRY_COMPILE([], [
> > > > +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
> > > >  #ifdef _FORTIFY_SOURCE
> > > >  # error bogon
> > > > -#endif],
> > > > +#endif]])],
> > >
> > > this can be AC_PREPROC_IFELSE
> >
> > In case of _FORTIFY_SOURCE, it requires compiler optimize option more than -O1.
> >
> > $ man  FEATURE_TEST_MACROS
> >
> >    If _FORTIFY_SOURCE is set to 1, with compiler optimization level 1 (gcc -O1) and above, checks that shouldn't change the behavior  of  con‐
> >    forming programs are performed.  With _FORTIFY_SOURCE set to 2, some more checking is added, but some conforming programs might fail.
> 
> you'll want to leave a dnl in there explaining why so the next person doesn't
> try to "fix" it.

It make sense, I'll do that.

Thanks.
Naohiro

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

* [PATCH v5] configure: Replaced obsolete AC_TRY_COMPILE
  2021-05-11  1:34     ` [PATCH v4] " Naohiro Tamura
  2021-05-19  0:46       ` naohirot
  2021-05-22  1:11       ` Mike Frysinger
@ 2021-05-22  2:42       ` Naohiro Tamura
  2021-05-25 16:07         ` Carlos O'Donell
  2021-06-04 13:15         ` Adhemerval Zanella
  2 siblings, 2 replies; 19+ messages in thread
From: Naohiro Tamura @ 2021-05-22  2:42 UTC (permalink / raw)
  To: libc-alpha

This patch replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE or
AC_PREPROC_IFELSE.
It has been confirmed that GNU 'autoconf' 2.69 suppressed obsolete
warnings, updated the following files:
  - configure
  - sysdeps/mach/configure
  - sysdeps/mach/hurd/configure
  - sysdeps/s390/configure
  - sysdeps/unix/sysv/linux/configure
and didn't change the following files:
  - sysdeps/ieee754/ldbl-opt/configure
  - sysdeps/unix/sysv/linux/powerpc/configure
---
 aclocal.m4                                   |  1 +
 configure                                    | 46 ++++++++++++++++++--
 configure.ac                                 | 19 ++++----
 sysdeps/ieee754/ldbl-opt/configure.ac        |  8 ++--
 sysdeps/mach/configure                       | 38 ----------------
 sysdeps/mach/configure.ac                    |  8 ++--
 sysdeps/mach/hurd/configure                  |  5 ++-
 sysdeps/mach/hurd/configure.ac               | 10 ++---
 sysdeps/s390/configure                       |  5 ++-
 sysdeps/s390/configure.ac                    |  4 +-
 sysdeps/unix/sysv/linux/configure            |  9 ++--
 sysdeps/unix/sysv/linux/configure.ac         |  8 ++--
 sysdeps/unix/sysv/linux/powerpc/configure.ac |  8 ++--
 13 files changed, 88 insertions(+), 81 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 08fa1ac6d053..c195c4db5677 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -34,6 +34,7 @@ AC_PROVIDE([AS_SHELL_FN_as_fn_set_status])dnl
 AC_PROVIDE([AS_SHELL_FN_as_fn_exit])dnl
 AC_PROVIDE([AS_SHELL_FN_as_fn_arith])dnl
 AC_PROVIDE([AS_SHELL_FN_ac_fn_c_try_compile])dnl
+AC_PROVIDE([AS_SHELL_FN_ac_fn_c_try_cpp])dnl
 define([AS_MESSAGE_LOG_FD],5)dnl
 define([AS_MESSAGE_FD],6)dnl
 dnl Ripped out of AS_INIT, which does more cruft we do not want.
diff --git a/configure b/configure
index 4cc462613c9f..1a3bad3c869e 100755
--- a/configure
+++ b/configure
@@ -1746,6 +1746,43 @@ fi
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+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_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
@@ -3763,6 +3800,7 @@ else
 fi
 
 
+
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -3777,12 +3815,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_compiler_default_cet=yes
 else
   libc_cv_compiler_default_cet=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 # Check whether --enable-cet was given.
 if test "${enable_cet+set}" = set; then :
@@ -5158,12 +5196,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_compiler_ok=yes
 else
   libc_cv_compiler_ok=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok" >&5
 $as_echo "$libc_cv_compiler_ok" >&6; }
diff --git a/configure.ac b/configure.ac
index 64be29d87777..293a33565a1d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -466,10 +466,10 @@ AC_ARG_ENABLE([mathvec],
 	      [build_mathvec=$enableval],
 	      [build_mathvec=notset])
 
-AC_TRY_COMPILE([], [
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifndef __CET__
 # error no CET compiler support
-#endif],
+#endif]])],
 	       [libc_cv_compiler_default_cet=yes],
 	       [libc_cv_compiler_default_cet=no])
 
@@ -1034,10 +1034,10 @@ AC_CHECK_PROG_VER(BISON, bison, --version,
   [2.7*|[3-9].*|[1-9][0-9]*], critic_missing="$critic_missing bison")
 
 AC_CACHE_CHECK([if $CC is sufficient to build libc], libc_cv_compiler_ok, [
-AC_TRY_COMPILE([], [
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
 #if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)
 #error insufficient compiler
-#endif],
+#endif]])],
 	       [libc_cv_compiler_ok=yes],
 	       [libc_cv_compiler_ok=no])])
 AS_IF([test $libc_cv_compiler_ok != yes],
@@ -1648,11 +1648,14 @@ CPPUNDEFS=
 dnl Check for silly hacked compilers predefining _FORTIFY_SOURCE.
 dnl Since we are building the implementations of the fortified functions here,
 dnl having the macro defined interacts very badly.
+dnl _FORTIFY_SOURCE requires compiler optimization level 1 (gcc -O1)
+dnl and above (see "man FEATURE_TEST_MACROS").
+dnl So do NOT replace AC_COMPILE_IFELSE with AC_PREPROC_IFELSE.
 AC_CACHE_CHECK([for _FORTIFY_SOURCE predefine], libc_cv_predef_fortify_source,
-[AC_TRY_COMPILE([], [
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifdef _FORTIFY_SOURCE
 # error bogon
-#endif],
+#endif]])],
 		[libc_cv_predef_fortify_source=no],
 		[libc_cv_predef_fortify_source=yes])])
 if test $libc_cv_predef_fortify_source = yes; then
@@ -1720,7 +1723,7 @@ fi
 AC_CACHE_CHECK(for __builtin_trap with no external dependencies,
 	       libc_cv_builtin_trap, [dnl
 libc_cv_builtin_trap=no
-AC_TRY_COMPILE([], [__builtin_trap ()], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[__builtin_trap ()]])],[
 libc_undefs=`$NM -u conftest.o |
   LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
     2>&AS_MESSAGE_LOG_FD` || {
@@ -1729,7 +1732,7 @@ libc_undefs=`$NM -u conftest.o |
 echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
 if test -z "$libc_undefs"; then
   libc_cv_builtin_trap=yes
-fi])])
+fi],[])])
 if test $libc_cv_builtin_trap = yes; then
   AC_DEFINE([HAVE_BUILTIN_TRAP])
 fi
diff --git a/sysdeps/ieee754/ldbl-opt/configure.ac b/sysdeps/ieee754/ldbl-opt/configure.ac
index a77fadd1c428..70e3b32dc667 100644
--- a/sysdeps/ieee754/ldbl-opt/configure.ac
+++ b/sysdeps/ieee754/ldbl-opt/configure.ac
@@ -6,13 +6,13 @@ AC_CACHE_CHECK(whether $CC $CFLAGS supports -mlong-double-128,
 	       libc_cv_mlong_double_128, [dnl
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -mlong-double-128"
-AC_TRY_COMPILE(, [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 #ifndef __LONG_DOUBLE_128__
 # error "compiler did not predefine __LONG_DOUBLE_128__ as expected"
 #endif
-long double foobar (long double x) { return x; }],
-	       libc_cv_mlong_double_128=yes,
-	       libc_cv_mlong_double_128=no)
+long double foobar (long double x) { return x; }]])],
+	       [libc_cv_mlong_double_128=yes],
+	       [libc_cv_mlong_double_128=no])
 CFLAGS="$save_CFLAGS"])
 if test "$libc_cv_mlong_double_128" = no; then
   AC_MSG_ERROR([this configuration requires -mlong-double-128 support])
diff --git a/sysdeps/mach/configure b/sysdeps/mach/configure
index c6ea9be20b3b..739f1028a46f 100644
--- a/sysdeps/mach/configure
+++ b/sysdeps/mach/configure
@@ -1,42 +1,4 @@
 
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_cpp conftest.$ac_ext"
-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_cpp conftest.$ac_ext") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } > conftest.i && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-    ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
 # ac_fn_c_check_header_preproc LINENO HEADER VAR
 # ----------------------------------------------
 # Tests whether HEADER is present, setting the cache variable VAR accordingly.
diff --git a/sysdeps/mach/configure.ac b/sysdeps/mach/configure.ac
index cadecae88401..61b00d66b109 100644
--- a/sysdeps/mach/configure.ac
+++ b/sysdeps/mach/configure.ac
@@ -25,8 +25,8 @@ dnl If not, compile with -Dfoo_t=bar_t.
 dnl
 AC_DEFUN([mach_TYPE_CHECK], [dnl
 AC_CACHE_CHECK(for $1 in mach/mach_types.h, libc_cv_mach_$1,
-AC_TRY_COMPILE([#include <mach/mach_types.h>], [extern $1 foo;],
-libc_cv_mach_$1=$1, libc_cv_mach_$1=$2))
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/mach_types.h>]], [[extern $1 foo;]])],
+[libc_cv_mach_$1=$1], [libc_cv_mach_$1=$2]))
 if test [$]libc_cv_mach_$1 != $1; then
   DEFINES="$DEFINES -D$1=$2"
 fi])
@@ -42,10 +42,10 @@ dnl The creation_time field is a GNU Mach addition the other variants lack.
 dnl
 AC_CACHE_CHECK(for creation_time in task_basic_info,
 	       libc_cv_mach_task_creation_time, [dnl
-AC_TRY_COMPILE([#include <mach/task_info.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/task_info.h>]], [[
 extern struct task_basic_info *i;
 long s = i->creation_time.seconds;
-], libc_cv_mach_task_creation_time=yes, libc_cv_mach_task_creation_time=no)])
+]])], [libc_cv_mach_task_creation_time=yes], [libc_cv_mach_task_creation_time=no])])
 if test $libc_cv_mach_task_creation_time = no; then
   AC_MSG_ERROR([you need Mach headers supporting task_info.creation_time])
 fi
diff --git a/sysdeps/mach/hurd/configure b/sysdeps/mach/hurd/configure
index 4876e1f17600..8d0702ad438d 100644
--- a/sysdeps/mach/hurd/configure
+++ b/sysdeps/mach/hurd/configure
@@ -9,6 +9,7 @@ if test -n "$sysheaders"; then
 fi
 
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Hurd header version" >&5
 $as_echo_n "checking Hurd header version... " >&6; }
 if ${libc_cv_hurd_version+:} false; then :
@@ -29,12 +30,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_hurd_version=ok
 else
   libc_cv_hurd_version=bad
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_hurd_version" >&5
 $as_echo "$libc_cv_hurd_version" >&6; }
diff --git a/sysdeps/mach/hurd/configure.ac b/sysdeps/mach/hurd/configure.ac
index 9a049b1d86de..82d085af3370 100644
--- a/sysdeps/mach/hurd/configure.ac
+++ b/sysdeps/mach/hurd/configure.ac
@@ -11,14 +11,14 @@ if test -n "$sysheaders"; then
 fi
 
 AC_CACHE_CHECK(Hurd header version, libc_cv_hurd_version, [dnl
-AC_TRY_COMPILE(dnl
-[#include <hurd/version.h>], [
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM(dnl
+[[#include <hurd/version.h>]], [[
 #define NEED_VERSION 20020609
 #if HURD_INTERFACE_VERSION < NEED_VERSION
 # error Hurd version too old: HURD_INTERFACE_VERSION < NEED_VERSION
-#endif],
-	       libc_cv_hurd_version=ok,
-	       libc_cv_hurd_version=bad)])
+#endif]])],
+	       [libc_cv_hurd_version=ok],
+	       [libc_cv_hurd_version=bad])])
 if test "x$libc_cv_hurd_version" != xok; then
   AC_MSG_ERROR(Hurd headers not installed or too old)
 fi
diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure
index 7eaefbabcfeb..431088acadfd 100644
--- a/sysdeps/s390/configure
+++ b/sysdeps/s390/configure
@@ -301,6 +301,7 @@ then
 fi
 
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC is sufficient to build libc on s390x" >&5
 $as_echo_n "checking if $CC is sufficient to build libc on s390x... " >&6; }
 if ${libc_cv_compiler_ok_on_s390x+:} false; then :
@@ -322,12 +323,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_compiler_ok_on_s390x=yes
 else
   libc_cv_compiler_ok_on_s390x=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok_on_s390x" >&5
 $as_echo "$libc_cv_compiler_ok_on_s390x" >&6; }
diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac
index e6df62491907..14948c81eddf 100644
--- a/sysdeps/s390/configure.ac
+++ b/sysdeps/s390/configure.ac
@@ -222,11 +222,11 @@ dnl overflow
 dnl (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269)
 AC_CACHE_CHECK([if $CC is sufficient to build libc on s390x],
 libc_cv_compiler_ok_on_s390x, [
-AC_TRY_COMPILE([], [
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
 #if !defined __GNUC__ || __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 1)
 #error insufficient compiler for building on s390x
 #endif
-],
+]])],
 	[libc_cv_compiler_ok_on_s390x=yes],
 	[libc_cv_compiler_ok_on_s390x=no])])
 if test "$libc_cv_compiler_ok_on_s390x" != yes; then
diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
index cace758c01e4..4ff02c9b6d02 100644
--- a/sysdeps/unix/sysv/linux/configure
+++ b/sysdeps/unix/sysv/linux/configure
@@ -6,6 +6,7 @@ if test -n "$sysheaders"; then
   CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
 fi
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking installed Linux kernel header files" >&5
 $as_echo_n "checking installed Linux kernel header files... " >&6; }
 if ${libc_cv_linux320+:} false; then :
@@ -25,12 +26,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_cv_linux320='3.2.0 or later'
 else
   libc_cv_linux320='missing or too old!'
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_linux320" >&5
 $as_echo "$libc_cv_linux320" >&6; }
@@ -84,12 +85,12 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"; then :
   libc_minimum_kernel=ok
 else
   libc_minimum_kernel='too old!'
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_minimum_kernel" >&5
 $as_echo "$libc_minimum_kernel" >&6; }
 if test "$libc_minimum_kernel" = ok; then
diff --git a/sysdeps/unix/sysv/linux/configure.ac b/sysdeps/unix/sysv/linux/configure.ac
index 13abda0a5148..197b7e66c8fe 100644
--- a/sysdeps/unix/sysv/linux/configure.ac
+++ b/sysdeps/unix/sysv/linux/configure.ac
@@ -8,12 +8,12 @@ if test -n "$sysheaders"; then
 fi
 define([libc_cv_linuxVER], [libc_cv_linux]patsubst(LIBC_LINUX_VERSION,[\.]))dnl
 AC_CACHE_CHECK(installed Linux kernel header files, libc_cv_linuxVER, [dnl
-AC_TRY_COMPILE([#include <linux/version.h>
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <linux/version.h>
 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < ]dnl
 patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
 [ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
 # error kernel headers missing or too old
-#endif], [],
+#endif]], [[]])],
 	       [libc_cv_linuxVER='LIBC_LINUX_VERSION or later'],
 	       [libc_cv_linuxVER='missing or too old!'])])
 if test "$libc_cv_linuxVER" != 'LIBC_LINUX_VERSION or later'; then
@@ -52,10 +52,10 @@ changequote(,)dnl
 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
 changequote([,])dnl
-AC_TRY_COMPILE([#include <linux/version.h>
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <linux/version.h>
 #if LINUX_VERSION_CODE < $decnum
 # error kernel headers too old
-#endif], [], [libc_minimum_kernel=ok], [libc_minimum_kernel='too old!'])
+#endif]], [[]])], [libc_minimum_kernel=ok], [libc_minimum_kernel='too old!'])
 AC_MSG_RESULT($libc_minimum_kernel)
 if test "$libc_minimum_kernel" = ok; then
   AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
index b8e5f9ac3263..598e44ab71f7 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
@@ -6,11 +6,11 @@ AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
 	       libc_cv_mlong_double_128ibm, [dnl
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -mlong-double-128"
-AC_TRY_COMPILE([#include <float.h>], [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }],
+long double foobar (long double x) { return x; }]])],
 	       libc_cv_mlong_double_128ibm=yes,
 	       libc_cv_mlong_double_128ibm=no)
 CFLAGS="$save_CFLAGS"])
@@ -20,11 +20,11 @@ if test "$libc_cv_mlong_double_128ibm" = no; then
 		 libc_cv_mabi_ibmlongdouble, [dnl
   save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
-  AC_TRY_COMPILE([#include <float.h>], [
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
-long double foobar (long double x) { return x; }],
+long double foobar (long double x) { return x; }]])],
 		 libc_cv_mabi_ibmlongdouble=yes,
 		 libc_cv_mabi_ibmlongdouble=no)
   CFLAGS="$save_CFLAGS"])
-- 
2.17.1


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

* Re: [PATCH v5] configure: Replaced obsolete AC_TRY_COMPILE
  2021-05-22  2:42       ` [PATCH v5] " Naohiro Tamura
@ 2021-05-25 16:07         ` Carlos O'Donell
  2021-06-04  0:15           ` naohirot
  2021-06-04 13:15         ` Adhemerval Zanella
  1 sibling, 1 reply; 19+ messages in thread
From: Carlos O'Donell @ 2021-05-25 16:07 UTC (permalink / raw)
  To: Naohiro Tamura, libc-alpha

On 5/21/21 10:42 PM, Naohiro Tamura wrote:
> This patch replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE or
> AC_PREPROC_IFELSE.
> It has been confirmed that GNU 'autoconf' 2.69 suppressed obsolete
> warnings, updated the following files:
>   - configure
>   - sysdeps/mach/configure
>   - sysdeps/mach/hurd/configure
>   - sysdeps/s390/configure
>   - sysdeps/unix/sysv/linux/configure
> and didn't change the following files:
>   - sysdeps/ieee754/ldbl-opt/configure
>   - sysdeps/unix/sysv/linux/powerpc/configure

This is not a review, but I want to confirm that we now have copyright
assignments in place for Fujitsu for glibc. Thank you to everyone who
was part of that process. We can proceed with reviews.

-- 
Cheers,
Carlos.


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

* RE: [PATCH v5] configure: Replaced obsolete AC_TRY_COMPILE
  2021-05-25 16:07         ` Carlos O'Donell
@ 2021-06-04  0:15           ` naohirot
  0 siblings, 0 replies; 19+ messages in thread
From: naohirot @ 2021-06-04  0:15 UTC (permalink / raw)
  To: Mike Frysinger, 'Carlos O'Donell', libc-alpha

Friendly Ping for
https://sourceware.org/pipermail/libc-alpha/2021-May/126722.html

Best regards,
Naohiro

> From: Carlos O'Donell <carlos@redhat.com>
> Sent: Wednesday, May 26, 2021 1:08 AM

> On 5/21/21 10:42 PM, Naohiro Tamura wrote:
> > This patch replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE or
> > AC_PREPROC_IFELSE.
> > It has been confirmed that GNU 'autoconf' 2.69 suppressed obsolete
> > warnings, updated the following files:
> >   - configure
> >   - sysdeps/mach/configure
> >   - sysdeps/mach/hurd/configure
> >   - sysdeps/s390/configure
> >   - sysdeps/unix/sysv/linux/configure
> > and didn't change the following files:
> >   - sysdeps/ieee754/ldbl-opt/configure
> >   - sysdeps/unix/sysv/linux/powerpc/configure
> 
> This is not a review, but I want to confirm that we now have copyright assignments
> in place for Fujitsu for glibc. Thank you to everyone who was part of that process.
> We can proceed with reviews.
> 
> --
> Cheers,
> Carlos.


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

* Re: [PATCH v5] configure: Replaced obsolete AC_TRY_COMPILE
  2021-05-22  2:42       ` [PATCH v5] " Naohiro Tamura
  2021-05-25 16:07         ` Carlos O'Donell
@ 2021-06-04 13:15         ` Adhemerval Zanella
  2021-06-07  0:02           ` naohirot
  1 sibling, 1 reply; 19+ messages in thread
From: Adhemerval Zanella @ 2021-06-04 13:15 UTC (permalink / raw)
  To: Naohiro Tamura, libc-alpha



On 21/05/2021 23:42, Naohiro Tamura wrote:
> This patch replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE or
> AC_PREPROC_IFELSE.
> It has been confirmed that GNU 'autoconf' 2.69 suppressed obsolete
> warnings, updated the following files:
>   - configure
>   - sysdeps/mach/configure
>   - sysdeps/mach/hurd/configure
>   - sysdeps/s390/configure
>   - sysdeps/unix/sysv/linux/configure
> and didn't change the following files:
>   - sysdeps/ieee754/ldbl-opt/configure
>   - sysdeps/unix/sysv/linux/powerpc/configure

LGTM, I regenerate the configure using autoconf 2.69 to certify there is
no difference.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

I will commit this for you.

> ---
>  aclocal.m4                                   |  1 +
>  configure                                    | 46 ++++++++++++++++++--
>  configure.ac                                 | 19 ++++----
>  sysdeps/ieee754/ldbl-opt/configure.ac        |  8 ++--
>  sysdeps/mach/configure                       | 38 ----------------
>  sysdeps/mach/configure.ac                    |  8 ++--
>  sysdeps/mach/hurd/configure                  |  5 ++-
>  sysdeps/mach/hurd/configure.ac               | 10 ++---
>  sysdeps/s390/configure                       |  5 ++-
>  sysdeps/s390/configure.ac                    |  4 +-
>  sysdeps/unix/sysv/linux/configure            |  9 ++--
>  sysdeps/unix/sysv/linux/configure.ac         |  8 ++--
>  sysdeps/unix/sysv/linux/powerpc/configure.ac |  8 ++--
>  13 files changed, 88 insertions(+), 81 deletions(-)
> 
> diff --git a/aclocal.m4 b/aclocal.m4
> index 08fa1ac6d053..c195c4db5677 100644
> --- a/aclocal.m4
> +++ b/aclocal.m4
> @@ -34,6 +34,7 @@ AC_PROVIDE([AS_SHELL_FN_as_fn_set_status])dnl
>  AC_PROVIDE([AS_SHELL_FN_as_fn_exit])dnl
>  AC_PROVIDE([AS_SHELL_FN_as_fn_arith])dnl
>  AC_PROVIDE([AS_SHELL_FN_ac_fn_c_try_compile])dnl
> +AC_PROVIDE([AS_SHELL_FN_ac_fn_c_try_cpp])dnl
>  define([AS_MESSAGE_LOG_FD],5)dnl
>  define([AS_MESSAGE_FD],6)dnl
>  dnl Ripped out of AS_INIT, which does more cruft we do not want.+

Ok.

> diff --git a/configure b/configure
> index 4cc462613c9f..1a3bad3c869e 100755
> --- a/configure
> +++ b/configure
> @@ -1746,6 +1746,43 @@ fi
>    as_fn_set_status $ac_retval
>  
>  } # ac_fn_c_try_link
> +
> +# ac_fn_c_try_cpp LINENO
> +# ----------------------
> +# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
> +ac_fn_c_try_cpp ()
> +{
> +  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
> +  if { { ac_try="$ac_cpp conftest.$ac_ext"
> +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_cpp conftest.$ac_ext") 2>conftest.err
> +  ac_status=$?
> +  if test -s conftest.err; then
> +    grep -v '^ *+' conftest.err >conftest.er1
> +    cat conftest.er1 >&5
> +    mv -f conftest.er1 conftest.err
> +  fi
> +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> +  test $ac_status = 0; } > conftest.i && {
> +	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
> +	 test ! -s conftest.err
> +       }; then :
> +  ac_retval=0
> +else
> +  $as_echo "$as_me: failed program was:" >&5
> +sed 's/^/| /' conftest.$ac_ext >&5
> +
> +    ac_retval=1
> +fi
> +  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
> +  as_fn_set_status $ac_retval
> +
> +} # ac_fn_c_try_cpp
>  cat >config.log <<_ACEOF
>  This file contains any messages produced by compilers while
>  running configure, to aid debugging if configure makes a mistake.
> @@ -3763,6 +3800,7 @@ else
>  fi
>  
>  
> +
>  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
>  /* end confdefs.h.  */
>  
> @@ -3777,12 +3815,12 @@ main ()
>    return 0;
>  }
>  _ACEOF
> -if ac_fn_c_try_compile "$LINENO"; then :
> +if ac_fn_c_try_cpp "$LINENO"; then :
>    libc_cv_compiler_default_cet=yes
>  else
>    libc_cv_compiler_default_cet=no
>  fi
> -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> +rm -f conftest.err conftest.i conftest.$ac_ext
>  
>  # Check whether --enable-cet was given.
>  if test "${enable_cet+set}" = set; then :
> @@ -5158,12 +5196,12 @@ main ()
>    return 0;
>  }
>  _ACEOF
> -if ac_fn_c_try_compile "$LINENO"; then :
> +if ac_fn_c_try_cpp "$LINENO"; then :
>    libc_cv_compiler_ok=yes
>  else
>    libc_cv_compiler_ok=no
>  fi
> -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> +rm -f conftest.err conftest.i conftest.$ac_ext
>  fi
>  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok" >&5
>  $as_echo "$libc_cv_compiler_ok" >&6; }
> diff --git a/configure.ac b/configure.ac
> index 64be29d87777..293a33565a1d 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -466,10 +466,10 @@ AC_ARG_ENABLE([mathvec],
>  	      [build_mathvec=$enableval],
>  	      [build_mathvec=notset])
>  
> -AC_TRY_COMPILE([], [
> +AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
>  #ifndef __CET__
>  # error no CET compiler support
> -#endif],
> +#endif]])],
>  	       [libc_cv_compiler_default_cet=yes],
>  	       [libc_cv_compiler_default_cet=no])
>  

Ok.

> @@ -1034,10 +1034,10 @@ AC_CHECK_PROG_VER(BISON, bison, --version,
>    [2.7*|[3-9].*|[1-9][0-9]*], critic_missing="$critic_missing bison")
>  
>  AC_CACHE_CHECK([if $CC is sufficient to build libc], libc_cv_compiler_ok, [
> -AC_TRY_COMPILE([], [
> +AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
>  #if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)
>  #error insufficient compiler
> -#endif],
> +#endif]])],
>  	       [libc_cv_compiler_ok=yes],
>  	       [libc_cv_compiler_ok=no])])
>  AS_IF([test $libc_cv_compiler_ok != yes],

Ok.

> @@ -1648,11 +1648,14 @@ CPPUNDEFS=
>  dnl Check for silly hacked compilers predefining _FORTIFY_SOURCE.
>  dnl Since we are building the implementations of the fortified functions here,
>  dnl having the macro defined interacts very badly.
> +dnl _FORTIFY_SOURCE requires compiler optimization level 1 (gcc -O1)
> +dnl and above (see "man FEATURE_TEST_MACROS").
> +dnl So do NOT replace AC_COMPILE_IFELSE with AC_PREPROC_IFELSE.
>  AC_CACHE_CHECK([for _FORTIFY_SOURCE predefine], libc_cv_predef_fortify_source,
> -[AC_TRY_COMPILE([], [
> +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
>  #ifdef _FORTIFY_SOURCE
>  # error bogon
> -#endif],
> +#endif]])],
>  		[libc_cv_predef_fortify_source=no],
>  		[libc_cv_predef_fortify_source=yes])])
>  if test $libc_cv_predef_fortify_source = yes; then

Ok.

> @@ -1720,7 +1723,7 @@ fi
>  AC_CACHE_CHECK(for __builtin_trap with no external dependencies,
>  	       libc_cv_builtin_trap, [dnl
>  libc_cv_builtin_trap=no
> -AC_TRY_COMPILE([], [__builtin_trap ()], [
> +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[__builtin_trap ()]])],[
>  libc_undefs=`$NM -u conftest.o |
>    LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
>      2>&AS_MESSAGE_LOG_FD` || {
> @@ -1729,7 +1732,7 @@ libc_undefs=`$NM -u conftest.o |
>  echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
>  if test -z "$libc_undefs"; then
>    libc_cv_builtin_trap=yes
> -fi])])
> +fi],[])])
>  if test $libc_cv_builtin_trap = yes; then
>    AC_DEFINE([HAVE_BUILTIN_TRAP])
>  fi

Ok.

> diff --git a/sysdeps/ieee754/ldbl-opt/configure.ac b/sysdeps/ieee754/ldbl-opt/configure.ac
> index a77fadd1c428..70e3b32dc667 100644
> --- a/sysdeps/ieee754/ldbl-opt/configure.ac
> +++ b/sysdeps/ieee754/ldbl-opt/configure.ac
> @@ -6,13 +6,13 @@ AC_CACHE_CHECK(whether $CC $CFLAGS supports -mlong-double-128,
>  	       libc_cv_mlong_double_128, [dnl
>  save_CFLAGS="$CFLAGS"
>  CFLAGS="$CFLAGS -mlong-double-128"
> -AC_TRY_COMPILE(, [
> +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
>  #ifndef __LONG_DOUBLE_128__
>  # error "compiler did not predefine __LONG_DOUBLE_128__ as expected"
>  #endif
> -long double foobar (long double x) { return x; }],
> -	       libc_cv_mlong_double_128=yes,
> -	       libc_cv_mlong_double_128=no)
> +long double foobar (long double x) { return x; }]])],
> +	       [libc_cv_mlong_double_128=yes],
> +	       [libc_cv_mlong_double_128=no])
>  CFLAGS="$save_CFLAGS"])
>  if test "$libc_cv_mlong_double_128" = no; then
>    AC_MSG_ERROR([this configuration requires -mlong-double-128 support])

Ok.

> diff --git a/sysdeps/mach/configure b/sysdeps/mach/configure
> index c6ea9be20b3b..739f1028a46f 100644
> --- a/sysdeps/mach/configure
> +++ b/sysdeps/mach/configure
> @@ -1,42 +1,4 @@
>  
> -
> -# ac_fn_c_try_cpp LINENO
> -# ----------------------
> -# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
> -ac_fn_c_try_cpp ()
> -{
> -  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
> -  if { { ac_try="$ac_cpp conftest.$ac_ext"
> -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_cpp conftest.$ac_ext") 2>conftest.err
> -  ac_status=$?
> -  if test -s conftest.err; then
> -    grep -v '^ *+' conftest.err >conftest.er1
> -    cat conftest.er1 >&5
> -    mv -f conftest.er1 conftest.err
> -  fi
> -  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> -  test $ac_status = 0; } > conftest.i && {
> -	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
> -	 test ! -s conftest.err
> -       }; then :
> -  ac_retval=0
> -else
> -  $as_echo "$as_me: failed program was:" >&5
> -sed 's/^/| /' conftest.$ac_ext >&5
> -
> -    ac_retval=1
> -fi
> -  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
> -  as_fn_set_status $ac_retval
> -
> -} # ac_fn_c_try_cpp
> -
>  # ac_fn_c_check_header_preproc LINENO HEADER VAR
>  # ----------------------------------------------
>  # Tests whether HEADER is present, setting the cache variable VAR accordingly.
> diff --git a/sysdeps/mach/configure.ac b/sysdeps/mach/configure.ac
> index cadecae88401..61b00d66b109 100644
> --- a/sysdeps/mach/configure.ac
> +++ b/sysdeps/mach/configure.ac
> @@ -25,8 +25,8 @@ dnl If not, compile with -Dfoo_t=bar_t.
>  dnl
>  AC_DEFUN([mach_TYPE_CHECK], [dnl
>  AC_CACHE_CHECK(for $1 in mach/mach_types.h, libc_cv_mach_$1,
> -AC_TRY_COMPILE([#include <mach/mach_types.h>], [extern $1 foo;],
> -libc_cv_mach_$1=$1, libc_cv_mach_$1=$2))
> +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/mach_types.h>]], [[extern $1 foo;]])],
> +[libc_cv_mach_$1=$1], [libc_cv_mach_$1=$2]))
>  if test [$]libc_cv_mach_$1 != $1; then
>    DEFINES="$DEFINES -D$1=$2"
>  fi])

Ok.

> @@ -42,10 +42,10 @@ dnl The creation_time field is a GNU Mach addition the other variants lack.
>  dnl
>  AC_CACHE_CHECK(for creation_time in task_basic_info,
>  	       libc_cv_mach_task_creation_time, [dnl
> -AC_TRY_COMPILE([#include <mach/task_info.h>], [
> +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/task_info.h>]], [[
>  extern struct task_basic_info *i;
>  long s = i->creation_time.seconds;
> -], libc_cv_mach_task_creation_time=yes, libc_cv_mach_task_creation_time=no)])
> +]])], [libc_cv_mach_task_creation_time=yes], [libc_cv_mach_task_creation_time=no])])
>  if test $libc_cv_mach_task_creation_time = no; then
>    AC_MSG_ERROR([you need Mach headers supporting task_info.creation_time])
>  fi

Ok.

> diff --git a/sysdeps/mach/hurd/configure b/sysdeps/mach/hurd/configure
> index 4876e1f17600..8d0702ad438d 100644
> --- a/sysdeps/mach/hurd/configure
> +++ b/sysdeps/mach/hurd/configure
> @@ -9,6 +9,7 @@ if test -n "$sysheaders"; then
>  fi
>  
>  
> +
>  { $as_echo "$as_me:${as_lineno-$LINENO}: checking Hurd header version" >&5
>  $as_echo_n "checking Hurd header version... " >&6; }
>  if ${libc_cv_hurd_version+:} false; then :
> @@ -29,12 +30,12 @@ main ()
>    return 0;
>  }
>  _ACEOF
> -if ac_fn_c_try_compile "$LINENO"; then :
> +if ac_fn_c_try_cpp "$LINENO"; then :
>    libc_cv_hurd_version=ok
>  else
>    libc_cv_hurd_version=bad
>  fi
> -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> +rm -f conftest.err conftest.i conftest.$ac_ext
>  fi
>  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_hurd_version" >&5
>  $as_echo "$libc_cv_hurd_version" >&6; }
> diff --git a/sysdeps/mach/hurd/configure.ac b/sysdeps/mach/hurd/configure.ac
> index 9a049b1d86de..82d085af3370 100644
> --- a/sysdeps/mach/hurd/configure.ac
> +++ b/sysdeps/mach/hurd/configure.ac
> @@ -11,14 +11,14 @@ if test -n "$sysheaders"; then
>  fi
>  
>  AC_CACHE_CHECK(Hurd header version, libc_cv_hurd_version, [dnl
> -AC_TRY_COMPILE(dnl
> -[#include <hurd/version.h>], [
> +AC_PREPROC_IFELSE([AC_LANG_PROGRAM(dnl
> +[[#include <hurd/version.h>]], [[
>  #define NEED_VERSION 20020609
>  #if HURD_INTERFACE_VERSION < NEED_VERSION
>  # error Hurd version too old: HURD_INTERFACE_VERSION < NEED_VERSION
> -#endif],
> -	       libc_cv_hurd_version=ok,
> -	       libc_cv_hurd_version=bad)])
> +#endif]])],
> +	       [libc_cv_hurd_version=ok],
> +	       [libc_cv_hurd_version=bad])])
>  if test "x$libc_cv_hurd_version" != xok; then
>    AC_MSG_ERROR(Hurd headers not installed or too old)
>  fi

Ok.

> diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure
> index 7eaefbabcfeb..431088acadfd 100644
> --- a/sysdeps/s390/configure
> +++ b/sysdeps/s390/configure
> @@ -301,6 +301,7 @@ then
>  fi
>  
>  
> +
>  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC is sufficient to build libc on s390x" >&5
>  $as_echo_n "checking if $CC is sufficient to build libc on s390x... " >&6; }
>  if ${libc_cv_compiler_ok_on_s390x+:} false; then :
> @@ -322,12 +323,12 @@ main ()
>    return 0;
>  }
>  _ACEOF
> -if ac_fn_c_try_compile "$LINENO"; then :
> +if ac_fn_c_try_cpp "$LINENO"; then :
>    libc_cv_compiler_ok_on_s390x=yes
>  else
>    libc_cv_compiler_ok_on_s390x=no
>  fi
> -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> +rm -f conftest.err conftest.i conftest.$ac_ext
>  fi
>  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok_on_s390x" >&5
>  $as_echo "$libc_cv_compiler_ok_on_s390x" >&6; }
> diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac
> index e6df62491907..14948c81eddf 100644
> --- a/sysdeps/s390/configure.ac
> +++ b/sysdeps/s390/configure.ac
> @@ -222,11 +222,11 @@ dnl overflow
>  dnl (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269)
>  AC_CACHE_CHECK([if $CC is sufficient to build libc on s390x],
>  libc_cv_compiler_ok_on_s390x, [
> -AC_TRY_COMPILE([], [
> +AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
>  #if !defined __GNUC__ || __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 1)
>  #error insufficient compiler for building on s390x
>  #endif
> -],
> +]])],
>  	[libc_cv_compiler_ok_on_s390x=yes],
>  	[libc_cv_compiler_ok_on_s390x=no])])
>  if test "$libc_cv_compiler_ok_on_s390x" != yes; then

Ok.

> diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
> index cace758c01e4..4ff02c9b6d02 100644
> --- a/sysdeps/unix/sysv/linux/configure
> +++ b/sysdeps/unix/sysv/linux/configure
> @@ -6,6 +6,7 @@ if test -n "$sysheaders"; then
>    CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
>  fi
>  
> +
>  { $as_echo "$as_me:${as_lineno-$LINENO}: checking installed Linux kernel header files" >&5
>  $as_echo_n "checking installed Linux kernel header files... " >&6; }
>  if ${libc_cv_linux320+:} false; then :
> @@ -25,12 +26,12 @@ main ()
>    return 0;
>  }
>  _ACEOF
> -if ac_fn_c_try_compile "$LINENO"; then :
> +if ac_fn_c_try_cpp "$LINENO"; then :
>    libc_cv_linux320='3.2.0 or later'
>  else
>    libc_cv_linux320='missing or too old!'
>  fi
> -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> +rm -f conftest.err conftest.i conftest.$ac_ext
>  fi
>  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_linux320" >&5
>  $as_echo "$libc_cv_linux320" >&6; }
> @@ -84,12 +85,12 @@ main ()
>    return 0;
>  }
>  _ACEOF
> -if ac_fn_c_try_compile "$LINENO"; then :
> +if ac_fn_c_try_cpp "$LINENO"; then :
>    libc_minimum_kernel=ok
>  else
>    libc_minimum_kernel='too old!'
>  fi
> -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> +rm -f conftest.err conftest.i conftest.$ac_ext
>  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_minimum_kernel" >&5
>  $as_echo "$libc_minimum_kernel" >&6; }
>  if test "$libc_minimum_kernel" = ok; then
> diff --git a/sysdeps/unix/sysv/linux/configure.ac b/sysdeps/unix/sysv/linux/configure.ac
> index 13abda0a5148..197b7e66c8fe 100644
> --- a/sysdeps/unix/sysv/linux/configure.ac
> +++ b/sysdeps/unix/sysv/linux/configure.ac
> @@ -8,12 +8,12 @@ if test -n "$sysheaders"; then
>  fi
>  define([libc_cv_linuxVER], [libc_cv_linux]patsubst(LIBC_LINUX_VERSION,[\.]))dnl
>  AC_CACHE_CHECK(installed Linux kernel header files, libc_cv_linuxVER, [dnl
> -AC_TRY_COMPILE([#include <linux/version.h>
> +AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <linux/version.h>
>  #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < ]dnl
>  patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
>  [ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
>  # error kernel headers missing or too old
> -#endif], [],
> +#endif]], [[]])],
>  	       [libc_cv_linuxVER='LIBC_LINUX_VERSION or later'],
>  	       [libc_cv_linuxVER='missing or too old!'])])
>  if test "$libc_cv_linuxVER" != 'LIBC_LINUX_VERSION or later'; then

Ok.

> @@ -52,10 +52,10 @@ changequote(,)dnl
>  decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
>  abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
>  changequote([,])dnl
> -AC_TRY_COMPILE([#include <linux/version.h>
> +AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <linux/version.h>
>  #if LINUX_VERSION_CODE < $decnum
>  # error kernel headers too old
> -#endif], [], [libc_minimum_kernel=ok], [libc_minimum_kernel='too old!'])
> +#endif]], [[]])], [libc_minimum_kernel=ok], [libc_minimum_kernel='too old!'])
>  AC_MSG_RESULT($libc_minimum_kernel)
>  if test "$libc_minimum_kernel" = ok; then
>    AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)

Ok.

> diff --git a/sysdeps/unix/sysv/linux/powerpc/configure.ac b/sysdeps/unix/sysv/linux/powerpc/configure.ac
> index b8e5f9ac3263..598e44ab71f7 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/configure.ac
> +++ b/sysdeps/unix/sysv/linux/powerpc/configure.ac
> @@ -6,11 +6,11 @@ AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
>  	       libc_cv_mlong_double_128ibm, [dnl
>  save_CFLAGS="$CFLAGS"
>  CFLAGS="$CFLAGS -mlong-double-128"
> -AC_TRY_COMPILE([#include <float.h>], [
> +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
>  #if LDBL_MANT_DIG != 106
>  # error "compiler doesn't implement IBM extended format of long double"
>  #endif
> -long double foobar (long double x) { return x; }],
> +long double foobar (long double x) { return x; }]])],
>  	       libc_cv_mlong_double_128ibm=yes,
>  	       libc_cv_mlong_double_128ibm=no)
>  CFLAGS="$save_CFLAGS"])

Ok.

> @@ -20,11 +20,11 @@ if test "$libc_cv_mlong_double_128ibm" = no; then
>  		 libc_cv_mabi_ibmlongdouble, [dnl
>    save_CFLAGS="$CFLAGS"
>    CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble"
> -  AC_TRY_COMPILE([#include <float.h>], [
> +  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
>  #if LDBL_MANT_DIG != 106
>  # error "compiler doesn't implement IBM extended format of long double"
>  #endif
> -long double foobar (long double x) { return x; }],
> +long double foobar (long double x) { return x; }]])],
>  		 libc_cv_mabi_ibmlongdouble=yes,
>  		 libc_cv_mabi_ibmlongdouble=no)
>    CFLAGS="$save_CFLAGS"])
> 

Ok.

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

* RE: [PATCH v5] configure: Replaced obsolete AC_TRY_COMPILE
  2021-06-04 13:15         ` Adhemerval Zanella
@ 2021-06-07  0:02           ` naohirot
  0 siblings, 0 replies; 19+ messages in thread
From: naohirot @ 2021-06-07  0:02 UTC (permalink / raw)
  To: 'Adhemerval Zanella', libc-alpha

Hi Adhemerval,

> From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> Sent: Friday, June 4, 2021 10:16 PM
> 
> I will commit this for you.

Thanks for the commit!
Naohiro


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

end of thread, other threads:[~2021-06-07  0:02 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 11:59 [PATCH 1/3] Replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE Naohiro Tamura
2021-02-16 13:03 ` Andreas Schwab
2021-02-16 16:38 ` Zack Weinberg
2021-02-17  1:05   ` naohirot
2021-02-17  1:17 ` [PATCH v2 " Naohiro Tamura
2021-05-10 14:07   ` [PATCH v3] configure: Replaced obsolete AC_TRY_COMPILE Naohiro Tamura
2021-05-10 17:40     ` Joseph Myers
2021-05-11  1:28       ` naohirot
2021-05-11  1:34     ` [PATCH v4] " Naohiro Tamura
2021-05-19  0:46       ` naohirot
2021-05-22  1:11       ` Mike Frysinger
2021-05-22  1:32         ` naohirot
2021-05-22  1:47           ` Mike Frysinger
2021-05-22  2:00             ` naohirot
2021-05-22  2:42       ` [PATCH v5] " Naohiro Tamura
2021-05-25 16:07         ` Carlos O'Donell
2021-06-04  0:15           ` naohirot
2021-06-04 13:15         ` Adhemerval Zanella
2021-06-07  0:02           ` naohirot

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).