dnl want to use automake right now.
AC_DEFUN([KRB5_AC_MAINTAINER_MODE],
[AC_ARG_ENABLE([maintainer-mode],
-AC_HELP_STRING([--enable-maintainer-mode],[enable rebuilding of source files, Makefiles, etc]),
-USE_MAINTAINER_MODE=$enableval,
-USE_MAINTAINER_MODE=no)
+ [AS_HELP_STRING([--enable-maintainer-mode],
+ [enable rebuilding of source files, Makefiles, etc])],
+ [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=no])
if test "$USE_MAINTAINER_MODE" = yes; then
MAINTAINER_MODE_TRUE=
MAINTAINER_MODE_FALSE='#'
AC_DEFUN([KRB5_AC_INITFINI],[
dnl Do we want initialization at load time?
AC_ARG_ENABLE([delayed-initialization],
-AC_HELP_STRING([--disable-delayed-initialization],initialize library code when loaded @<:@delay until first use@:>@), , enable_delayed_initialization=yes)
+ [AS_HELP_STRING([--disable-delayed-initialization],
+ [initialize library code when loaded @<:@delay until first use@:>@])],
+ [], [enable_delayed_initialization=yes])
case "$enable_delayed_initialization" in
yes)
AC_DEFINE(DELAY_INITIALIZER,1,[Define if library initialization should be delayed until first use]) ;;
dnl Hack for now.
AC_DEFUN([KRB5_AC_ENABLE_THREADS],[
AC_ARG_ENABLE([thread-support],
-AC_HELP_STRING([--disable-thread-support],don't enable thread support @<:@enabled@:>@), , enable_thread_support=yes)
+ [AS_HELP_STRING([--disable-thread-support],
+ [don't enable thread support @<:@enabled@:>@])],
+ [], [enable_thread_support=yes])
if test "$enable_thread_support" = yes ; then
AC_MSG_NOTICE(enabling thread support)
AC_DEFINE(ENABLE_THREADS,1,[Define if thread support enabled])
dnl
AC_DEFUN([DECLARE_SYS_ERRLIST],
[AC_CACHE_CHECK([for sys_errlist declaration], krb5_cv_decl_sys_errlist,
-[AC_TRY_COMPILE([#include <stdio.h>
-#include <errno.h>], [1+sys_nerr;],
-krb5_cv_decl_sys_errlist=yes, krb5_cv_decl_sys_errlist=no)])
+[AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdio.h>
+ #include <errno.h>
+ ]],
+ [[1+sys_nerr;]])],
+ [krb5_cv_decl_sys_errlist=yes], [krb5_cv_decl_sys_errlist=no])])
# assume sys_nerr won't be declared w/o being in libc
if test $krb5_cv_decl_sys_errlist = yes; then
AC_DEFINE(SYS_ERRLIST_DECLARED,1,[Define if sys_errlist is defined in errno.h])
# This means that sys_errlist is not declared in errno.h, but may still
# be in libc.
AC_CACHE_CHECK([for sys_errlist in libc], krb5_cv_var_sys_errlist,
- [AC_TRY_LINK([extern int sys_nerr;], [if (1+sys_nerr < 0) return 1;],
- krb5_cv_var_sys_errlist=yes, krb5_cv_var_sys_errlist=no;)])
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern int sys_nerr;]],
+ [[if (1+sys_nerr < 0) return 1;]])],
+ [krb5_cv_var_sys_errlist=yes], [krb5_cv_var_sys_errlist=no])])
if test $krb5_cv_var_sys_errlist = yes; then
AC_DEFINE(HAVE_SYS_ERRLIST,1,[Define if sys_errlist in libc])
# Do this cruft for backwards compatibility for now.
AC_DEFUN(CHECK_SIGPROCMASK,[
AC_MSG_CHECKING([for use of sigprocmask])
AC_CACHE_VAL(krb5_cv_func_sigprocmask_use,
-[AC_TRY_LINK([#include <signal.h>], [sigprocmask(SIG_SETMASK,0,0);],
- krb5_cv_func_sigprocmask_use=yes,
-AC_TRY_LINK([#include <signal.h>], [sigmask(1);],
- krb5_cv_func_sigprocmask_use=no, krb5_cv_func_sigprocmask_use=yes))])
+[AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <signal.h>
+ ]],
+ [[sigprocmask(SIG_SETMASK, 0, 0);]])],
+ [krb5_cv_func_sigprocmask_use=yes],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <signal.h>
+ ]],
+ [[sigmask(1);]])],
+ [krb5_cv_func_sigprocmask_use=no], [krb5_cv_func_sigprocmask_use=yes])])])
AC_MSG_RESULT($krb5_cv_func_sigprocmask_use)
if test $krb5_cv_func_sigprocmask_use = yes; then
AC_DEFINE(USE_SIGPROCMASK,1,[Define if sigprocmask should be used])
AC_MSG_CHECKING([if argument to wait is int *])
AC_CACHE_VAL(krb5_cv_struct_wait,
dnl Test for prototype clash - if there is none - then assume int * works
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/wait.h>
-extern pid_t wait(int *);],[], krb5_cv_struct_wait=no,dnl
-dnl Else fallback on old stuff
-[AC_TRY_COMPILE(
-[#include <sys/wait.h>], [union wait i;
-#ifdef WEXITSTATUS
- WEXITSTATUS (i);
-#endif
-],
- krb5_cv_struct_wait=yes, krb5_cv_struct_wait=no)])])
+[AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <sys/types.h>
+ #include <sys/wait.h>
+ extern pid_t wait(int *);]])],
+ [krb5_cv_struct_wait=no],
+ dnl Else fallback on old stuff
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/wait.h>
+ ]],
+ [[union wait i;
+ #ifdef WEXITSTATUS
+ WEXITSTATUS (i);
+ #endif
+ ]])],
+ [krb5_cv_struct_wait=yes], [krb5_cv_struct_wait=no])])])
AC_MSG_RESULT($krb5_cv_struct_wait)
if test $krb5_cv_struct_wait = no; then
AC_DEFINE(WAIT_USES_INT,1,[Define if wait takes int as a argument])
AC_CHECK_FUNC(sigprocmask,
AC_MSG_CHECKING(for sigset_t and POSIX_SIGNALS)
AC_CACHE_VAL(krb5_cv_type_sigset_t,
-[AC_TRY_COMPILE(
-[#include <signal.h>],
-[sigset_t x],
-krb5_cv_type_sigset_t=yes, krb5_cv_type_sigset_t=no)])
+[AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <signal.h>
+ ]],
+ [[sigset_t x]])],
+ [krb5_cv_type_sigset_t=yes], [krb5_cv_type_sigset_t=no])])
AC_MSG_RESULT($krb5_cv_type_sigset_t)
if test $krb5_cv_type_sigset_t = yes; then
AC_DEFINE(POSIX_SIGNALS,1,[Define if POSIX signal handling is used])
fi
)])dnl
dnl
-dnl check for signal type
-dnl
-dnl AC_RETSIGTYPE isn't quite right, but almost.
-AC_DEFUN(KRB5_SIGTYPE,[
-AC_MSG_CHECKING([POSIX signal handlers])
-AC_CACHE_VAL(krb5_cv_has_posix_signals,
-[AC_TRY_COMPILE(
-[#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-extern void (*signal ()) ();], [],
-krb5_cv_has_posix_signals=yes, krb5_cv_has_posix_signals=no)])
-AC_MSG_RESULT($krb5_cv_has_posix_signals)
-if test $krb5_cv_has_posix_signals = yes; then
- stype=void
- AC_DEFINE(POSIX_SIGTYPE, 1, [Define if POSIX signal handlers are used])
-else
- if test $ac_cv_type_signal = void; then
- stype=void
- else
- stype=int
- fi
-fi
-AC_DEFINE_UNQUOTED(krb5_sigtype, $stype, [Define krb5_sigtype to type of signal handler])dnl
-])dnl
-dnl
dnl check for POSIX setjmp/longjmp -- CHECK_SETJMP
dnl
AC_DEFUN(CHECK_SETJMP,[
AC_CHECK_FUNC(sigsetjmp,
AC_MSG_CHECKING(for sigjmp_buf)
AC_CACHE_VAL(krb5_cv_struct_sigjmp_buf,
-[AC_TRY_COMPILE(
-[#include <setjmp.h>],[sigjmp_buf x],
-krb5_cv_struct_sigjmp_buf=yes,krb5_cv_struct_sigjmp_buf=no)])
+[AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <setjmp.h>
+ ]],
+ [[sigjmp_buf x]])],
+ [krb5_cv_struct_sigjmp_buf=yes], [krb5_cv_struct_sigjmp_buf=no])])
AC_MSG_RESULT($krb5_cv_struct_sigjmp_buf)
if test $krb5_cv_struct_sigjmp_buf = yes; then
AC_DEFINE(POSIX_SETJMP,1,[Define if setjmp indicates POSIX interface])
dnl a macro
AC_MSG_CHECKING(for getaddrinfo)
AC_CACHE_VAL(ac_cv_func_getaddrinfo,
-[AC_TRY_LINK([#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif],[
-struct addrinfo *ai;
-getaddrinfo("kerberos.mit.edu", "echo", 0, &ai);
-], ac_cv_func_getaddrinfo=yes, ac_cv_func_getaddrinfo=no)])
+[AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#ifdef HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+ ]],
+ [[struct addrinfo *ai;
+ getaddrinfo("kerberos.mit.edu", "echo", 0, &ai);]])],
+ [ac_cv_func_getaddrinfo=yes], [ac_cv_func_getaddrinfo=no])])
AC_MSG_RESULT($ac_cv_func_getaddrinfo)
if test $ac_cv_func_getaddrinfo = yes; then
AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function])
if test "$ac_cv_func_inet_ntop" != "yes" ; then
krb5_cv_inet6=no
else
-AC_TRY_COMPILE([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-],[
- struct sockaddr_in6 in;
- AF_INET6;
- IN6_IS_ADDR_LINKLOCAL (&in.sin6_addr);
-],krb5_cv_inet6=yes,krb5_cv_inet6=no)])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netdb.h>
+ ]],
+ [[struct sockaddr_in6 in;
+ AF_INET6;
+ IN6_IS_ADDR_LINKLOCAL(&in.sin6_addr);]])],
+ [krb5_cv_inet6=yes], [krb5_cv_inet6=no])])
fi
AC_MSG_RESULT($krb5_cv_inet6)
if test "$krb5_cv_inet6" = no && test "$ac_cv_func_inet_ntop" = yes; then
AC_CACHE_VAL(krb5_cv_inet6_with_dinet6,[
old_CC="$CC"
CC="$CC -DINET6"
-AC_TRY_COMPILE([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-],[
- struct sockaddr_in6 in;
- AF_INET6;
- IN6_IS_ADDR_LINKLOCAL (&in.sin6_addr);
-],krb5_cv_inet6_with_dinet6=yes,krb5_cv_inet6_with_dinet6=no)
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netdb.h>
+ ]],
+ [[struct sockaddr_in6 in;
+ AF_INET6;
+ IN6_IS_ADDR_LINKLOCAL (&in.sin6_addr);]])],
+ [krb5_cv_inet6_with_dinet6=yes], [krb5_cv_inet6_with_dinet6=no])
CC="$old_CC"])
AC_MSG_RESULT($krb5_cv_inet6_with_dinet6)
fi
cachevar=`echo "krb5_cv_cc_flag_$1" | sed -e s/=/_eq_/g -e s/-/_dash_/g -e s/[[^a-zA-Z0-9_]]/_/g`
AC_CACHE_CHECK([if C compiler supports $1], [$cachevar],
[# first try without, then with
- AC_TRY_COMPILE([], 1;,
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([], [1;])],
[old_cflags="$CFLAGS"
CFLAGS="$CFLAGS $cflags_warning_test_flags $1"
- AC_TRY_COMPILE([], 1;, eval $cachevar=yes, eval $cachevar=no)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([], [1;])],
+ [eval $cachevar=yes], [eval $cachevar=no])
CFLAGS="$old_cflags"],
[AC_MSG_ERROR(compiling simple test program with $CFLAGS failed)])])
if eval test '"${'$cachevar'}"' = yes; then
AC_SUBST(WARN_CXXFLAGS)
])dnl
dnl
-dnl
-dnl check for yylineno -- HAVE_YYLINENO
-dnl
-AC_DEFUN(HAVE_YYLINENO,[dnl
-AC_REQUIRE_CPP()AC_REQUIRE([AC_PROG_LEX])dnl
-AC_MSG_CHECKING([for yylineno declaration])
-AC_CACHE_VAL(krb5_cv_type_yylineno,
-# some systems have yylineno, others don't...
- echo '%%
-%%' | ${LEX} -t > conftest.out
- if egrep yylineno conftest.out >/dev/null 2>&1; then
- krb5_cv_type_yylineno=yes
- else
- krb5_cv_type_yylineno=no
- fi
- rm -f conftest.out)
- AC_MSG_RESULT($krb5_cv_type_yylineno)
- if test $krb5_cv_type_yylineno = no; then
- AC_DEFINE(NO_YYLINENO, 1, [Define if lex produes code with yylineno])
- fi
-])dnl
-dnl
dnl K5_GEN_MAKEFILE([dir, [frags]])
dnl
AC_DEFUN(K5_GEN_MAKEFILE,[dnl
dnl _K5_GEN_MAKEFILE(dir, [frags])
dnl dir must be present in this case
dnl Note: Be careful in quoting.
-dnl The ac_foreach generates the list of fragments to include
+dnl The m4_foreach_w generates the list of fragments to include
dnl or "" if $2 is empty
AC_DEFUN(_K5_GEN_MAKEFILE,[dnl
AC_CONFIG_FILES([$1/Makefile:$srcdir/]K5_TOPDIR[/config/pre.in:$1/Makefile.in:$1/deps:$srcdir/]K5_TOPDIR[/config/post.in])
dnl
define(_V5_AC_OUTPUT_MAKEFILE,
[ifelse($2, , ,AC_CONFIG_FILES($2))
-AC_FOREACH([DIR], [$1],dnl
+m4_foreach_w([DIR], [$1],dnl
[AC_CONFIG_FILES(DIR[/Makefile:$srcdir/]K5_TOPDIR[/config/pre.in:]DIR[/Makefile.in:]DIR[/deps:$srcdir/]K5_TOPDIR[/config/post.in])])
K5_AC_OUTPUT])dnl
dnl
dnl
AC_DEFUN(WITH_NETLIB,[
AC_ARG_WITH([netlib],
-AC_HELP_STRING([--with-netlib=LIBS], use user defined resolver library),
+ [AS_HELP_STRING([--with-netlib=LIBS], [use user defined resolver library])],
[ if test "$withval" = yes -o "$withval" = no ; then
AC_MSG_RESULT("netlib will link with C library resolver only")
else
dnl regcomp is present but non-functional on Solaris 2.4
dnl
AC_MSG_CHECKING(for working regcomp)
-AC_CACHE_VAL(ac_cv_func_regcomp,[
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <regex.h>
-regex_t x; regmatch_t m;
-int main() { return regcomp(&x,"pat.*",0) || regexec(&x,"pattern",1,&m,0); }
-], ac_cv_func_regcomp=yes, ac_cv_func_regcomp=no, AC_MSG_ERROR([Cannot test regcomp when cross compiling]))])
+AC_CACHE_VAL(ac_cv_func_regcomp,
+[AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <regex.h>
+ regex_t x; regmatch_t m;]],
+ [[return regcomp(&x,"pat.*",0) || regexec(&x,"pattern",1,&m,0);]])],
+ [ac_cv_func_regcomp=yes], [ac_cv_func_regcomp=no],
+ [AC_MSG_ERROR([Cannot test regcomp when cross compiling])])])
AC_MSG_RESULT($ac_cv_func_regcomp)
test $ac_cv_func_regcomp = yes && AC_DEFINE(HAVE_REGCOMP,1,[Define if regcomp exists and functions])
dnl
done
LIBS="$old_LIBS `eval echo x $TCL_LIB_SPEC $TCL_LIBS | sed 's/^x//'`"
LDFLAGS="$old_LDFLAGS $TCL_LD_FLAGS"
- AC_TRY_LINK([#include <tcl.h>], [Tcl_CreateInterp ();],
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <tcl.h>
+ ]],
+ [[Tcl_CreateInterp();]])],
tcl_ok_conf=$file
tcl_vers_maj=$TCL_MAJOR_VERSION
tcl_vers_min=$TCL_MINOR_VERSION
dnl WITH_HESIOD
dnl
AC_DEFUN(WITH_HESIOD,
-[AC_ARG_WITH(hesiod, AC_HELP_STRING(--with-hesiod[=path], compile with hesiod support @<:@omitted@:>@),
- hesiod=$with_hesiod, with_hesiod=no)
+[AC_ARG_WITH(hesiod,
+ [AS_HELP_STRING([--with-hesiod[=path]],
+ [compile with hesiod support @<:@omitted@:>@])],
+ [hesiod=$with_hesiod], [with_hesiod=no])
if test "$with_hesiod" != "no"; then
HESIOD_DEFS=-DHESIOD
AC_CHECK_LIB(resolv, res_send, res_lib=-lresolv)
fi
AC_ARG_ENABLE([rpath],
-AC_HELP_STRING([--disable-rpath],[suppress run path flags in link lines]),,
-[enable_rpath=yes])
+ [AS_HELP_STRING([--disable-rpath],[suppress run path flags in link lines])],
+ [], [enable_rpath=yes])
if test "x$enable_rpath" != xyes ; then
# Unset the rpath flag values set by shlib.conf
AC_CHECK_FUNC(res_search,
[AC_DEFINE(HAVE_RES_SEARCH, 1,
[Define to 1 if you have the `res_search' function])],
- [AC_ERROR([cannot find res_nsearch or res_search])])
+ [AC_MSG_ERROR([cannot find res_nsearch or res_search])])
fi
fi
])
AC_DEFUN([_KRB5_AC_CHECK_RES_FUNCS],
-[AC_FOREACH([AC_Func], [$1],
+[m4_foreach_w([AC_Func], [$1],
[AH_TEMPLATE(AS_TR_CPP(HAVE_[]AC_Func),
[Define to 1 if you have the `]AC_Func[' function.])])dnl
for krb5_func in $1; do
# doesn't export it from libresolv.so, so we use extreme paranoia here
# and check both for the declaration and that we can link against the
# function.
-AC_CACHE_CHECK([for $1], [krb5_cv_func_$1], [AC_TRY_LINK(
-[#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-@%:@include <resolv.h>],
-[/*
- * Use volatile, or else optimization can cause false positives.
- */
-void (* volatile p)() = (void (*)())$1;],
- [AS_VAR_SET(krb5_cv_func_$1, yes)],
- [AS_VAR_SET(krb5_cv_func_$1, no)])])
+AC_CACHE_CHECK([for $1], [krb5_cv_func_$1],
+[AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <netinet/in.h>
+ #include <arpa/nameser.h>
+ #include <resolv.h>
+ ]],
+ [[/*
+ * Use volatile, or else optimization can cause false positives.
+ */
+ void (* volatile p)() = (void (*)())$1;]])],
+ [AS_VAR_SET(krb5_cv_func_$1, yes)],
+ [AS_VAR_SET(krb5_cv_func_$1, no)])])
AS_IF([test AS_VAR_GET(krb5_cv_func_$1) = yes],
[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]), 1,
[Define to 1 if you have the `$1' function])])[]dnl
AC_DEFUN([KRB5_NEED_PROTO], [
ifelse([$3], ,[if test "x$ac_cv_func_$2" = xyes; then])
AC_CACHE_CHECK([if $2 needs a prototype provided], krb5_cv_func_$2_noproto,
-AC_TRY_COMPILE([$1],
-[#undef $2
-struct k5foo {int foo; } xx;
-extern int $2 (struct k5foo*);
-$2(&xx);
-],
-krb5_cv_func_$2_noproto=yes,krb5_cv_func_$2_noproto=no))
+[AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[$1]],
+ [[#undef $2
+ struct k5foo {int foo; } xx;
+ extern int $2 (struct k5foo*);
+ $2(&xx);]])],
+ [krb5_cv_func_$2_noproto=yes], [krb5_cv_func_$2_noproto=no])])
if test $krb5_cv_func_$2_noproto = yes; then
AC_DEFINE([NEED_]translit($2, [a-z], [A-Z])[_PROTO], 1, dnl
[define if the system header files are missing prototype for $2()])
krb5_lib_var=`echo "$1 $2" | sed 'y% ./+-*%___p_p%'`
AC_MSG_CHECKING([if getsockname() takes arguments $1 and $2])
AC_CACHE_VAL(krb5_cv_getsockname_proto_$krb5_lib_var,
-[
-AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>
-extern int getsockname(int, $1, $2);
-],,eval "krb5_cv_getsockname_proto_$krb5_lib_var=yes",
- eval "krb5_cv_getsockname_proto_$krb5_lib_var=no")])
+[AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <sys/types.h>
+ #include <sys/socket.h>
+ extern int getsockname(int, $1, $2);]])],
+ [eval "krb5_cv_getsockname_proto_$krb5_lib_var=yes"],
+ [eval "krb5_cv_getsockname_proto_$krb5_lib_var=no"])])
if eval "test \"`echo '$krb5_cv_getsockname_proto_'$krb5_lib_var`\" = yes"; then
AC_MSG_RESULT(yes)
sock_set=yes; res1="$1"; res2="$2"
dnl
AC_DEFUN([KRB5_AC_CHOOSE_ET],[
AC_ARG_WITH([system-et],
-AC_HELP_STRING(--with-system-et,use system compile_et and -lcom_err @<:@default: build and install a local version@:>@))
+ [AS_HELP_STRING([--with-system-et],
+ [use system compile_et and -lcom_err @<:@default: build and install a local version@:>@])])
AC_MSG_CHECKING(which version of com_err to use)
if test "x$with_system_et" = xyes ; then
# This will be changed to "intlsys" if textdomain support is present.
if compile_et conf$$e.et >/dev/null 2>&1 ; then true ; else
AC_MSG_ERROR(execution failed)
fi
- AC_TRY_COMPILE([#include "conf$$e.h"
- ],[ &et_foo_error_table; ],:,
- [AC_MSG_ERROR(cannot use et_foo_error_table)])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include "conf$$e.h"
+ ]],
+ [[&et_foo_error_table;]])],
+ [], [AC_MSG_ERROR(cannot use et_foo_error_table)])
# Anything else we need to test for?
rm -f conf$$e.c conf$$e.h
krb5_cv_compile_et_useful=yes
])
AC_DEFUN([KRB5_AC_CHOOSE_SS],[
AC_ARG_WITH(system-ss,
- AC_HELP_STRING(--with-system-ss,use system -lss and mk_cmds @<:@private version@:>@))
+ [AS_HELP_STRING([--with-system-ss],
+ [use system -lss and mk_cmds @<:@private version@:>@])])
AC_ARG_VAR(SS_LIB,[system libraries for 'ss' package [-lss]])
AC_MSG_CHECKING(which version of subsystem package to use)
if test "x$with_system_ss" = xyes ; then
test "x${SS_LIB+set}" = xset || SS_LIB=-lss
old_LIBS="$LIBS"
LIBS="$LIBS $SS_LIB"
- AC_CACHE_CHECK(whether system ss package works, krb5_cv_system_ss_okay,[
- AC_TRY_RUN([
-#include <ss/ss.h>
-int main(int argc, char *argv[]) {
- if (argc == 42) {
- int i, err;
- i = ss_create_invocation("foo","foo","",0,&err);
- ss_listen(i);
- }
- return 0;
-}], krb5_cv_system_ss_okay=yes, AC_MSG_ERROR(cannot run test program),
- krb5_cv_system_ss_okay="assumed")])
+ AC_CACHE_CHECK(whether system ss package works, krb5_cv_system_ss_okay,
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <ss/ss.h>
+ int main(int argc, char *argv[]) {
+ if (argc == 42) {
+ int i, err;
+ i = ss_create_invocation("foo","foo","",0,&err);
+ ss_listen(i);
+ }
+ return 0;
+ }]])],
+ [krb5_cv_system_ss_okay=yes], [AC_MSG_ERROR(cannot run test program)],
+ [krb5_cv_system_ss_okay=assumed])])
LIBS="$old_LIBS"
KRB5_NEED_PROTO([#include <ss/ss.h>],ss_execute_command,1)
else
dnl
AC_DEFUN([KRB5_AC_CHOOSE_DB],[
AC_ARG_WITH(system-db,
- AC_HELP_STRING(--with-system-db,use system Berkeley db @<:@private version@:>@))
+ [AS_HELP_STRING([--with-system-db],
+ [use system Berkeley db @<:@private version@:>@])])
AC_ARG_VAR(DB_HEADER,[header file for system Berkeley db package [db.h]])
AC_ARG_VAR(DB_LIB,[library for system Berkeley db package [-ldb]])
if test "x$with_system_db" = xyes ; then
a=no
b=no
# blindly assume we have 'unlink' and unistd.h.
-AC_TRY_RUN([#include <unistd.h>
-void foo1() __attribute__((constructor));
-void foo1() { unlink("conftest.1"); }
-void foo2() __attribute__((destructor));
-void foo2() { unlink("conftest.2"); }
-int main () { return 0; }],
-[test -r conftest.1 || a=yes
-test -r conftest.2 || b=yes], , AC_MSG_ERROR(Cannot test for constructor/destructor support when cross compiling))
+AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <unistd.h>
+ void foo1() __attribute__((constructor));
+ void foo1() { unlink("conftest.1"); }
+ void foo2() __attribute__((destructor));
+ void foo2() { unlink("conftest.2"); }
+ int main () { return 0; }]])],
+ [test -r conftest.1 || a=yes
+ test -r conftest.2 || b=yes],
+ [], [AC_MSG_ERROR(Cannot test for constructor/destructor support when cross compiling)])
case $krb5_cv_host in
*-*-aix4.*)
# Under AIX 4.3.3, at least, shared library destructor functions
AC_DEFUN([KRB5_AC_PRAGMA_WEAK_REF],
[AC_CACHE_CHECK([whether pragma weak references are supported],
krb5_cv_pragma_weak_ref,
-[AC_TRY_LINK([#pragma weak flurbl
-extern int flurbl(void);],[if (&flurbl != 0) return flurbl();],
-krb5_cv_pragma_weak_ref=yes,krb5_cv_pragma_weak_ref=no)])
+[AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#pragma weak flurbl
+ extern int flurbl(void);]],
+ [[if (&flurbl != 0) return flurbl();]])],
+ [krb5_cv_pragma_weak_ref=yes], [krb5_cv_pragma_weak_ref=no])])
if test $krb5_cv_pragma_weak_ref = yes ; then
AC_DEFINE(HAVE_PRAGMA_WEAK_REF,1,[Define if #pragma weak references work])
fi])
dnl
AC_DEFUN(WITH_LDAP,[
AC_ARG_WITH([ldap],
-[ --with-ldap compile OpenLDAP database backend module],
+[AS_HELP_STRING([--with-ldap], [compile OpenLDAP database backend module])],
[case "$withval" in
OPENLDAP) with_ldap=yes ;;
yes | no) ;;
# Determine if NLS is desired and supported.
po=
AC_ARG_ENABLE([nls],
-AC_HELP_STRING([--disable-nls], [disable native language support]),
- [], [enable_nls=check])
+ [AS_HELP_STRING([--disable-nls], [disable native language support])],
+ [], [enable_nls=check])
if test "$enable_nls" != no; then
AC_CHECK_HEADER(libintl.h, [
AC_SEARCH_LIBS(dgettext, intl, [
# --with-vague-errors disables useful error messages.
AC_ARG_WITH([vague-errors],
-AC_HELP_STRING([--with-vague-errors],[Do not @<:@do@:>@ send helpful errors to client]), , withval=no)
+ [AS_HELP_STRING([--with-vague-errors],
+ [Do not @<:@do@:>@ send helpful errors to client])],
+ [], [withval=no])
if test "$withval" = yes; then
AC_MSG_NOTICE(Supplying vague error messages to KDC clients)
AC_DEFINE(KRBCONF_VAGUE_ERRORS,1,[Define if the KDC should return only vague error codes to clients])
# Check which (if any) audit plugin to build
audit_plugin=""
AC_ARG_ENABLE([audit-plugin],
-AC_HELP_STRING([--enable-audit-plugin=IMPL],
- [use audit plugin @<:@ do not use audit @:>@]), , enableval=no)
+ [AS_HELP_STRING([--enable-audit-plugin=IMPL],
+ [use audit plugin @<:@ do not use audit @:>@])],
+ [], enableval=no)
if test "$enableval" != no; then
case "$enableval" in
simple)
CRYPTO_IMPL="builtin"
AC_ARG_WITH([crypto-impl],
-AC_HELP_STRING([--with-crypto-impl=IMPL], [use specified crypto implementation @<:@builtin@:>@]),
-[CRYPTO_IMPL=$withval
-AC_MSG_NOTICE(k5crypto will use '$withval')
-], withval=builtin)
+ [AS_HELP_STRING([--with-crypto-impl=IMPL],
+ [use specified crypto implementation @<:@builtin@:>@])],
+ [CRYPTO_IMPL=$withval
+ AC_MSG_NOTICE(k5crypto will use '$withval')],
+ [withval=builtin])
case "$withval" in
builtin)
;;
AC_SUBST(CRYPTO_IMPL_LIBS)
AC_ARG_WITH([prng-alg],
-AC_HELP_STRING([--with-prng-alg=ALG], [use specified PRNG algorithm. @<:@fortuna@:>@]),
-[PRNG_ALG=$withval
-AC_MSG_NOTICE(k5crypto will use '$withval')
-], PRNG_ALG=fortuna)
+ [AS_HELP_STRING([--with-prng-alg=ALG],
+ [use specified PRNG algorithm. @<:@fortuna@:>@])],
+ [PRNG_ALG=$withval
+ AC_MSG_NOTICE(k5crypto will use '$withval')],
+ [PRNG_ALG=fortuna])
AC_CONFIG_COMMANDS(PRNG_ALG, , PRNG_ALG=$PRNG_ALG)
AC_SUBST(PRNG_ALG)
if test "$PRNG_ALG" = fortuna; then
# WITH_TLS_IMPL
AC_ARG_WITH([tls-impl],
-AC_HELP_STRING([--with-tls-impl=IMPL],
- [use specified TLS implementation @<:@auto@:>@]),
-[TLS_IMPL=$withval],[TLS_IMPL=auto])
+ [AS_HELP_STRING([--with-tls-impl=IMPL],
+ [use specified TLS implementation @<:@auto@:>@])],
+ [TLS_IMPL=$withval], [TLS_IMPL=auto])
case "$TLS_IMPL" in
openssl|auto)
AC_CHECK_LIB(ssl,SSL_CTX_new,[have_lib_ssl=true],[have_lib_ssl=false],
AC_SUBST(TLS_IMPL_LIBS)
AC_ARG_WITH([keyutils],
-AC_HELP_STRING([--without-keyutils],[do not link with libkeyutils]),
- [], [with_keyutils=check])
+ [AS_HELP_STRING([--without-keyutils], [do not link with libkeyutils])],
+ [], [with_keyutils=check])
if test "$with_keyutils" != no; then
have_keyutils=false
AC_CHECK_HEADERS([keyutils.h],
# and can support three NIST groups using OpenSSL.
HAVE_SPAKE_OPENSSL=no
AC_ARG_WITH([spake-openssl],
-AC_HELP_STRING([--with-spake-openssl],
- [use OpenSSL for SPAKE preauth @<:@auto@:>@]),,[withval=auto])
+ [AS_HELP_STRING([--with-spake-openssl],
+ [use OpenSSL for SPAKE preauth @<:@auto@:>@])],
+ [], [withval=auto])
if test "$withval" = auto -o "$withval" = yes; then
AC_CHECK_LIB([crypto],[EC_POINT_new],[have_crypto=true],[have_crypto=false])
if test "$have_crypto" = true; then
AC_SUBST(SPAKE_OPENSSL_LIBS)
AC_ARG_ENABLE([aesni],
-AC_HELP_STRING([--disable-aesni],[Do not build with AES-NI support]), ,
-enable_aesni=check)
+ [AS_HELP_STRING([--disable-aesni], [Do not build with AES-NI support])],
+ [], [enable_aesni=check])
if test "$CRYPTO_IMPL" = builtin -a "x$enable_aesni" != xno; then
case "$host" in
i686-*)
AC_SUBST(AESNI_FLAGS)
AC_ARG_ENABLE([kdc-lookaside-cache],
-AC_HELP_STRING([--disable-kdc-lookaside-cache],
- [Disable the cache which detects client retransmits]), ,
- enableval=yes)
+ AS_HELP_STRING([--disable-kdc-lookaside-cache],
+ [Disable the cache which detects client retransmits]),
+ [], [enableval=yes])
if test "$enableval" = no ; then
AC_DEFINE(NOCACHE,1,[Define if the KDC should use no lookaside cache])
fi
# -fsanitize=address, and set ASAN=yes to suppress the undefined
# symbols check when building shared libraries.
AC_ARG_ENABLE([asan],
-AC_HELP_STRING([--enable-asan],[Build with asan memory checking]),[],
- [enable_asan=no])
+ [AS_HELP_STRING([--enable-asan], [Build with asan memory checking])],
+ [], [enable_asan=no])
if test "$enable_asan" != no; then
if test "$enable_asan" = yes; then
enable_asan=address
AC_SUBST(ASAN_FLAGS)
AC_SUBST(ASAN)
-AC_TYPE_SIGNAL
-
# from old include/configure.in
AH_TEMPLATE([HAVE_STRUCT_SOCKADDR_STORAGE],
[Define if "struct sockaddr_storage" is available.])
AC_CONFIG_HEADERS(include/autoconf.h, [echo timestamp > include/autoconf.stamp])
-AC_PROG_LEX
AC_C_CONST
AC_HEADER_DIRENT
AC_FUNC_STRERROR_R
AC_MSG_CHECKING([return type of setrpcent])
AC_CACHE_VAL(k5_cv_type_setrpcent,
-[AC_TRY_COMPILE([#include <netdb.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-extern void setrpcent();],
-[int i;], k5_cv_type_setrpcent=void, k5_cv_type_setrpcent=int)])
+[AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[#include <netdb.h>
+ extern void setrpcent();]])],
+ [k5_cv_type_setrpcent=void],
+ [k5_cv_type_setrpcent=int])])
AC_MSG_RESULT($k5_cv_type_setrpcent)
AC_DEFINE_UNQUOTED(SETRPCENT_TYPE, $k5_cv_type_setrpcent, [Define as return type of setrpcent])
AC_MSG_CHECKING([return type of endrpcent])
AC_CACHE_VAL(k5_cv_type_endrpcent,
-[AC_TRY_COMPILE([#include <netdb.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-extern void endrpcent();],
-[int i;], k5_cv_type_endrpcent=void, k5_cv_type_endrpcent=int)])
+[AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <netdb.h>
+ extern void endrpcent();]])],
+ [k5_cv_type_endrpcent=void], [k5_cv_type_endrpcent=int])])
AC_MSG_RESULT($k5_cv_type_endrpcent)
AC_DEFINE_UNQUOTED(ENDRPCENT_TYPE, $k5_cv_type_endrpcent, [Define as return type of endrpcent])
# bswap_16 is a macro in byteswap.h under GNU libc
AC_MSG_CHECKING(for bswap_16)
-AC_CACHE_VAL(krb5_cv_bswap_16,[
-AC_TRY_LINK([#if HAVE_BYTESWAP_H
-#include <byteswap.h>
-#endif],[bswap_16(37);],krb5_cv_bswap_16=yes,krb5_cv_bswap_16=no)])
+AC_CACHE_VAL(krb5_cv_bswap_16,
+[AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#if HAVE_BYTESWAP_H
+ #include <byteswap.h>
+ #endif
+ ]],
+ [[bswap_16(37);]])],
+ [krb5_cv_bswap_16=yes], [krb5_cv_bswap_16=no])])
AC_MSG_RESULT($krb5_cv_bswap_16)
if test "$krb5_cv_bswap_16" = yes; then
AC_DEFINE(HAVE_BSWAP_16,1,[Define to 1 if bswap_16 is available via byteswap.h])
fi
AC_MSG_CHECKING(for bswap_64)
-AC_CACHE_VAL(krb5_cv_bswap_64,[
-AC_TRY_LINK([#if HAVE_BYTESWAP_H
-#include <byteswap.h>
-#endif],[bswap_64(37);],krb5_cv_bswap_64=yes,krb5_cv_bswap_64=no)])
+AC_CACHE_VAL(krb5_cv_bswap_64,
+[AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#if HAVE_BYTESWAP_H
+ #include <byteswap.h>
+ #endif
+ ]],
+ [[bswap_64(37);]])],
+ [krb5_cv_bswap_64=yes], [krb5_cv_bswap_64=no])])
AC_MSG_RESULT($krb5_cv_bswap_64)
if test "$krb5_cv_bswap_64" = yes; then
AC_DEFINE(HAVE_BSWAP_64,1,[Define to 1 if bswap_64 is available via byteswap.h])
if test "$ac_cv_func_gethostbyname_r" = yes; then
AC_MSG_CHECKING([if gethostbyname_r returns an int])
AC_CACHE_VAL(krb5_cv_gethostbyname_r_returns_int,
- [AC_TRY_COMPILE([#include <netdb.h>
- extern int gethostbyname_r ();], [1;],
- krb5_cv_gethostbyname_r_returns_int=yes,
- krb5_cv_gethostbyname_r_returns_int=no)])
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <netdb.h>
+ extern int gethostbyname_r();]])],
+ [krb5_cv_gethostbyname_r_returns_int=yes],
+ [krb5_cv_gethostbyname_r_returns_int=no])])
AC_MSG_RESULT($krb5_cv_gethostbyname_r_returns_int)
AC_MSG_CHECKING([if gethostbyname_r returns a pointer])
AC_CACHE_VAL(krb5_cv_gethostbyname_r_returns_ptr,
- [AC_TRY_COMPILE([#include <netdb.h>
- extern struct hostent *gethostbyname_r ();], [1;],
- krb5_cv_gethostbyname_r_returns_ptr=yes,
- krb5_cv_gethostbyname_r_returns_ptr=no)])
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <netdb.h>
+ extern struct hostent *gethostbyname_r();]])],
+ [krb5_cv_gethostbyname_r_returns_ptr=yes],
+ [krb5_cv_gethostbyname_r_returns_ptr=no])])
AC_MSG_RESULT($krb5_cv_gethostbyname_r_returns_ptr)
if test "$krb5_cv_gethostbyname_r_returns_int" = "$krb5_cv_gethostbyname_r_returns_ptr"; then
if test "$ac_cv_func_getpwnam_r" = yes; then
AC_MSG_CHECKING([return type of getpwnam_r])
AC_CACHE_VAL(krb5_cv_getpwnam_r_return_type,
- [AC_TRY_COMPILE([#include <pwd.h>
- extern int getpwnam_r();], [1;],
- getpwnam_r_returns_int=yes,getpwnam_r_returns_int=no)
- AC_TRY_COMPILE([#include <pwd.h>
- extern struct passwd *getpwnam_r();], [1;],
- getpwnam_r_returns_ptr=yes,getpwnam_r_returns_ptr=no)
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <pwd.h>
+ extern int getpwnam_r();]])],
+ [getpwnam_r_returns_int=yes], [getpwnam_r_returns_int=no])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <pwd.h>
+ extern struct passwd *getpwnam_r();]])],
+ [getpwnam_r_returns_ptr=yes], [getpwnam_r_returns_ptr=no])
case "$getpwnam_r_returns_int/$getpwnam_r_returns_ptr" in
yes/no) krb5_cv_getpwnam_r_return_type=int ;;
no/yes) krb5_cv_getpwnam_r_return_type=ptr ;;
if test "$ac_cv_func_getpwnam_r" = yes; then
AC_MSG_CHECKING([number of arguments to getpwnam_r])
AC_CACHE_VAL(krb5_cv_getpwnam_r_args,
- [AC_TRY_COMPILE([#include <pwd.h>
- struct passwd pwx; char buf[1024];],
- [getpwnam_r("", &pwx, buf, sizeof(buf));], args4=yes, args4=no)
- AC_TRY_COMPILE([#include <pwd.h>
- struct passwd pwx, *p; char buf[1024];],
- [getpwnam_r("", &pwx, buf, sizeof(buf), &p);], args5=yes, args5=no)
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pwd.h>
+ struct passwd pwx; char buf[1024];]],
+ [[getpwnam_r("", &pwx, buf, sizeof(buf));]])],
+ [args4=yes], [args4=no])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pwd.h>
+ struct passwd pwx, *p;
+ char buf[1024];]],
+ [[getpwnam_r("", &pwx, buf, sizeof(buf), &p);]])],
+ [args5=yes], [args5=no])
case $args4/$args5 in
yes/no) krb5_cv_getpwnam_r_args=4 ;;
no/yes) krb5_cv_getpwnam_r_args=5 ;;
if test "$ac_cv_func_gmtime_r" = yes; then
AC_MSG_CHECKING([whether gmtime_r returns int])
AC_CACHE_VAL(krb5_cv_gmtime_r_returns_int,
- [AC_TRY_COMPILE([#include <time.h>
- extern int gmtime_r ();], [1;], return_int=yes, return_int=no)
- AC_TRY_COMPILE([#include <time.h>
- extern struct tm *gmtime_r ();], [1;], return_ptr=yes, return_ptr=no)
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <time.h>
+ extern int gmtime_r();]])],
+ [return_int=yes], [return_int=no])
+ AC_COMPILE_IFELSE([
+ AC_LANG_SOURCE(
+ [[#include <time.h>
+ extern struct tm *gmtime_r();]])],
+ [return_ptr=yes], [return_ptr=no])
case $return_int/$return_ptr in
yes/no) krb5_cv_gmtime_r_returns_int=yes ;;
no/yes) krb5_cv_gmtime_r_returns_int=no ;;
if test "$ac_cv_func_getservbyname_r" = yes; then
AC_MSG_CHECKING([if getservbyname_r returns an int])
AC_CACHE_VAL(krb5_cv_getservbyname_r_returns_int,
- [AC_TRY_COMPILE([#include <netdb.h>
- extern int getservbyname_r ();], [1;],
- krb5_cv_getservbyname_r_returns_int=yes,
- krb5_cv_getservbyname_r_returns_int=no)])
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <netdb.h>
+ extern int getservbyname_r();]])],
+ [krb5_cv_getservbyname_r_returns_int=yes],
+ [krb5_cv_getservbyname_r_returns_int=no])])
AC_MSG_RESULT($krb5_cv_getservbyname_r_returns_int)
AC_MSG_CHECKING([if getservbyname_r returns a pointer])
AC_CACHE_VAL(krb5_cv_getservbyname_r_returns_ptr,
- [AC_TRY_COMPILE([#include <netdb.h>
- extern struct servent *getservbyname_r ();], [1;],
- krb5_cv_getservbyname_r_returns_ptr=yes,
- krb5_cv_getservbyname_r_returns_ptr=no)])
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <netdb.h>
+ extern struct servent *getservbyname_r();]])],
+ [krb5_cv_getservbyname_r_returns_ptr=yes],
+ [krb5_cv_getservbyname_r_returns_ptr=no])])
AC_MSG_RESULT($krb5_cv_getservbyname_r_returns_ptr)
if test "$krb5_cv_getservbyname_r_returns_int" = "$krb5_cv_getservbyname_r_returns_ptr"; then
fi
])
-HAVE_YYLINENO
CHECK_DIRENT
AC_TYPE_UID_T
[AC_CHECK_FUNC([tcsetattr],
AC_DEFINE(POSIX_TERMIOS,1,[Define if termios.h exists and tcsetattr exists]))])
-KRB5_SIGTYPE
AC_CHECK_HEADERS(poll.h stdlib.h string.h stddef.h sys/types.h sys/file.h sys/param.h sys/stat.h sys/time.h netinet/in.h sys/uio.h sys/filio.h sys/select.h time.h paths.h errno.h)
# If compiling with IPv6 support, test if in6addr_any functions.
# Irix 6.5.16 defines it, but lacks support in the C library.
if test $krb5_cv_inet6 = yes || test "$krb5_cv_inet6_with_dinet6" = yes ; then
-AC_CACHE_CHECK([for in6addr_any definition in library],
- krb5_cv_var_in6addr_any,
-[AC_TRY_LINK([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <stdio.h>
-],[
- struct sockaddr_in6 in;
- in.sin6_addr = in6addr_any;
- printf("%x", &in);
-],krb5_cv_var_in6addr_any=yes, krb5_cv_var_in6addr_any=no)])
+ AC_CACHE_CHECK([for in6addr_any definition in library],
+ [krb5_cv_var_in6addr_any],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #include <stdio.h>
+ ]],
+ [[struct sockaddr_in6 in;
+ in.sin6_addr = in6addr_any;
+ printf("%x", &in);]])],
+ [krb5_cv_var_in6addr_any=yes], [krb5_cv_var_in6addr_any=no])])
if test $krb5_cv_var_in6addr_any = no; then
AC_DEFINE(NEED_INSIXADDR_ANY,1,[Define if in6addr_any is not defined in libc])
fi
# then from osconf.h, we have
-AC_HEADER_TIME
AC_CHECK_TYPE(time_t, long)
AC_CHECK_SIZEOF(time_t)
SIZEOF_TIME_T=$ac_cv_sizeof_time_t
AC_MSG_CHECKING(for socklen_t)
AC_CACHE_VAL(krb5_cv_has_type_socklen_t,
-[AC_TRY_COMPILE(
-[#include <sys/types.h>
-#include <sys/socket.h>
-],[sizeof (socklen_t);],
-krb5_cv_has_type_socklen_t=yes,krb5_cv_has_type_socklen_t=no)])
+[AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <sys/socket.h>
+ ]],
+ [[sizeof(socklen_t);]])],
+ [krb5_cv_has_type_socklen_t=yes], [krb5_cv_has_type_socklen_t=no])])
AC_MSG_RESULT($krb5_cv_has_type_socklen_t)
if test $krb5_cv_has_type_socklen_t = yes; then
AC_DEFINE(HAVE_SOCKLEN_T,1,[Define if there is a socklen_t type. If not, probably use size_t])
AC_MSG_CHECKING(for struct lifconf)
AC_CACHE_VAL(krb5_cv_has_struct_lifconf,
-[AC_TRY_COMPILE(
-[#include <sys/socket.h>
-#include <net/if.h>
-],[sizeof (struct lifconf);],
-krb5_cv_has_struct_lifconf=yes,krb5_cv_has_struct_lifconf=no)])
+[AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/socket.h>
+ #include <net/if.h>
+ ]],
+ [[sizeof (struct lifconf);]])],
+ [krb5_cv_has_struct_lifconf=yes], [krb5_cv_has_struct_lifconf=no])])
AC_MSG_RESULT($krb5_cv_has_struct_lifconf)
if test $krb5_cv_has_struct_lifconf = yes; then
AC_DEFINE(HAVE_STRUCT_LIFCONF,1,[Define if there is a struct lifconf.])
# HP-UX 11 uses stuct if_laddrconf
AC_MSG_CHECKING(for struct if_laddrconf)
AC_CACHE_VAL(krb5_cv_has_struct_if_laddrconf,
-[AC_TRY_COMPILE(
-[#include <sys/socket.h>
-#include <net/if.h>
-#include <net/if6.h>
-],[sizeof (struct if_laddrconf);],
-krb5_cv_has_struct_if_laddrconf=yes,krb5_cv_has_struct_if_laddrconf=no)])
+[AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/socket.h>
+ #include <net/if.h>
+ #include <net/if6.h>
+ ]],
+ [[sizeof(struct if_laddrconf);]])],
+ [krb5_cv_has_struct_if_laddrconf=yes],
+ [krb5_cv_has_struct_if_laddrconf=no])])
AC_MSG_RESULT($krb5_cv_has_struct_if_laddrconf)
if test $krb5_cv_has_struct_if_laddrconf = yes; then
AC_DEFINE(HAVE_STRUCT_IF_LADDRCONF,1,[Define if there is a struct if_laddrconf.])
AC_MSG_CHECKING([for h_errno in netdb.h])
AC_CACHE_VAL(krb5_cv_header_netdb_h_h_errno,
-[AC_TRY_COMPILE(
- [#include <netdb.h>],
- [int x = h_errno;], krb5_cv_header_netdb_h_h_errno=yes,
- krb5_cv_header_netdb_h_h_errno=no)])
+[AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <netdb.h>]],
+ [[int x = h_errno;]])],
+ [krb5_cv_header_netdb_h_h_errno=yes],
+ [krb5_cv_header_netdb_h_h_errno=no])])
AC_MSG_RESULT($krb5_cv_header_netdb_h_h_errno)
if test $krb5_cv_header_netdb_h_h_errno = yes; then
AC_DEFINE([HAVE_NETDB_H_H_ERRNO], 1,
# to ANSI/ISO C 1999 specification). Specifically, positional
# specifications; not checking for other features like %zx at present.
AC_MSG_CHECKING(for POSIX printf positional specification support)
-AC_CACHE_VAL(ac_cv_printf_positional,[
-AC_TRY_RUN([
-#include <stdio.h>
-#include <string.h>
-const char expected[] = "200 100";
-int main () {
- char buf[30];
- sprintf(buf, "%2\$x %1\$d", 100, 512);
- if (strcmp(expected, buf)) {
- fprintf(stderr,"bad result: <%s> wanted: <%s>\n", buf, expected);
- return 1;
- }
- return 0;
-}],
- ac_cv_printf_positional=yes,
- ac_cv_printf_positional=no,
- AC_MSG_ERROR([Cannot test for printf positional argument support when cross compiling]))])
+AC_CACHE_VAL(ac_cv_printf_positional,
+[AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <stdio.h>
+ #include <string.h>
+ const char expected[] = "200 100";
+ int main()
+ {
+ char buf[30];
+ sprintf(buf, "%2\$x %1\$d", 100, 512);
+ if (strcmp(expected, buf)) {
+ fprintf(stderr, "bad result: <%s> wanted: <%s>\n",
+ buf, expected);
+ return 1;
+ }
+ return 0;
+ }]])],
+ [ac_cv_printf_positional=yes], [ac_cv_printf_positional=no],
+ [AC_MSG_ERROR(Cannot test for printf positional argument support when cross compiling)])])
# Nothing for autoconf.h for now.
AC_MSG_RESULT($ac_cv_printf_positional)
# STRUCT_RPCENT_IN_RPC_NETDB_H anyway.
AC_MSG_CHECKING([where struct rpcent is declared])
-AC_TRY_COMPILE([#include <netdb.h>],
-[struct rpcent e;
-char c = e.r_name[0];
-int i = e.r_number;],
-[AC_TRY_COMPILE([#include <rpc/netdb.h>],
-[struct rpcent e;
-char c = e.r_name[0];
-int i = e.r_number;],
-[AC_MSG_RESULT([rpc/netdb.h])
-rpcent_define='#define STRUCT_RPCENT_IN_RPC_NETDB_H'],
-[AC_MSG_RESULT([netdb.h])])],
-[AC_MSG_RESULT([nowhere])
-rpcent_define='#define STRUCT_RPCENT_IN_RPC_NETDB_H'])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <netdb.h>
+ ]],
+ [[struct rpcent e;
+ char c = e.r_name[0];
+ int i = e.r_number;]])],
+ [netdb_rpcent=yes], [netdb_rpcent=no])
+if test "$netdb_rpcent" = yes; then
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <rpc/netdb.h>
+ ]],
+ [[struct rpcent e;
+ char c = e.r_name[0];
+ int i = e.r_number;]])],
+ [rpc_netdb_rpcent=yes], [rpc_netdb_rpcent=no])
+ if test "$rpc_netdb_rpcent" = yes; then
+ AC_MSG_RESULT([rpc/netdb.h])
+ rpcent_define='#define STRUCT_RPCENT_IN_RPC_NETDB_H'
+ else
+ AC_MSG_RESULT([netdb.h])
+ fi
+else
+ AC_MSG_RESULT([nowhere])
+ rpcent_define='#define STRUCT_RPCENT_IN_RPC_NETDB_H'
+fi
AC_SUBST(rpcent_define)
AC_CHECK_HEADERS(sys/select.h sys/time.h unistd.h)
AC_SUBST(GSSRPC__UNISTD_H)
AC_CACHE_CHECK([for MAXHOSTNAMELEN in sys/param.h],
- [krb5_cv_header_sys_param_h_maxhostnamelen],
- [AC_TRY_COMPILE([#include <sys/param.h>],
- [int i = MAXHOSTNAMELEN;],
+[krb5_cv_header_sys_param_h_maxhostnamelen],
+[AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/param.h>
+ ]],
+ [[int i = MAXHOSTNAMELEN;]])],
[krb5_cv_header_sys_param_h_maxhostnamelen=yes],
[krb5_cv_header_sys_param_h_maxhostnamelen=no])])
AC_CACHE_CHECK([for MAXHOSTNAMELEN in netdb.h],
- [krb5_cv_header_netdb_h_maxhostnamelen],
- [AC_TRY_COMPILE([#include <netdb.h>],
- [int i = MAXHOSTNAMELEN;],
+[krb5_cv_header_netdb_h_maxhostnamelen],
+[AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <netdb.h>
+ ]],
+ [[int i = MAXHOSTNAMELEN;]])],
[krb5_cv_header_netdb_h_maxhostnamelen=yes],
[krb5_cv_header_netdb_h_maxhostnamelen=no])])
AC_SUBST(GSSRPC__NETDB_H)
AC_CACHE_CHECK([for BSD type aliases], [krb5_cv_type_bsdaliases],
- [AC_TRY_COMPILE(
- [#include <sys/types.h>
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif],
- [u_char c;
-u_int i;
-u_long l;], [krb5_cv_type_bsdaliases=yes], [krb5_cv_type_bsdaliases=no])])
+[AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #if HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+ ]],
+ [[u_char c;
+ u_int i;
+ u_long l;]])],
+ [krb5_cv_type_bsdaliases=yes], [krb5_cv_type_bsdaliases=no])])
if test $krb5_cv_type_bsdaliases = yes; then
GSSRPC__BSD_TYPEALIASES='/* #undef GSSRPC__BSD_TYPEALIASES */'
else
AC_MSG_CHECKING([return type of setrpcent])
AC_CACHE_VAL(k5_cv_type_setrpcent,
-[AC_TRY_COMPILE([#include <netdb.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-extern void setrpcent();],
-[int i;], k5_cv_type_setrpcent=void, k5_cv_type_setrpcent=int)])
+[AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <netdb.h>
+ extern void setrpcent();]])],
+ [k5_cv_type_setrpcent=void], [k5_cv_type_setrpcent=int])])
AC_MSG_RESULT($k5_cv_type_setrpcent)
AC_DEFINE_UNQUOTED(SETRPCENT_TYPE, $k5_cv_type_setrpcent, [Define as return type of setrpcent])
AC_MSG_CHECKING([return type of endrpcent])
AC_CACHE_VAL(k5_cv_type_endrpcent,
-[AC_TRY_COMPILE([#include <netdb.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-extern void endrpcent();],
-[int i;], k5_cv_type_endrpcent=void, k5_cv_type_endrpcent=int)])
+[AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <netdb.h>
+ extern void endrpcent();]])],
+ [k5_cv_type_endrpcent=void], [k5_cv_type_endrpcent=int])])
AC_MSG_RESULT($k5_cv_type_endrpcent)
AC_DEFINE_UNQUOTED(ENDRPCENT_TYPE, $k5_cv_type_endrpcent, [Define as return type of endrpcent])
K5_GEN_FILE(include/gssrpc/types.h:include/gssrpc/types.hin)
-# Check for thread safety issues.
-# (Is there a better place for this?)
-# tsfuncs="getpwnam_r getpwuid_r gethostbyname_r getservbyname_r gmtime_r localtime_r"
-# Removed getpwnam_r and getpwuid_r because include/configure.in has some
-# more careful checks, and may decide to pretend that they're not found if
-# the function signatures can't be figured out.
-tsfuncs="gethostbyname_r getservbyname_r gmtime_r localtime_r"
-AC_CHECK_FUNCS($tsfuncs)
+# Warn about possible thread safety issues. These functions have all
+# been checked for previously.
+tsfuncs="getpwnam_r getpwuid_r gethostbyname_r getservbyname_r gmtime_r localtime_r"
if test "$enable_thread_support" = yes; then
tsmissing=""
for ts in $tsfuncs; do
if test "$BER_OKAY" = "1"; then
LDAP_LIBS='-lldap -llber'
else
- AC_ERROR("BER library missing - cannot build LDAP database module")
+ AC_MSG_ERROR("BER library missing - cannot build LDAP database module")
fi
fi
AC_DEFINE([ENABLE_LDAP], 1, [Define if LDAP KDB support within the Kerberos library (mainly ASN.1 code) should be enabled.])
lmdb_plugin_dir=""
HAVE_LMDB=no
AC_ARG_WITH([lmdb],
-AC_HELP_STRING([--with-lmdb],
- [compile LMDB database backend module @<:@auto@:>@]),,
- [withval=auto])
+ [AS_HELP_STRING([--with-lmdb],
+ [compile LMDB database backend module @<:@auto@:>@])],
+ [], [withval=auto])
if test "$withval" = auto -o "$withval" = yes; then
AC_CHECK_LIB([lmdb],[mdb_env_create],[have_lmdb=true],[have_lmdb=false])
if test "$have_lmdb" = true; then
# with readline only if asked, to avoid a default GPL dependency.
# Building with readline also breaks the dejagnu test suite.
AC_ARG_WITH([libedit],
- AC_HELP_STRING([--without-libedit], [do not compile with libedit]),
- [], [with_libedit=default])
+ [AS_HELP_STRING([--without-libedit], [do not compile with libedit])],
+ [], [with_libedit=default])
AC_ARG_WITH([readline],
- AC_HELP_STRING([--with-readline], [compile with GNU Readline]),
- [], [with_readline=no])
+ [AS_HELP_STRING([--with-readline], [compile with GNU Readline])],
+ [], [with_readline=no])
if test "x$with_readline" = xyes; then
with_libedit=no
fi
AC_SUBST([RL_LIBS])
AC_ARG_WITH([system-verto],
- [AC_HELP_STRING([--with-system-verto], [always use system verto library])],
+ [AS_HELP_STRING([--with-system-verto], [always use system verto library])],
[], [with_system_verto=default])
VERTO_VERSION=k5
if test "x$with_system_verto" != xno; then
AC_ARG_VAR(DEFKTNAME, [Default keytab name])
AC_ARG_VAR(DEFCKTNAME, [Default client keytab name])
AC_ARG_WITH([krb5-config],
- AC_HELP_STRING([--with-krb5-config=PATH],
- [path to existing krb5-config program for defaults]), ,
- [with_krb5_config=krb5-config])
+ [AS_HELP_STRING([--with-krb5-config=PATH],
+ [path to existing krb5-config program for defaults])],
+ [], [with_krb5_config=krb5-config])
if test "x$with_krb5_config" != xno; then
if test "x$with_krb5_config" = xyes; then
with_krb5_config=krb5-config