automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFLAGS/LDFLAGS vs. --with


From: Russ Allbery
Subject: Re: CFLAGS/LDFLAGS vs. --with
Date: Thu, 06 Aug 2009 13:34:02 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

"Murray S. Kucherawy" <address@hidden> 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 (address@hidden)             <http://www.eyrie.org/~eagle/>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]