replace AC_CHECK_DECLARATION with standard AC_CHECK_DECL(S)

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14171 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2004-08-26 15:12:17 +00:00
parent 970edde9f8
commit e4f79c6902
3 changed files with 4 additions and 40 deletions

View File

@@ -1,23 +0,0 @@
dnl $Id$
dnl
dnl
dnl Check if we need the declaration of a variable
dnl
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_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])
AC_MSG_RESULT($ac_cv_var_$2_declaration)
if eval "test \"\$ac_cv_var_$2_declaration\" = yes"; then
AC_DEFINE(foo, 1, [define if your system declares $2])
fi
undefine([foo])
])

View File

@@ -19,7 +19,7 @@ AC_MSG_RESULT($ac_foo)
if test "$ac_foo" = yes; then
AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]$1), 1,
[Define if you have the `]$1[' variable.])
m4_ifval([$2], AC_CHECK_DECLARATION([$2],[$1]))
m4_ifval([$2], AC_CHECK_DECL([$1],[],[],[$2]))
fi
])

View File

@@ -611,24 +611,11 @@ rk_CHECK_VAR([__progname],
#include <err.h>
#endif])
AC_CHECK_DECLARATION([#include <stdlib.h>
AC_CHECK_DECLS([optarg, optind, opterr, optopt, environ],[],[][
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif], optarg)
AC_CHECK_DECLARATION([#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif], optind)
AC_CHECK_DECLARATION([#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif], opterr)
AC_CHECK_DECLARATION([#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif], optopt)
AC_CHECK_DECLARATION([#include <stdlib.h>], environ)
#endif])
dnl
dnl Check for fields in struct tm