replace AC_TRY_COMPILE with AC_COMPILE_IFELSE
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14151 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -7,9 +7,9 @@ dnl AC_HAVE_STRUCT_FIELD(struct, field, headers)
|
|||||||
AC_DEFUN([AC_HAVE_STRUCT_FIELD], [
|
AC_DEFUN([AC_HAVE_STRUCT_FIELD], [
|
||||||
define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_]))
|
define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_]))
|
||||||
AC_CACHE_CHECK([for $2 in $1], cache_val,[
|
AC_CACHE_CHECK([for $2 in $1], cache_val,[
|
||||||
AC_TRY_COMPILE([$3],[$1 x; x.$2;],
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[$3]],[[$1 x; x.$2]])],
|
||||||
cache_val=yes,
|
[cache_val=yes],
|
||||||
cache_val=no)])
|
[cache_val=no])])
|
||||||
if test "$cache_val" = yes; then
|
if test "$cache_val" = yes; then
|
||||||
define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_]))
|
define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_]))
|
||||||
AC_DEFINE(foo, 1, [Define if $1 has field $2.])
|
AC_DEFINE(foo, 1, [Define if $1 has field $2.])
|
||||||
|
@@ -8,16 +8,16 @@ AC_REQUIRE([AC_HEADER_STDC])
|
|||||||
cv=`echo "$1" | sed 'y%./+- %__p__%'`
|
cv=`echo "$1" | sed 'y%./+- %__p__%'`
|
||||||
AC_MSG_CHECKING(for $1)
|
AC_MSG_CHECKING(for $1)
|
||||||
AC_CACHE_VAL([ac_cv_type_$cv],
|
AC_CACHE_VAL([ac_cv_type_$cv],
|
||||||
AC_TRY_COMPILE(
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
[#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#if STDC_HEADERS
|
#if STDC_HEADERS
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#endif
|
#endif
|
||||||
$2],
|
$2]],
|
||||||
[$1 foo;],
|
[[$1 foo;]])],
|
||||||
eval "ac_cv_type_$cv=yes",
|
[eval "ac_cv_type_$cv=yes"],
|
||||||
eval "ac_cv_type_$cv=no"))dnl
|
[eval "ac_cv_type_$cv=no"]))dnl
|
||||||
ac_foo=`eval echo \\$ac_cv_type_$cv`
|
ac_foo=`eval echo \\$ac_cv_type_$cv`
|
||||||
AC_MSG_RESULT($ac_foo)
|
AC_MSG_RESULT($ac_foo)
|
||||||
if test "$ac_foo" = yes; then
|
if test "$ac_foo" = yes; then
|
||||||
|
@@ -14,22 +14,22 @@ krb_cv_c_bigendian=yes)
|
|||||||
AC_ARG_ENABLE(littleendian,
|
AC_ARG_ENABLE(littleendian,
|
||||||
AS_HELP_STRING([--enable-littleendian],[the target is little endian]),
|
AS_HELP_STRING([--enable-littleendian],[the target is little endian]),
|
||||||
krb_cv_c_bigendian=no)
|
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,
|
krb_cv_c_bigendian_compile,
|
||||||
[AC_TRY_COMPILE([
|
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>],[
|
#include <sys/param.h>]],[[
|
||||||
#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
|
#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
|
||||||
bogus endian macros
|
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,[
|
AC_CACHE_CHECK(whether byte ordering is bigendian, krb_cv_c_bigendian,[
|
||||||
if test "$krb_cv_c_bigendian_compile" = "yes"; then
|
if test "$krb_cv_c_bigendian_compile" = "yes"; then
|
||||||
AC_TRY_COMPILE([
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>],[
|
#include <sys/param.h>]],[[
|
||||||
#if BYTE_ORDER != BIG_ENDIAN
|
#if BYTE_ORDER != BIG_ENDIAN
|
||||||
not 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
|
else
|
||||||
AC_TRY_RUN([main () {
|
AC_TRY_RUN([main () {
|
||||||
/* Are we little or big endian? From Harbison&Steele. */
|
/* Are we little or big endian? From Harbison&Steele. */
|
||||||
|
@@ -9,11 +9,11 @@ AC_DEFUN([KRB_READLINE],[
|
|||||||
AC_FIND_FUNC_NO_LIBS(el_init, edit, [], [], [$LIB_tgetent])
|
AC_FIND_FUNC_NO_LIBS(el_init, edit, [], [], [$LIB_tgetent])
|
||||||
if test "$ac_cv_func_el_init" = yes ; then
|
if test "$ac_cv_func_el_init" = yes ; then
|
||||||
AC_CACHE_CHECK(for four argument el_init, ac_cv_func_el_init_four,[
|
AC_CACHE_CHECK(for four argument el_init, ac_cv_func_el_init_four,[
|
||||||
AC_TRY_COMPILE([#include <stdio.h>
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
|
||||||
#include <histedit.h>],
|
#include <histedit.h>]],
|
||||||
[el_init("", NULL, NULL, NULL);],
|
[[el_init("", NULL, NULL, NULL);]])],
|
||||||
ac_cv_func_el_init_four=yes,
|
[ac_cv_func_el_init_four=yes],
|
||||||
ac_cv_func_el_init_four=no)])
|
[ac_cv_func_el_init_four=no])])
|
||||||
if test "$ac_cv_func_el_init_four" = yes; then
|
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.])
|
AC_DEFINE(HAVE_FOUR_VALUED_EL_INIT, 1, [Define if el_init takes four arguments.])
|
||||||
fi
|
fi
|
||||||
|
@@ -5,14 +5,13 @@ dnl Test for `struct spwd'
|
|||||||
AC_DEFUN([AC_KRB_STRUCT_SPWD], [
|
AC_DEFUN([AC_KRB_STRUCT_SPWD], [
|
||||||
AC_MSG_CHECKING(for struct spwd)
|
AC_MSG_CHECKING(for struct spwd)
|
||||||
AC_CACHE_VAL(ac_cv_struct_spwd, [
|
AC_CACHE_VAL(ac_cv_struct_spwd, [
|
||||||
AC_TRY_COMPILE(
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
[#include <pwd.h>
|
#include <pwd.h>
|
||||||
#ifdef HAVE_SHADOW_H
|
#ifdef HAVE_SHADOW_H
|
||||||
#include <shadow.h>
|
#include <shadow.h>
|
||||||
#endif],
|
#endif]],[[struct spwd foo;]])],
|
||||||
[struct spwd foo;],
|
[ac_cv_struct_spwd=yes],
|
||||||
ac_cv_struct_spwd=yes,
|
[ac_cv_struct_spwd=no])
|
||||||
ac_cv_struct_spwd=no)
|
|
||||||
])
|
])
|
||||||
AC_MSG_RESULT($ac_cv_struct_spwd)
|
AC_MSG_RESULT($ac_cv_struct_spwd)
|
||||||
|
|
||||||
|
@@ -39,7 +39,7 @@ AC_MSG_CHECKING([if $CC supports the $abi option])
|
|||||||
AC_CACHE_VAL($ac_foo, [
|
AC_CACHE_VAL($ac_foo, [
|
||||||
save_CFLAGS="$CFLAGS"
|
save_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CFLAGS $abi"
|
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"
|
CFLAGS="$save_CFLAGS"
|
||||||
])
|
])
|
||||||
ac_res=`eval echo \\\$$ac_foo`
|
ac_res=`eval echo \\\$$ac_foo`
|
||||||
@@ -50,7 +50,7 @@ case $abi in
|
|||||||
-mabi=32)
|
-mabi=32)
|
||||||
save_CFLAGS="$CFLAGS"
|
save_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CFLAGS -mabi=n32"
|
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"
|
CLAGS="$save_CFLAGS"
|
||||||
if test $ac_res = yes; then
|
if test $ac_res = yes; then
|
||||||
# New GCC
|
# New GCC
|
||||||
|
@@ -9,13 +9,13 @@ dnl AC_NEED_PROTO(includes, function)
|
|||||||
AC_DEFUN([AC_NEED_PROTO], [
|
AC_DEFUN([AC_NEED_PROTO], [
|
||||||
if test "$ac_cv_func_$2+set" != set -o "$ac_cv_func_$2" = yes; then
|
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_CACHE_CHECK([if $2 needs a prototype], ac_cv_func_$2_noproto,
|
||||||
AC_TRY_COMPILE([$1],
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[$1]],
|
||||||
[struct foo { int foo; } xx;
|
[[struct foo { int foo; } xx;
|
||||||
extern int $2 (struct foo*);
|
extern int $2 (struct foo*);
|
||||||
$2(&xx);
|
$2(&xx);
|
||||||
],
|
]])],
|
||||||
eval "ac_cv_func_$2_noproto=yes",
|
[eval "ac_cv_func_$2_noproto=yes"],
|
||||||
eval "ac_cv_func_$2_noproto=no"))
|
[eval "ac_cv_func_$2_noproto=no"]))
|
||||||
if test "$ac_cv_func_$2_noproto" = yes; then
|
if test "$ac_cv_func_$2_noproto" = yes; then
|
||||||
AC_DEFINE(AS_TR_CPP(NEED_[]$2[]_PROTO), 1,
|
AC_DEFINE(AS_TR_CPP(NEED_[]$2[]_PROTO), 1,
|
||||||
[define if the system is missing a prototype for $2()])
|
[define if the system is missing a prototype for $2()])
|
||||||
|
@@ -9,10 +9,9 @@ dnl AC_PROTO_COMPAT(includes, function, prototype)
|
|||||||
AC_DEFUN([AC_PROTO_COMPAT], [
|
AC_DEFUN([AC_PROTO_COMPAT], [
|
||||||
AC_CACHE_CHECK([if $2 is compatible with system prototype],
|
AC_CACHE_CHECK([if $2 is compatible with system prototype],
|
||||||
ac_cv_func_$2_proto_compat,
|
ac_cv_func_$2_proto_compat,
|
||||||
AC_TRY_COMPILE([$1],
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[$1]],[[$3]])],
|
||||||
[$3;],
|
[eval "ac_cv_func_$2_proto_compat=yes"],
|
||||||
eval "ac_cv_func_$2_proto_compat=yes",
|
[eval "ac_cv_func_$2_proto_compat=no"]))
|
||||||
eval "ac_cv_func_$2_proto_compat=no"))
|
|
||||||
define([foo], translit($2, [a-z], [A-Z])[_PROTO_COMPATIBLE])
|
define([foo], translit($2, [a-z], [A-Z])[_PROTO_COMPATIBLE])
|
||||||
if test "$ac_cv_func_$2_proto_compat" = yes; then
|
if test "$ac_cv_func_$2_proto_compat" = yes; then
|
||||||
AC_DEFINE(foo, 1, [define if prototype of $2 is compatible with
|
AC_DEFINE(foo, 1, [define if prototype of $2 is compatible with
|
||||||
|
@@ -101,7 +101,7 @@ if test "$with_$1" != no; then
|
|||||||
ires= lres=
|
ires= lres=
|
||||||
for i in $header_dirs; do
|
for i in $header_dirs; do
|
||||||
CFLAGS="-I$i $save_CFLAGS"
|
CFLAGS="-I$i $save_CFLAGS"
|
||||||
AC_TRY_COMPILE([$2],,ires=$i;break)
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[$2]],[[]])],[ires=$i;break])
|
||||||
done
|
done
|
||||||
for i in $lib_dirs; do
|
for i in $lib_dirs; do
|
||||||
LIBS="-L$i $3 $4 $save_LIBS"
|
LIBS="-L$i $3 $4 $save_LIBS"
|
||||||
|
@@ -6,8 +6,7 @@ dnl
|
|||||||
|
|
||||||
AC_DEFUN([rk_C_VARARRAY], [
|
AC_DEFUN([rk_C_VARARRAY], [
|
||||||
AC_CACHE_CHECK([if the compiler supports variable-length arrays],[rk_cv_c_vararray],[
|
AC_CACHE_CHECK([if the compiler supports variable-length arrays],[rk_cv_c_vararray],[
|
||||||
AC_TRY_COMPILE([],
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]],[[int x = 0; { int y[x]; }]])],
|
||||||
[int x = 0; { int y[x]; }],
|
|
||||||
[rk_cv_c_vararray=yes],
|
[rk_cv_c_vararray=yes],
|
||||||
[rk_cv_c_vararray=no])])
|
[rk_cv_c_vararray=no])])
|
||||||
if test "$rk_cv_c_vararray" = yes; then
|
if test "$rk_cv_c_vararray" = yes; then
|
||||||
|
Reference in New Issue
Block a user