krb5: Fix spack install krb5 ^openssl~shared (#40306)
This commit is contained in:
		@@ -35,6 +35,7 @@ class Krb5(AutotoolsPackage):
 | 
				
			|||||||
    depends_on("openssl")
 | 
					    depends_on("openssl")
 | 
				
			||||||
    depends_on("gettext")
 | 
					    depends_on("gettext")
 | 
				
			||||||
    depends_on("findutils", type="build")
 | 
					    depends_on("findutils", type="build")
 | 
				
			||||||
 | 
					    depends_on("pkgconfig", type="build", when="^openssl~shared")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    variant(
 | 
					    variant(
 | 
				
			||||||
        "shared", default=True, description="install shared libraries if True, static if false"
 | 
					        "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:
 | 
					        if "%gcc@10:" in self.spec:
 | 
				
			||||||
            args.append("CFLAGS=-fcommon")
 | 
					            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
 | 
					        return args
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def flag_handler(self, name, flags):
 | 
					    def flag_handler(self, name, flags):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user