replace AC_TRY_COMPILE with AC_COMPILE_IFELSE

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14149 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2004-08-25 14:19:39 +00:00
parent f472715da0
commit f5da09d81b
4 changed files with 31 additions and 36 deletions

View File

@@ -2,7 +2,7 @@
include $(top_srcdir)/Makefile.am.common
INCLUDES += $(INCLUDE_readline) $(INCLUDE_des)
AM_CPPFLAGS += $(INCLUDE_readline) $(INCLUDE_des)
man_MANS = ktutil.8

View File

@@ -9,10 +9,7 @@ dnl
AC_DEFUN([AC_C___ATTRIBUTE__], [
AC_MSG_CHECKING(for __attribute__)
AC_CACHE_VAL(ac_cv___attribute__, [
AC_TRY_COMPILE([
#include <stdlib.h>
],
[
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>]],[[
static void foo(void) __attribute__ ((noreturn));
static void
@@ -20,9 +17,9 @@ foo(void)
{
exit(1);
}
],
ac_cv___attribute__=yes,
ac_cv___attribute__=no)])
]])],
[ac_cv___attribute__=yes],
[ac_cv___attribute__=no])])
if test "$ac_cv___attribute__" = "yes"; then
AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
fi

View File

@@ -8,12 +8,10 @@ dnl AC_HAVE_DECLARATION(includes, variable)
AC_DEFUN([AC_CHECK_DECLARATION], [
AC_MSG_CHECKING([if $2 is properly declared])
AC_CACHE_VAL(ac_cv_var_$2_declaration, [
AC_TRY_COMPILE([$1
extern struct { int foo; } $2;],
[$2.foo = 1;],
eval "ac_cv_var_$2_declaration=no",
eval "ac_cv_var_$2_declaration=yes")
])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[$1
extern struct { int foo; } $2;]],[[$2.foo = 1;]])],
[eval "ac_cv_var_$2_declaration=no"],
[eval "ac_cv_var_$2_declaration=yes"])])
define(foo, [HAVE_]translit($2, [a-z], [A-Z])[_DECLARATION])

View File

@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_REVISION($Revision$)
AC_PREREQ(2.53)
test -z "$CFLAGS" && CFLAGS="-g"
AC_INIT(Heimdal, 0.7pre, heimdal-bugs@pdc.kth.se)
AC_INIT(Heimdal,0.7pre,heimdal-bugs@pdc.kth.se)
AC_CONFIG_SRCDIR([kuser/kinit.c])
AM_CONFIG_HEADER(include/config.h)
@@ -76,11 +76,11 @@ if test "$with_krb4" != "no"; then
EXTRA_LIB45=lib45.a
AC_SUBST(EXTRA_LIB45)
AC_CACHE_CHECK(for four valued krb_put_int, ac_cv_func_krb_put_int_four,
[AC_TRY_COMPILE([#include <krb.h>],[
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>]], [[
char tmp[4];
krb_put_int(17, tmp, 4, sizeof(tmp));],
ac_cv_func_krb_put_int_four=yes,
ac_cv_func_krb_put_int_four=no)
krb_put_int(17, tmp, 4, sizeof(tmp));]])],
[ac_cv_func_krb_put_int_four=yes],
[ac_cv_func_krb_put_int_four=no])
])
if test "$ac_cv_func_krb_put_int_four" = yes; then
AC_DEFINE(HAVE_FOUR_VALUED_KRB_PUT_INT, 1,
@@ -93,10 +93,10 @@ if test "$with_krb4" != "no"; then
#endif
])
AC_CACHE_CHECK(for KRB_VERIFY_SECURE, ac_cv_func_krb_verify_secure,
[AC_TRY_COMPILE([#include <krb.h>],[
int x = KRB_VERIFY_SECURE],
ac_cv_func_krb_verify_secure=yes,
ac_cv_func_krb_verify_secure=no)
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>]], [[
int x = KRB_VERIFY_SECURE]])],
[ac_cv_func_krb_verify_secure=yes],
[ac_cv_func_krb_verify_secure=no])
])
if test "$ac_cv_func_krb_verify_secure" != yes; then
AC_DEFINE(KRB_VERIFY_SECURE, 1,
@@ -106,10 +106,10 @@ if test "$with_krb4" != "no"; then
fi
AC_CACHE_CHECK(for KRB_VERIFY_NOT_SECURE,
ac_cv_func_krb_verify_not_secure,
[AC_TRY_COMPILE([#include <krb.h>],[
int x = KRB_VERIFY_NOT_SECURE],
ac_cv_func_krb_verify_not_secure=yes,
ac_cv_func_krb_verify_not_secure=no)
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>]], [[
int x = KRB_VERIFY_NOT_SECURE]])],
[ac_cv_func_krb_verify_not_secure=yes],
[ac_cv_func_krb_verify_not_secure=no])
])
if test "$ac_cv_func_krb_verify_not_secure" != yes; then
AC_DEFINE(KRB_VERIFY_NOT_SECURE, 0,
@@ -130,11 +130,11 @@ if test "$with_krb4" != "no"; then
#endif])
AC_CACHE_CHECK([for KRB_SENDAUTH_VERS],
ac_cv_func_krb_sendauth_vers,
[AC_TRY_COMPILE([#include <krb.h>
#include <prot.h>],[
char *x = KRB_SENDAUTH_VERS],
ac_cv_func_krb_sendauth_vers=yes,
ac_cv_func_krb_sendauth_vers=no)
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>
#include <prot.h>]], [[
char *x = KRB_SENDAUTH_VERS]])],
[ac_cv_func_krb_sendauth_vers=yes],
[ac_cv_func_krb_sendauth_vers=no])
])
if test "$ac_cv_func_krb_sendauth_vers" != yes; then
AC_DEFINE(KRB_SENDAUTH_VERS, ["AUTHV0.1"],
@@ -142,12 +142,12 @@ if test "$with_krb4" != "no"; then
fi
AC_CACHE_CHECK(for krb_mk_req with const arguments,
ac_cv_func_krb_mk_req_const,
[AC_TRY_COMPILE([#include <krb.h>
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>
int krb_mk_req(KTEXT a, const char *s, const char *i,
const char *r, int32_t checksum)
{ return 17; }], [],
ac_cv_func_krb_mk_req_const=yes,
ac_cv_func_krb_mk_req_const=no)
{ return 17; }]], [[]])],
[ac_cv_func_krb_mk_req_const=yes],
[ac_cv_func_krb_mk_req_const=no])
])
if test "$ac_cv_func_krb_mk_req_const" = "yes"; then
AC_DEFINE(KRB_MK_REQ_CONST, 1,