krb5: Fix spack install krb5 ^openssl~shared (#40306)

This commit is contained in:
Alex Richert 2023-10-11 10:37:48 -07:00 committed by GitHub
parent fe6860e0d7
commit 86d2200523
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,6 +35,7 @@ class Krb5(AutotoolsPackage):
depends_on("openssl")
depends_on("gettext")
depends_on("findutils", type="build")
depends_on("pkgconfig", type="build", when="^openssl~shared")
variant(
"shared", default=True, description="install shared libraries if True, static if false"
@ -80,6 +81,11 @@ def configure_args(self):
if "%gcc@10:" in self.spec:
args.append("CFLAGS=-fcommon")
if self.spec["openssl"].satisfies("~shared"):
pkgconf = which("pkg-config")
ssllibs = pkgconf("--static", "--libs", "openssl", output=str)
args.append(f"LDFLAGS={ssllibs}")
return args
def flag_handler(self, name, flags):