From 60314cbe8e5688f30a2c303348a898fbc7bad1a6 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 18 Dec 2024 15:25:25 -0600 Subject: [PATCH] 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 Reviewed-by: Cheyenne Wills Tested-by: BuildBot Reviewed-by: Andrew Deason --- src/cf/options.m4 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/cf/options.m4 b/src/cf/options.m4 index f559d30ada..ba14bf2ec4 100644 --- a/src/cf/options.m4 +++ b/src/cf/options.m4 @@ -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