cf: Disable pam if --disable-shared

If we are configured with --enable-kauth and --disable-shared, 'make
install/dest' currently fails for pam, since we never generate the
shared library files:

    make[3]: Entering directory '.../src/pam'
    if [ "xyes" = "xyes" ]; then \
            /usr/bin/install -c -d .../amd64_linux26/dest/lib; \
            /usr/bin/install -c -m 644 .libs/pam_afs.so .../amd64_linux26/dest/lib; \
            /usr/bin/install -c -m 644 .libs/pam_afs.krb.so .../amd64_linux26/dest/lib; \
    fi
    /usr/bin/install: cannot stat '.libs/pam_afs.so': No such file or directory
    /usr/bin/install: cannot stat '.libs/pam_afs.krb.so': No such file or directory
    make[3]: *** [dest] Error 1

Building pam plugins doesn't make sense if shared libraries are
disabled, so just turn off pam if --disable-shared is specified, similar
to what we do if pam headers aren't available.

While we're here, slightly restructure the code for setting HAVE_PAM, to
make it easier to add pam-disabling conditions like this.

Change-Id: I7d1f98267ba342dbd7290de40a07da904e65dbe3
Reviewed-on: https://gerrit.openafs.org/15998
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
This commit is contained in:
Andrew Deason 2024-12-18 15:25:25 -06:00
parent 5196ca7b54
commit 60314cbe8e

View File

@ -360,11 +360,12 @@ if test "$enable_debug_locks" = yes; then
AC_DEFINE(OPR_DEBUG_LOCKS, 1, [turn on lock debugging in opr])
fi
if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_pam" = yes; then
HAVE_PAM="yes"
else
HAVE_PAM="no"
fi
dnl Only build pam if pam is enabled, we have pam headers, and we have shared
dnl libs.
AS_IF([test x"$enable_pam" != xyes], [HAVE_PAM=no],
[test x"$ac_cv_header_security_pam_modules_h" != xyes], [HAVE_PAM=no],
[test x"$enable_shared" != xyes], [HAVE_PAM=no],
[HAVE_PAM=yes])
AC_SUBST(HAVE_PAM)
if test "$enable_login" = yes; then