replace AC_TRY_RUN with AC_RUN_IFELSE

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14161 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2004-08-26 10:02:57 +00:00
parent b5411c5465
commit 820fc2c34e
10 changed files with 28 additions and 28 deletions

View File

@@ -4,7 +4,7 @@ dnl test if getaddrinfo can handle numeric services
AC_DEFUN([rk_BROKEN_GETADDRINFO],[
AC_CACHE_CHECK([if getaddrinfo handles numeric services], ac_cv_func_getaddrinfo_numserv,
AC_TRY_RUN([[#include <stdio.h>
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
@@ -21,4 +21,4 @@ main(int argc, char **argv)
return 1;
return 0;
}
]], ac_cv_func_getaddrinfo_numserv=yes, ac_cv_func_getaddrinfo_numserv=no))])
]])],[ac_cv_func_getaddrinfo_numserv=yes],[ac_cv_func_getaddrinfo_numserv=no]))])

View File

@@ -4,7 +4,7 @@ dnl test for broken AIX getnameinfo
AC_DEFUN([rk_BROKEN_GETNAMEINFO],[
AC_CACHE_CHECK([if getnameinfo is broken], ac_cv_func_getnameinfo_broken,
AC_TRY_RUN([[#include <stdio.h>
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -25,4 +25,4 @@ main(int argc, char **argv)
return getnameinfo((struct sockaddr*)&sin, sizeof(sin), host, sizeof(host),
NULL, 0, 0);
}
]], ac_cv_func_getnameinfo_broken=no, ac_cv_func_getnameinfo_broken=yes))])
]])], [ac_cv_func_getnameinfo_broken=no], [ac_cv_func_getnameinfo_broken=yes]))])

View File

@@ -6,7 +6,7 @@ dnl
AC_DEFUN([rk_BROKEN_REALLOC], [
AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
ac_cv_func_realloc_broken=no
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stddef.h>
#include <stdlib.h>
@@ -14,7 +14,7 @@ int main()
{
return realloc(NULL, 17) == NULL;
}
],:, ac_cv_func_realloc_broken=yes, :)
]])],[:], [ac_cv_func_realloc_broken=yes],[:])
])
if test "$ac_cv_func_realloc_broken" = yes ; then
AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.])

View File

@@ -3,7 +3,7 @@ dnl
AC_DEFUN([AC_BROKEN_SNPRINTF], [
AC_CACHE_CHECK(for working snprintf,ac_cv_func_snprintf_working,
ac_cv_func_snprintf_working=yes
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
int main()
@@ -11,7 +11,7 @@ int main()
char foo[[3]];
snprintf(foo, 2, "12");
return strcmp(foo, "1");
}],:,ac_cv_func_snprintf_working=no,:))
}]])],[:],[ac_cv_func_snprintf_working=no],[:]))
if test "$ac_cv_func_snprintf_working" = yes; then
AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [define if you have a working snprintf])
@@ -24,7 +24,7 @@ fi
AC_DEFUN([AC_BROKEN_VSNPRINTF],[
AC_CACHE_CHECK(for working vsnprintf,ac_cv_func_vsnprintf_working,
ac_cv_func_vsnprintf_working=yes
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
@@ -43,7 +43,7 @@ int foo(int num, ...)
int main()
{
return foo(0, "12");
}],:,ac_cv_func_vsnprintf_working=no,:))
}]])],[:],[ac_cv_func_vsnprintf_working=no],[:]))
if test "$ac_cv_func_vsnprintf_working" = yes; then
AC_DEFINE_UNQUOTED(HAVE_VSNPRINTF, 1, [define if you have a working vsnprintf])

View File

@@ -9,7 +9,7 @@ dnl
AC_DEFUN([AC_C___FUNCTION__], [
AC_MSG_CHECKING(for __FUNCTION__)
AC_CACHE_VAL(ac_cv___function__, [
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
static char *foo()
@@ -21,10 +21,10 @@ int main()
{
return strcmp(foo(), "foo") != 0;
}
],
ac_cv___function__=yes,
ac_cv___function__=no,
ac_cv___function__=no)])
]])],
[ac_cv___function__=yes],
[ac_cv___function__=no],
[ac_cv___function__=no])])
if test "$ac_cv___function__" = "yes"; then
AC_DEFINE(HAVE___FUNCTION__, 1, [define if your compiler has __FUNCTION__])
fi

View File

@@ -8,14 +8,14 @@ if test "$ac_cv_func_getpwnam_r" = yes; then
AC_CACHE_CHECK(if getpwnam_r is posix,ac_cv_func_getpwnam_r_posix,
ac_libs="$LIBS"
LIBS="$LIBS $LIB_getpwnam_r"
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <pwd.h>
int main()
{
struct passwd pw, *pwd;
return getpwnam_r("", &pw, NULL, 0, &pwd) < 0;
}
],ac_cv_func_getpwnam_r_posix=yes,ac_cv_func_getpwnam_r_posix=no,:)
]])],[ac_cv_func_getpwnam_r_posix=yes],[ac_cv_func_getpwnam_r_posix=no],[:])
LIBS="$ac_libs")
if test "$ac_cv_func_getpwnam_r_posix" = yes; then
AC_DEFINE(POSIX_GETPWNAM_R, 1, [Define if getpwnam_r has POSIX flavour.])

View File

@@ -158,7 +158,7 @@ fi # unknown
if test "$have_ndbm" = "yes"; then
AC_MSG_CHECKING([if ndbm is implemented with db])
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
#include <fcntl.h>
#if defined(HAVE_GDBM_NDBM_H)
@@ -177,7 +177,7 @@ int main()
return 1;
dbm_close(d);
return 0;
}],[
}]])],[
if test -f conftest.db; then
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_NEW_DB, 1, [Define if NDBM really is DB (creates files *.db)])

View File

@@ -31,7 +31,7 @@ AC_CACHE_CHECK(whether byte ordering is bigendian, krb_cv_c_bigendian,[
not big endian
#endif]])],[krb_cv_c_bigendian=yes],[krb_cv_c_bigendian=no])
else
AC_TRY_RUN([main () {
AC_RUN_IFELSE([AC_LANG_SOURCE([[main () {
/* Are we little or big endian? From Harbison&Steele. */
union
{
@@ -40,8 +40,8 @@ AC_CACHE_CHECK(whether byte ordering is bigendian, krb_cv_c_bigendian,[
} u;
u.l = 1;
exit (u.c[sizeof (long) - 1] == 1);
}], krb_cv_c_bigendian=no, krb_cv_c_bigendian=yes,
AC_MSG_ERROR([specify either --enable-bigendian or --enable-littleendian]))
}]])],[krb_cv_c_bigendian=no],[krb_cv_c_bigendian=yes],
[AC_MSG_ERROR([specify either --enable-bigendian or --enable-littleendian])])
fi
])
if test "$krb_cv_c_bigendian" = "yes"; then

View File

@@ -10,7 +10,7 @@ AC_MSG_CHECKING(if getcwd is broken)
AC_CACHE_VAL(ac_cv_func_getcwd_broken, [
ac_cv_func_getcwd_broken=no
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <errno.h>
char *getcwd(char*, int);
@@ -28,7 +28,7 @@ int main()
return 0;
return 1;
}
], ac_cv_func_getcwd_broken=yes,:,:)
]])], [ac_cv_func_getcwd_broken=yes],[:],[:])
])
if test "$ac_cv_func_getcwd_broken" = yes; then
AC_DEFINE(BROKEN_GETCWD, 1, [Define if getcwd is broken (like in SunOS 4).])dnl

View File

@@ -31,7 +31,7 @@ case "$host" in
AC_CHECK_FUNC(getmsg)
if test "$ac_cv_func_getmsg" = "yes"; then
AC_CACHE_CHECK([if getmsg works], ac_cv_func_getmsg_works,
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
#include <errno.h>
@@ -43,9 +43,9 @@ case "$host" in
return 1;
return 0;
}
], ac_cv_func_getmsg_works=yes,
ac_cv_func_getmsg_works=no,
ac_cv_func_getmsg_works=no))
]])], [ac_cv_func_getmsg_works=yes],
[ac_cv_func_getmsg_works=no],
[ac_cv_func_getmsg_works=no]))
if test "$ac_cv_func_getmsg_works" = "yes"; then
AC_DEFINE(HAVE_GETMSG, 1,
[Define if you have a working getmsg.])