"Murray S. Kucherawy" <[email protected]> writes:
> Unless I'm missing something (which is possible because I'm still
> learning autoconf), adding the "-with" will mean I can't use
> AC_CHECK_HEADERS to search for various openssl includes and will have to
> do my own tests for the required headers, libraries and functions. Or
> is it possible to arrange that AC_CHECK_HEADERS applies its work to the
> additional path provided via the "-with"? I didn't see such a
> capability described in the info pages, but I may not have looked in the
> right place.
I do:
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 RRA_LIB_KRB5_RESTORE, around tests.
AC_DEFUN([RRA_LIB_KRB5_SWITCH],
[rra_krb5_save_CPPFLAGS="$CPPFLAGS"
rra_krb5_save_LDFLAGS="$LDFLAGS"
rra_krb5_save_LIBS="$LIBS"
CPPFLAGS="$KRB5_CPPFLAGS $CPPFLAGS"
LDFLAGS="$KRB5_LDFLAGS $LDFLAGS"
LIBS="$KRB5_LIBS $LIBS"])
dnl Restore CPPFLAGS, LDFLAGS, and LIBS to their previous values (before
dnl RRA_LIB_KRB5_SWITCH was called).
AC_DEFUN([RRA_LIB_KRB5_RESTORE],
[CPPFLAGS="$rra_krb5_save_CPPFLAGS"
LDFLAGS="$rra_krb5_save_LDFLAGS"
LIBS="$rra_krb5_save_LIBS"])
and then use code like:
RRA_LIB_KRB5_SWITCH
AC_CHECK_FUNCS([krb5_cc_copy_creds \
krb5_free_keytab_entry_contents \
krb5_get_init_creds_opt_set_default_flags \
krb5_get_renewed_creds])
AC_CHECK_TYPES([krb5_realm], , , [#include <krb5.h>])
RRA_LIB_KRB5_RESTORE
for cases like that.
--
Russ Allbery ([email protected]) <http://www.eyrie.org/~eagle/>