[ILUG] Configure

John P. Looney jplooney-ilug at online.ie
Wed Jan 26 16:13:10 GMT 2000


 I'm trying to modify the configure script of a package that I've made
some modifications too. It now requires some extra libraries & header
files. The package in question is Courier IMAP, and once I understand the
other bits of the configure script, I'm sure I can work it out.

 Here's an excerpt from a part of the script, similar to what I want to
add. Can someone give a line by line explaination (I've tryed, and I'm not
confident I'm right)..

dnl #########################################################################

dnl Prepare authpam module if libpam is available.

dnl #########################################################################

# Seems to check for a --with-authpam arg.
AC_ARG_WITH(authpam,
[ --without-authpam                  Do not include the authpam module ],
    doauthpam="$withval")

if test "$doauthpam" = "no"
then
    HAVE_PAM=0
    LIBDL=""
else # IF we have a --with-authpam, check for these headers (how?):
    AC_CHECK_HEADERS(security/pam_appl.h Pam/pam_appl.h)

    saveLIBS="$LIBS"
    LIBDL=""   # Does this check libdl for dlopen() ?
    AC_CHECK_LIB(dl, dlopen, [ LIBDL="-ldl" ])
    LIBS="$saveLIBS"
    # Check libpam for pam_start()
    AC_CHECK_LIB(pam, pam_start,
        HAVE_PAM=1
        LIBS="-lpam $LIBDL $LIBS"
    # Why check again ?
        AC_CHECK_FUNCS(pam_setcred),

        HAVE_PAM=0,
        $LIBDL)
    LIBS="$saveLIBS"
fi
AC_SUBST(LIBDL) # Is this adding those flags to the LIBS line or something ?
AC_SUBST(HAVE_PAM)
AM_CONDITIONAL(HAVE_PAM, test "$HAVE_PAM" = 1)   # What these mean ?

AUTHPAM=""
if test "$HAVE_PAM" = 1
then # I get lost here...
    AUTHPAM=authpam
    STATIC_LIST="$STATIC_LIST AUTHSTATIC(\"authpam\", auth_pam,
auth_pam_pre)"
    LIBAUTH="$LIBAUTH libauth-authpam.a"
fi

AC_ARG_WITH(authpam-libraries,
[ --with-authpam-libraries="libs"    Link 'libs' with authpam, this may be
                                    required for FreeBSD 3.3],
    authpamcrypt="$withval")

AUTHPAMCRYPT="$authpamcrypt"
AC_SUBST(AUTHPAMCRYPT)

Kate

-- 
Microsoft. The best reason in the world to drink beer.
http://www.redbrick.dcu.ie/~valen




More information about the ILUG mailing list