summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2010-08-25 15:08:05 -0700
committerRuss Allbery <rra@stanford.edu>2010-08-25 15:08:05 -0700
commit468ded4c2fae05a815bef91bdcb17d52f9cdcb2b (patch)
treeb2b836734664367c03691a8594684187a1be4054 /m4
parent32dc393016f0b6241dbf8d405638e18a33bb9b62 (diff)
Update to rra-c-util 2.6 and C TAP Harness 1.5
Update to C TAP Harness 1.5: * Better reporting of fatal errors in the test suite. * Summarize results at the end of test execution. * Add tests/HOWTO from docs/writing-tests in C TAP Harness. Update to rra-c-util 2.6: * Fix portability to bundled Heimdal on OpenBSD. * Improve checking for krb5_kt_free_entry with older MIT Kerberos. * Fix portability for missing krb5_get_init_creds_opt_free. * Fix header guard for util/xwrite.h. * Restore default compiler configuration after GSS-API library probe.
Diffstat (limited to 'm4')
-rw-r--r--m4/gssapi.m43
-rw-r--r--m4/krb5.m439
-rw-r--r--m4/remctl.m42
3 files changed, 32 insertions, 12 deletions
diff --git a/m4/gssapi.m4 b/m4/gssapi.m4
index 4b08569..0a657ff 100644
--- a/m4/gssapi.m4
+++ b/m4/gssapi.m4
@@ -57,7 +57,8 @@ AC_DEFUN([_RRA_LIB_GSSAPI_REDUCED],
AC_CHECK_LIB([gssapi_krb5], [gss_import_name], [GSSAPI_LIBS="-lgssapi_krb5"],
[AC_CHECK_LIB([gssapi], [gss_import_name], [GSSAPI_LIBS="-lgssapi"],
[AC_CHECK_LIB([gss], [gss_import_name], [GSSAPI_LIBS="-lgss"],
- [AC_MSG_ERROR([cannot find usable GSS-API library])])])])])
+ [AC_MSG_ERROR([cannot find usable GSS-API library])])])])
+ RRA_LIB_GSSAPI_RESTORE])
dnl Does the appropriate library checks for GSS-API linkage when we don't
dnl have krb5-config or reduced dependencies. libgss is used as a last
diff --git a/m4/krb5.m4 b/m4/krb5.m4
index bba9694..38a050e 100644
--- a/m4/krb5.m4
+++ b/m4/krb5.m4
@@ -2,7 +2,7 @@ dnl Find the compiler and linker flags for Kerberos v5.
dnl
dnl Finds the compiler and linker flags for linking with Kerberos v5
dnl libraries. Provides the --with-krb5, --with-krb5-include, and
-dnl --with-krb5-lib configure options to specify non-standards paths to the
+dnl --with-krb5-lib configure options to specify non-standard paths to the
dnl Kerberos libraries. Uses krb5-config where available unless reduced
dnl dependencies is requested.
dnl
@@ -13,6 +13,9 @@ dnl Kerberos libraries, saving the current values first, and
dnl RRA_LIB_KRB5_RESTORE to restore those settings to before the last
dnl RRA_LIB_KRB5_SWITCH.
dnl
+dnl If KRB5_CPPFLAGS, KRB5_LDFLAGS, or KRB5_LIBS are set before calling these
+dnl macros, their values will be added to whatever the macros discover.
+dnl
dnl Provides the RRA_LIB_KRB5_OPTIONAL macro, which should be used if Kerberos
dnl support is optional. This macro will still always set the substitution
dnl variables, but they'll be empty unless --with-krb5 is given. Also,
@@ -25,8 +28,12 @@ dnl change library ordering in that case.
dnl
dnl Depends on RRA_ENABLE_REDUCED_DEPENDS and RRA_SET_LDFLAGS.
dnl
+dnl Also provides RRA_FUNC_KRB5_GET_INIT_CREDS_OPT_FREE_ARGS, which checks
+dnl whether krb5_get_init_creds_opt_free takes one argument or two. Defines
+dnl HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_2_ARGS if it takes two arguments.
+dnl
dnl Written by Russ Allbery <rra@stanford.edu>
-dnl Copyright 2005, 2006, 2007, 2008, 2009
+dnl Copyright 2005, 2006, 2007, 2008, 2009, 2010
dnl Board of Trustees, Leland Stanford Jr. University
dnl
dnl See LICENSE for licensing terms.
@@ -99,10 +106,11 @@ AC_DEFUN([_RRA_LIB_KRB5_MANUAL],
[AC_CHECK_LIB([nsl], [socket], [LIBS="-lnsl -lsocket $LIBS"], ,
[-lsocket])])
AC_SEARCH_LIBS([crypt], [crypt])
+ AC_SEARCH_LIBS([rk_simple_execve], [roken])
rra_krb5_extra="$LIBS"
LIBS="$rra_krb5_save_LIBS"
AC_CHECK_LIB([krb5], [krb5_init_context],
- [KRB5_LIBS="-lkrb5 -lasn1 -lroken -lcrypto -lcom_err $rra_krb5_extra"],
+ [KRB5_LIBS="-lkrb5 -lasn1 -lcom_err -lcrypto $rra_krb5_extra"],
[AC_CHECK_LIB([krb5support], [krb5int_getspecific],
[rra_krb5_extra="-lkrb5support $rra_krb5_extra"],
[AC_CHECK_LIB([pthreads], [pthread_setspecific],
@@ -125,7 +133,7 @@ AC_DEFUN([_RRA_LIB_KRB5_MANUAL],
[AS_IF([test x"$1" = xtrue],
[AC_MSG_ERROR([cannot find usable Kerberos v5 library])])],
[$rra_krb5_extra])],
- [-lasn1 -lroken -lcrypto -lcom_err $rra_krb5_extra])
+ [-lasn1 -lcom_err -lcrypto $rra_krb5_extra])
LIBS="$KRB5_LIBS $LIBS"
AC_CHECK_FUNCS([krb5_get_error_message],
[AC_CHECK_FUNCS([krb5_free_error_message])],
@@ -200,9 +208,6 @@ AC_DEFUN([RRA_LIB_KRB5],
[rra_krb5_root=
rra_krb5_libdir=
rra_krb5_includedir=
- KRB5_CPPFLAGS=
- KRB5_LDFLAGS=
- KRB5_LIBS=
AC_SUBST([KRB5_CPPFLAGS])
AC_SUBST([KRB5_LDFLAGS])
AC_SUBST([KRB5_LIBS])
@@ -230,9 +235,6 @@ AC_DEFUN([RRA_LIB_KRB5_OPTIONAL],
rra_krb5_libdir=
rra_krb5_includedir=
rra_use_kerberos=
- KRB5_CPPFLAGS=
- KRB5_LDFLAGS=
- KRB5_LIBS=
AC_SUBST([KRB5_CPPFLAGS])
AC_SUBST([KRB5_LDFLAGS])
AC_SUBST([KRB5_LIBS])
@@ -261,3 +263,20 @@ AC_DEFUN([RRA_LIB_KRB5_OPTIONAL],
[_RRA_LIB_KRB5_INTERNAL([false])])])
AS_IF([test x"$KRB5_LIBS" != x],
[AC_DEFINE([HAVE_KERBEROS], 1, [Define to enable Kerberos features.])])])
+
+dnl Check whether krb5_get_init_creds_opt_free takes one argument or two.
+dnl Early Heimdal used to take a single argument. Defines
+dnl HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_2_ARGS if it takes two arguments.
+dnl
+dnl Should be called with RRA_LIB_KRB5_SWITCH active.
+AC_DEFUN([RRA_FUNC_KRB5_GET_INIT_CREDS_OPT_FREE_ARGS],
+[AC_CACHE_CHECK([if krb5_get_init_creds_opt_free takes two arguments],
+ [rra_cv_func_krb5_get_init_creds_opt_free_args],
+ [AC_TRY_COMPILE([#include <krb5.h>],
+ [krb5_get_init_creds_opt *opts; krb5_context c;
+ krb5_get_init_creds_opt_free(c, opts);],
+ [rra_cv_func_krb5_get_init_creds_opt_free_args=yes],
+ [rra_cv_func_krb5_get_init_creds_opt_free_args=no])])
+ AS_IF([test $rra_cv_func_krb5_get_init_creds_opt_free_args = yes],
+ [AC_DEFINE([HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_2_ARGS], 1,
+ [Define if krb5_get_init_creds_opt_free takes two arguments.])])])
diff --git a/m4/remctl.m4 b/m4/remctl.m4
index 8ee3c16..bb3a56f 100644
--- a/m4/remctl.m4
+++ b/m4/remctl.m4
@@ -21,7 +21,7 @@ dnl
dnl See LICENSE for licensing terms.
dnl Save the current CPPFLAGS, LDFLAGS, and LIBS settings and switch to
-dnl versions that include the Kerberos v5 flags. Used as a wrapper, with
+dnl versions that include the remctl flags. Used as a wrapper, with
dnl RRA_LIB_REMCTL_RESTORE, around tests.
AC_DEFUN([RRA_LIB_REMCTL_SWITCH],
[rra_remctl_save_CPPFLAGS="$CPPFLAGS"