From 4560513573a90e6074616eff60dafb60d9bc26da Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Wed, 25 Aug 2004 14:30:18 +0000 Subject: [PATCH] replace AC_TRY_COMPILE with AC_COMPILE_IFELSE git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14151 ec53bebd-3082-4978-b11e-865c3cabbd6b --- cf/have-struct-field.m4 | 6 +++--- cf/have-type.m4 | 12 ++++++------ cf/krb-bigendian.m4 | 14 +++++++------- cf/krb-readline.m4 | 10 +++++----- cf/krb-struct-spwd.m4 | 11 +++++------ cf/mips-abi.m4 | 4 ++-- cf/need-proto.m4 | 10 +++++----- cf/proto-compat.m4 | 7 +++---- cf/test-package.m4 | 2 +- cf/vararray.m4 | 3 +-- 10 files changed, 38 insertions(+), 41 deletions(-) diff --git a/cf/have-struct-field.m4 b/cf/have-struct-field.m4 index a31187aec..6c9aeb1bb 100644 --- a/cf/have-struct-field.m4 +++ b/cf/have-struct-field.m4 @@ -7,9 +7,9 @@ dnl AC_HAVE_STRUCT_FIELD(struct, field, headers) AC_DEFUN([AC_HAVE_STRUCT_FIELD], [ define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_])) AC_CACHE_CHECK([for $2 in $1], cache_val,[ -AC_TRY_COMPILE([$3],[$1 x; x.$2;], -cache_val=yes, -cache_val=no)]) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[$3]],[[$1 x; x.$2]])], +[cache_val=yes], +[cache_val=no])]) if test "$cache_val" = yes; then define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_])) AC_DEFINE(foo, 1, [Define if $1 has field $2.]) diff --git a/cf/have-type.m4 b/cf/have-type.m4 index d0042ea72..42140dd4e 100644 --- a/cf/have-type.m4 +++ b/cf/have-type.m4 @@ -8,16 +8,16 @@ AC_REQUIRE([AC_HEADER_STDC]) cv=`echo "$1" | sed 'y%./+- %__p__%'` AC_MSG_CHECKING(for $1) AC_CACHE_VAL([ac_cv_type_$cv], -AC_TRY_COMPILE( -[#include +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include #if STDC_HEADERS #include #include #endif -$2], -[$1 foo;], -eval "ac_cv_type_$cv=yes", -eval "ac_cv_type_$cv=no"))dnl +$2]], +[[$1 foo;]])], +[eval "ac_cv_type_$cv=yes"], +[eval "ac_cv_type_$cv=no"]))dnl ac_foo=`eval echo \\$ac_cv_type_$cv` AC_MSG_RESULT($ac_foo) if test "$ac_foo" = yes; then diff --git a/cf/krb-bigendian.m4 b/cf/krb-bigendian.m4 index 780274efb..67177b6d9 100644 --- a/cf/krb-bigendian.m4 +++ b/cf/krb-bigendian.m4 @@ -14,22 +14,22 @@ krb_cv_c_bigendian=yes) AC_ARG_ENABLE(littleendian, AS_HELP_STRING([--enable-littleendian],[the target is little endian]), krb_cv_c_bigendian=no) -AC_CACHE_CHECK(whether byte order is known at compile time, +AC_CACHE_CHECK([whether byte order is known at compile time], krb_cv_c_bigendian_compile, -[AC_TRY_COMPILE([ +[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #include -#include ],[ +#include ]],[[ #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros -#endif], krb_cv_c_bigendian_compile=yes, krb_cv_c_bigendian_compile=no)]) +#endif]])],[krb_cv_c_bigendian_compile=yes],[krb_cv_c_bigendian_compile=no])]) AC_CACHE_CHECK(whether byte ordering is bigendian, krb_cv_c_bigendian,[ if test "$krb_cv_c_bigendian_compile" = "yes"; then - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #include -#include ],[ +#include ]],[[ #if BYTE_ORDER != BIG_ENDIAN not big endian -#endif], krb_cv_c_bigendian=yes, krb_cv_c_bigendian=no) +#endif]])],[krb_cv_c_bigendian=yes],[krb_cv_c_bigendian=no]) else AC_TRY_RUN([main () { /* Are we little or big endian? From Harbison&Steele. */ diff --git a/cf/krb-readline.m4 b/cf/krb-readline.m4 index 57042c3ea..ba1dbabf0 100644 --- a/cf/krb-readline.m4 +++ b/cf/krb-readline.m4 @@ -9,11 +9,11 @@ AC_DEFUN([KRB_READLINE],[ AC_FIND_FUNC_NO_LIBS(el_init, edit, [], [], [$LIB_tgetent]) if test "$ac_cv_func_el_init" = yes ; then AC_CACHE_CHECK(for four argument el_init, ac_cv_func_el_init_four,[ - AC_TRY_COMPILE([#include - #include ], - [el_init("", NULL, NULL, NULL);], - ac_cv_func_el_init_four=yes, - ac_cv_func_el_init_four=no)]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include + #include ]], + [[el_init("", NULL, NULL, NULL);]])], + [ac_cv_func_el_init_four=yes], + [ac_cv_func_el_init_four=no])]) if test "$ac_cv_func_el_init_four" = yes; then AC_DEFINE(HAVE_FOUR_VALUED_EL_INIT, 1, [Define if el_init takes four arguments.]) fi diff --git a/cf/krb-struct-spwd.m4 b/cf/krb-struct-spwd.m4 index fe5f39192..a12db49bf 100644 --- a/cf/krb-struct-spwd.m4 +++ b/cf/krb-struct-spwd.m4 @@ -5,14 +5,13 @@ dnl Test for `struct spwd' AC_DEFUN([AC_KRB_STRUCT_SPWD], [ AC_MSG_CHECKING(for struct spwd) AC_CACHE_VAL(ac_cv_struct_spwd, [ -AC_TRY_COMPILE( -[#include +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include #ifdef HAVE_SHADOW_H #include -#endif], -[struct spwd foo;], -ac_cv_struct_spwd=yes, -ac_cv_struct_spwd=no) +#endif]],[[struct spwd foo;]])], +[ac_cv_struct_spwd=yes], +[ac_cv_struct_spwd=no]) ]) AC_MSG_RESULT($ac_cv_struct_spwd) diff --git a/cf/mips-abi.m4 b/cf/mips-abi.m4 index 441748983..e65a00539 100644 --- a/cf/mips-abi.m4 +++ b/cf/mips-abi.m4 @@ -39,7 +39,7 @@ AC_MSG_CHECKING([if $CC supports the $abi option]) AC_CACHE_VAL($ac_foo, [ save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $abi" -AC_TRY_COMPILE(,int x;, eval $ac_foo=yes, eval $ac_foo=no) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]],[[int x;]])],[eval $ac_foo=yes], [eval $ac_foo=no])dnl CFLAGS="$save_CFLAGS" ]) ac_res=`eval echo \\\$$ac_foo` @@ -50,7 +50,7 @@ case $abi in -mabi=32) save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -mabi=n32" - AC_TRY_COMPILE(,int x;, ac_res=yes, ac_res=no) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]],[[int x;]])],[ac_res=yes],[ac_res=no])dnl CLAGS="$save_CFLAGS" if test $ac_res = yes; then # New GCC diff --git a/cf/need-proto.m4 b/cf/need-proto.m4 index ccc8687f8..57001a4f0 100644 --- a/cf/need-proto.m4 +++ b/cf/need-proto.m4 @@ -9,13 +9,13 @@ dnl AC_NEED_PROTO(includes, function) AC_DEFUN([AC_NEED_PROTO], [ if test "$ac_cv_func_$2+set" != set -o "$ac_cv_func_$2" = yes; then AC_CACHE_CHECK([if $2 needs a prototype], ac_cv_func_$2_noproto, -AC_TRY_COMPILE([$1], -[struct foo { int foo; } xx; +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[$1]], +[[struct foo { int foo; } xx; extern int $2 (struct foo*); $2(&xx); -], -eval "ac_cv_func_$2_noproto=yes", -eval "ac_cv_func_$2_noproto=no")) +]])], +[eval "ac_cv_func_$2_noproto=yes"], +[eval "ac_cv_func_$2_noproto=no"])) if test "$ac_cv_func_$2_noproto" = yes; then AC_DEFINE(AS_TR_CPP(NEED_[]$2[]_PROTO), 1, [define if the system is missing a prototype for $2()]) diff --git a/cf/proto-compat.m4 b/cf/proto-compat.m4 index d30d5893d..3ae25fd8a 100644 --- a/cf/proto-compat.m4 +++ b/cf/proto-compat.m4 @@ -9,10 +9,9 @@ dnl AC_PROTO_COMPAT(includes, function, prototype) AC_DEFUN([AC_PROTO_COMPAT], [ AC_CACHE_CHECK([if $2 is compatible with system prototype], ac_cv_func_$2_proto_compat, -AC_TRY_COMPILE([$1], -[$3;], -eval "ac_cv_func_$2_proto_compat=yes", -eval "ac_cv_func_$2_proto_compat=no")) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[$1]],[[$3]])], +[eval "ac_cv_func_$2_proto_compat=yes"], +[eval "ac_cv_func_$2_proto_compat=no"])) define([foo], translit($2, [a-z], [A-Z])[_PROTO_COMPATIBLE]) if test "$ac_cv_func_$2_proto_compat" = yes; then AC_DEFINE(foo, 1, [define if prototype of $2 is compatible with diff --git a/cf/test-package.m4 b/cf/test-package.m4 index 6855328f1..58218d21e 100644 --- a/cf/test-package.m4 +++ b/cf/test-package.m4 @@ -101,7 +101,7 @@ if test "$with_$1" != no; then ires= lres= for i in $header_dirs; do CFLAGS="-I$i $save_CFLAGS" - AC_TRY_COMPILE([$2],,ires=$i;break) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[$2]],[[]])],[ires=$i;break]) done for i in $lib_dirs; do LIBS="-L$i $3 $4 $save_LIBS" diff --git a/cf/vararray.m4 b/cf/vararray.m4 index bc218d6ba..290f1106d 100644 --- a/cf/vararray.m4 +++ b/cf/vararray.m4 @@ -6,8 +6,7 @@ dnl AC_DEFUN([rk_C_VARARRAY], [ AC_CACHE_CHECK([if the compiler supports variable-length arrays],[rk_cv_c_vararray],[ - AC_TRY_COMPILE([], - [int x = 0; { int y[x]; }], + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]],[[int x = 0; { int y[x]; }]])], [rk_cv_c_vararray=yes], [rk_cv_c_vararray=no])]) if test "$rk_cv_c_vararray" = yes; then