about summary refs log tree commit diff
path: root/configure.ac
diff options
context:
space:
mode:
authorNaohiro Tamura <naohirot@fujitsu.com>2021-05-22 02:42:48 +0000
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-06-04 10:16:00 -0300
commitb190bccc8a7e4919d3bd68a153577284f201819a (patch)
tree04374fc6123931c91c08adb77c372986ce9c9053 /configure.ac
parent57094e576aed174317fb7de2da34be8536891678 (diff)
downloadglibc-b190bccc8a7e4919d3bd68a153577284f201819a.tar.gz
glibc-b190bccc8a7e4919d3bd68a153577284f201819a.tar.xz
glibc-b190bccc8a7e4919d3bd68a153577284f201819a.zip
configure: Replaced obsolete AC_TRY_COMPILE
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

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 11 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 19051b8ee0..f2588f394f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -457,10 +457,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])
 
@@ -1025,10 +1025,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],
@@ -1639,11 +1639,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
@@ -1711,7 +1714,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` || {
@@ -1720,7 +1723,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