]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Add MACOS_FRAMEWORK to static link flags master
authorGeorge Chow <george@overcoil.com>
Thu, 18 Jun 2026 18:40:36 +0000 (11:40 -0700)
committerGreg Hudson <ghudson@mit.edu>
Wed, 15 Jul 2026 21:15:09 +0000 (17:15 -0400)
When building statically on macOS, the CoreFoundation and Security
frameworks required by krb5 are not propagated to consumers via
pkg-config or the Makefile link variables.  This causes linker failures
when an application links against the static krb5 libraries without
separately specifying the framework flags.

Add @MACOS_FRAMEWORK@ to Libs.private in mit-krb5.pc.in, so pkg-config
--static exposes it, and to KRB5_BASE_LIBS in config/pre.in, so the
build system includes it when linking executables against the static
libraries.

src/build-tools/mit-krb5.pc.in
src/config/pre.in

index fdc557785ad483d518c961d16989b65f57e96734..e5fde402c0cd8ef410686c77351d6b0f5be33c16 100644 (file)
@@ -12,4 +12,4 @@ Description: An implementation of Kerberos network authentication
 Version: @KRB5_VERSION@
 Cflags: -I${includedir}
 Libs: -L${libdir} -lkrb5 -lk5crypto @COM_ERR_LIB@
-Libs.private: -lkrb5support
+Libs.private: -lkrb5support @MACOS_FRAMEWORK@ @LIBS@ @DL_LIB@
index d165ba9cc586c618afd1769ebdc9d8fdabdd9c17..a59f6ca90afc663e668377363f2acd3143f13a07 100644 (file)
@@ -370,6 +370,8 @@ CMOCKA_LIBS = @CMOCKA_LIBS@
 LDAP_LIBS      = @LDAP_LIBS@
 LMDB_LIBS      = @LMDB_LIBS@
 
+MACOS_FRAMEWORK = @MACOS_FRAMEWORK@
+
 KRB5_LIB                       = -lkrb5
 K5CRYPTO_LIB                   = -lk5crypto
 GSS_KRB5_LIB                   = -lgssapi_krb5
@@ -378,7 +380,7 @@ SUPPORT_LIB                 = -l$(SUPPORT_LIBNAME)
 # HESIOD_LIBS is -lhesiod...
 HESIOD_LIBS    = @HESIOD_LIBS@
 
-KRB5_BASE_LIBS = $(KRB5_LIB) $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) $(LIBS) $(DL_LIB)
+KRB5_BASE_LIBS = $(KRB5_LIB) $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) $(MACOS_FRAMEWORK) $(LIBS) $(DL_LIB)
 KDB5_LIBS      = $(KDB5_LIB) $(GSSRPC_LIBS)
 GSS_LIBS       = $(GSS_KRB5_LIB)
 GSSRPC_LIBS    = -lgssrpc $(GSS_LIBS)