1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

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>
This commit is contained in:
Naohiro Tamura
2021-05-22 02:42:48 +00:00
committed by Adhemerval Zanella
parent 57094e576a
commit b190bccc8a
13 changed files with 88 additions and 81 deletions

1
aclocal.m4 vendored
View File

@ -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_exit])dnl
AC_PROVIDE([AS_SHELL_FN_as_fn_arith])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_compile])dnl
AC_PROVIDE([AS_SHELL_FN_ac_fn_c_try_cpp])dnl
define([AS_MESSAGE_LOG_FD],5)dnl define([AS_MESSAGE_LOG_FD],5)dnl
define([AS_MESSAGE_FD],6)dnl define([AS_MESSAGE_FD],6)dnl
dnl Ripped out of AS_INIT, which does more cruft we do not want. dnl Ripped out of AS_INIT, which does more cruft we do not want.

46
configure vendored
View File

@ -1742,6 +1742,43 @@ fi
as_fn_set_status $ac_retval as_fn_set_status $ac_retval
} # ac_fn_c_try_link } # 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 cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
@ -3747,6 +3784,7 @@ else
fi fi
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
@ -3761,12 +3799,12 @@ main ()
return 0; return 0;
} }
_ACEOF _ACEOF
if ac_fn_c_try_compile "$LINENO"; then : if ac_fn_c_try_cpp "$LINENO"; then :
libc_cv_compiler_default_cet=yes libc_cv_compiler_default_cet=yes
else else
libc_cv_compiler_default_cet=no libc_cv_compiler_default_cet=no
fi 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. # Check whether --enable-cet was given.
if test "${enable_cet+set}" = set; then : if test "${enable_cet+set}" = set; then :
@ -5142,12 +5180,12 @@ main ()
return 0; return 0;
} }
_ACEOF _ACEOF
if ac_fn_c_try_compile "$LINENO"; then : if ac_fn_c_try_cpp "$LINENO"; then :
libc_cv_compiler_ok=yes libc_cv_compiler_ok=yes
else else
libc_cv_compiler_ok=no libc_cv_compiler_ok=no
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f conftest.err conftest.i conftest.$ac_ext
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok" >&5
$as_echo "$libc_cv_compiler_ok" >&6; } $as_echo "$libc_cv_compiler_ok" >&6; }

View File

@ -457,10 +457,10 @@ AC_ARG_ENABLE([mathvec],
[build_mathvec=$enableval], [build_mathvec=$enableval],
[build_mathvec=notset]) [build_mathvec=notset])
AC_TRY_COMPILE([], [ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
#ifndef __CET__ #ifndef __CET__
# error no CET compiler support # error no CET compiler support
#endif], #endif]])],
[libc_cv_compiler_default_cet=yes], [libc_cv_compiler_default_cet=yes],
[libc_cv_compiler_default_cet=no]) [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") [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_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) #if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)
#error insufficient compiler #error insufficient compiler
#endif], #endif]])],
[libc_cv_compiler_ok=yes], [libc_cv_compiler_ok=yes],
[libc_cv_compiler_ok=no])]) [libc_cv_compiler_ok=no])])
AS_IF([test $libc_cv_compiler_ok != yes], AS_IF([test $libc_cv_compiler_ok != yes],
@ -1639,11 +1639,14 @@ CPPUNDEFS=
dnl Check for silly hacked compilers predefining _FORTIFY_SOURCE. dnl Check for silly hacked compilers predefining _FORTIFY_SOURCE.
dnl Since we are building the implementations of the fortified functions here, dnl Since we are building the implementations of the fortified functions here,
dnl having the macro defined interacts very badly. 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_CACHE_CHECK([for _FORTIFY_SOURCE predefine], libc_cv_predef_fortify_source,
[AC_TRY_COMPILE([], [ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
#ifdef _FORTIFY_SOURCE #ifdef _FORTIFY_SOURCE
# error bogon # error bogon
#endif], #endif]])],
[libc_cv_predef_fortify_source=no], [libc_cv_predef_fortify_source=no],
[libc_cv_predef_fortify_source=yes])]) [libc_cv_predef_fortify_source=yes])])
if test $libc_cv_predef_fortify_source = yes; then if test $libc_cv_predef_fortify_source = yes; then
@ -1711,7 +1714,7 @@ fi
AC_CACHE_CHECK(for __builtin_trap with no external dependencies, AC_CACHE_CHECK(for __builtin_trap with no external dependencies,
libc_cv_builtin_trap, [dnl libc_cv_builtin_trap, [dnl
libc_cv_builtin_trap=no libc_cv_builtin_trap=no
AC_TRY_COMPILE([], [__builtin_trap ()], [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[__builtin_trap ()]])],[
libc_undefs=`$NM -u conftest.o | libc_undefs=`$NM -u conftest.o |
LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \ LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \
2>&AS_MESSAGE_LOG_FD` || { 2>&AS_MESSAGE_LOG_FD` || {
@ -1720,7 +1723,7 @@ libc_undefs=`$NM -u conftest.o |
echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'" echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
if test -z "$libc_undefs"; then if test -z "$libc_undefs"; then
libc_cv_builtin_trap=yes libc_cv_builtin_trap=yes
fi])]) fi],[])])
if test $libc_cv_builtin_trap = yes; then if test $libc_cv_builtin_trap = yes; then
AC_DEFINE([HAVE_BUILTIN_TRAP]) AC_DEFINE([HAVE_BUILTIN_TRAP])
fi fi

View File

@ -6,13 +6,13 @@ AC_CACHE_CHECK(whether $CC $CFLAGS supports -mlong-double-128,
libc_cv_mlong_double_128, [dnl libc_cv_mlong_double_128, [dnl
save_CFLAGS="$CFLAGS" save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -mlong-double-128" CFLAGS="$CFLAGS -mlong-double-128"
AC_TRY_COMPILE(, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
#ifndef __LONG_DOUBLE_128__ #ifndef __LONG_DOUBLE_128__
# error "compiler did not predefine __LONG_DOUBLE_128__ as expected" # error "compiler did not predefine __LONG_DOUBLE_128__ as expected"
#endif #endif
long double foobar (long double x) { return x; }], long double foobar (long double x) { return x; }]])],
libc_cv_mlong_double_128=yes, [libc_cv_mlong_double_128=yes],
libc_cv_mlong_double_128=no) [libc_cv_mlong_double_128=no])
CFLAGS="$save_CFLAGS"]) CFLAGS="$save_CFLAGS"])
if test "$libc_cv_mlong_double_128" = no; then if test "$libc_cv_mlong_double_128" = no; then
AC_MSG_ERROR([this configuration requires -mlong-double-128 support]) AC_MSG_ERROR([this configuration requires -mlong-double-128 support])

View File

@ -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 # ac_fn_c_check_header_preproc LINENO HEADER VAR
# ---------------------------------------------- # ----------------------------------------------
# Tests whether HEADER is present, setting the cache variable VAR accordingly. # Tests whether HEADER is present, setting the cache variable VAR accordingly.

View File

@ -25,8 +25,8 @@ dnl If not, compile with -Dfoo_t=bar_t.
dnl dnl
AC_DEFUN([mach_TYPE_CHECK], [dnl AC_DEFUN([mach_TYPE_CHECK], [dnl
AC_CACHE_CHECK(for $1 in mach/mach_types.h, libc_cv_mach_$1, 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;], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/mach_types.h>]], [[extern $1 foo;]])],
libc_cv_mach_$1=$1, libc_cv_mach_$1=$2)) [libc_cv_mach_$1=$1], [libc_cv_mach_$1=$2]))
if test [$]libc_cv_mach_$1 != $1; then if test [$]libc_cv_mach_$1 != $1; then
DEFINES="$DEFINES -D$1=$2" DEFINES="$DEFINES -D$1=$2"
fi]) fi])
@ -42,10 +42,10 @@ dnl The creation_time field is a GNU Mach addition the other variants lack.
dnl dnl
AC_CACHE_CHECK(for creation_time in task_basic_info, AC_CACHE_CHECK(for creation_time in task_basic_info,
libc_cv_mach_task_creation_time, [dnl 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; extern struct task_basic_info *i;
long s = i->creation_time.seconds; 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 if test $libc_cv_mach_task_creation_time = no; then
AC_MSG_ERROR([you need Mach headers supporting task_info.creation_time]) AC_MSG_ERROR([you need Mach headers supporting task_info.creation_time])
fi fi

View File

@ -9,6 +9,7 @@ if test -n "$sysheaders"; then
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Hurd header version" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Hurd header version" >&5
$as_echo_n "checking Hurd header version... " >&6; } $as_echo_n "checking Hurd header version... " >&6; }
if ${libc_cv_hurd_version+:} false; then : if ${libc_cv_hurd_version+:} false; then :
@ -29,12 +30,12 @@ main ()
return 0; return 0;
} }
_ACEOF _ACEOF
if ac_fn_c_try_compile "$LINENO"; then : if ac_fn_c_try_cpp "$LINENO"; then :
libc_cv_hurd_version=ok libc_cv_hurd_version=ok
else else
libc_cv_hurd_version=bad libc_cv_hurd_version=bad
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f conftest.err conftest.i conftest.$ac_ext
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_hurd_version" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_hurd_version" >&5
$as_echo "$libc_cv_hurd_version" >&6; } $as_echo "$libc_cv_hurd_version" >&6; }

View File

@ -11,14 +11,14 @@ if test -n "$sysheaders"; then
fi fi
AC_CACHE_CHECK(Hurd header version, libc_cv_hurd_version, [dnl AC_CACHE_CHECK(Hurd header version, libc_cv_hurd_version, [dnl
AC_TRY_COMPILE(dnl AC_PREPROC_IFELSE([AC_LANG_PROGRAM(dnl
[#include <hurd/version.h>], [ [[#include <hurd/version.h>]], [[
#define NEED_VERSION 20020609 #define NEED_VERSION 20020609
#if HURD_INTERFACE_VERSION < NEED_VERSION #if HURD_INTERFACE_VERSION < NEED_VERSION
# error Hurd version too old: HURD_INTERFACE_VERSION < NEED_VERSION # error Hurd version too old: HURD_INTERFACE_VERSION < NEED_VERSION
#endif], #endif]])],
libc_cv_hurd_version=ok, [libc_cv_hurd_version=ok],
libc_cv_hurd_version=bad)]) [libc_cv_hurd_version=bad])])
if test "x$libc_cv_hurd_version" != xok; then if test "x$libc_cv_hurd_version" != xok; then
AC_MSG_ERROR(Hurd headers not installed or too old) AC_MSG_ERROR(Hurd headers not installed or too old)
fi fi

View File

@ -301,6 +301,7 @@ then
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC is sufficient to build libc on s390x" >&5 { $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; } $as_echo_n "checking if $CC is sufficient to build libc on s390x... " >&6; }
if ${libc_cv_compiler_ok_on_s390x+:} false; then : if ${libc_cv_compiler_ok_on_s390x+:} false; then :
@ -322,12 +323,12 @@ main ()
return 0; return 0;
} }
_ACEOF _ACEOF
if ac_fn_c_try_compile "$LINENO"; then : if ac_fn_c_try_cpp "$LINENO"; then :
libc_cv_compiler_ok_on_s390x=yes libc_cv_compiler_ok_on_s390x=yes
else else
libc_cv_compiler_ok_on_s390x=no libc_cv_compiler_ok_on_s390x=no
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f conftest.err conftest.i conftest.$ac_ext
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok_on_s390x" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok_on_s390x" >&5
$as_echo "$libc_cv_compiler_ok_on_s390x" >&6; } $as_echo "$libc_cv_compiler_ok_on_s390x" >&6; }

View File

@ -222,11 +222,11 @@ dnl overflow
dnl (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269) dnl (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269)
AC_CACHE_CHECK([if $CC is sufficient to build libc on s390x], AC_CACHE_CHECK([if $CC is sufficient to build libc on s390x],
libc_cv_compiler_ok_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) #if !defined __GNUC__ || __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 1)
#error insufficient compiler for building on s390x #error insufficient compiler for building on s390x
#endif #endif
], ]])],
[libc_cv_compiler_ok_on_s390x=yes], [libc_cv_compiler_ok_on_s390x=yes],
[libc_cv_compiler_ok_on_s390x=no])]) [libc_cv_compiler_ok_on_s390x=no])])
if test "$libc_cv_compiler_ok_on_s390x" != yes; then if test "$libc_cv_compiler_ok_on_s390x" != yes; then

View File

@ -6,6 +6,7 @@ if test -n "$sysheaders"; then
CPPFLAGS="$CPPFLAGS $SYSINCLUDES" CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking installed Linux kernel header files" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking installed Linux kernel header files" >&5
$as_echo_n "checking installed Linux kernel header files... " >&6; } $as_echo_n "checking installed Linux kernel header files... " >&6; }
if ${libc_cv_linux320+:} false; then : if ${libc_cv_linux320+:} false; then :
@ -25,12 +26,12 @@ main ()
return 0; return 0;
} }
_ACEOF _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' libc_cv_linux320='3.2.0 or later'
else else
libc_cv_linux320='missing or too old!' libc_cv_linux320='missing or too old!'
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f conftest.err conftest.i conftest.$ac_ext
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_linux320" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_linux320" >&5
$as_echo "$libc_cv_linux320" >&6; } $as_echo "$libc_cv_linux320" >&6; }
@ -84,12 +85,12 @@ main ()
return 0; return 0;
} }
_ACEOF _ACEOF
if ac_fn_c_try_compile "$LINENO"; then : if ac_fn_c_try_cpp "$LINENO"; then :
libc_minimum_kernel=ok libc_minimum_kernel=ok
else else
libc_minimum_kernel='too old!' libc_minimum_kernel='too old!'
fi 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 "$as_me:${as_lineno-$LINENO}: result: $libc_minimum_kernel" >&5
$as_echo "$libc_minimum_kernel" >&6; } $as_echo "$libc_minimum_kernel" >&6; }
if test "$libc_minimum_kernel" = ok; then if test "$libc_minimum_kernel" = ok; then

View File

@ -8,12 +8,12 @@ if test -n "$sysheaders"; then
fi fi
define([libc_cv_linuxVER], [libc_cv_linux]patsubst(LIBC_LINUX_VERSION,[\.]))dnl 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_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 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < ]dnl
patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
[ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[ [ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
# error kernel headers missing or too old # error kernel headers missing or too old
#endif], [], #endif]], [[]])],
[libc_cv_linuxVER='LIBC_LINUX_VERSION or later'], [libc_cv_linuxVER='LIBC_LINUX_VERSION or later'],
[libc_cv_linuxVER='missing or too old!'])]) [libc_cv_linuxVER='missing or too old!'])])
if test "$libc_cv_linuxVER" != 'LIBC_LINUX_VERSION or later'; then 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)/'`; 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/'`; abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
changequote([,])dnl changequote([,])dnl
AC_TRY_COMPILE([#include <linux/version.h> AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <linux/version.h>
#if LINUX_VERSION_CODE < $decnum #if LINUX_VERSION_CODE < $decnum
# error kernel headers too old # 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) AC_MSG_RESULT($libc_minimum_kernel)
if test "$libc_minimum_kernel" = ok; then if test "$libc_minimum_kernel" = ok; then
AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum) AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)

View File

@ -6,11 +6,11 @@ AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
libc_cv_mlong_double_128ibm, [dnl libc_cv_mlong_double_128ibm, [dnl
save_CFLAGS="$CFLAGS" save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -mlong-double-128" 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 #if LDBL_MANT_DIG != 106
# error "compiler doesn't implement IBM extended format of long double" # error "compiler doesn't implement IBM extended format of long double"
#endif #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=yes,
libc_cv_mlong_double_128ibm=no) libc_cv_mlong_double_128ibm=no)
CFLAGS="$save_CFLAGS"]) CFLAGS="$save_CFLAGS"])
@ -20,11 +20,11 @@ if test "$libc_cv_mlong_double_128ibm" = no; then
libc_cv_mabi_ibmlongdouble, [dnl libc_cv_mabi_ibmlongdouble, [dnl
save_CFLAGS="$CFLAGS" save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -mlong-double-128 -mabi=ibmlongdouble" 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 #if LDBL_MANT_DIG != 106
# error "compiler doesn't implement IBM extended format of long double" # error "compiler doesn't implement IBM extended format of long double"
#endif #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=yes,
libc_cv_mabi_ibmlongdouble=no) libc_cv_mabi_ibmlongdouble=no)
CFLAGS="$save_CFLAGS"]) CFLAGS="$save_CFLAGS"])