From: George Chow Date: Thu, 18 Jun 2026 18:40:36 +0000 (-0700) Subject: Add MACOS_FRAMEWORK to static link flags X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fkrb5.git Add MACOS_FRAMEWORK to static link flags 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. --- diff --git a/src/build-tools/mit-krb5.pc.in b/src/build-tools/mit-krb5.pc.in index fdc557785a..e5fde402c0 100644 --- a/src/build-tools/mit-krb5.pc.in +++ b/src/build-tools/mit-krb5.pc.in @@ -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@ diff --git a/src/config/pre.in b/src/config/pre.in index d165ba9cc5..a59f6ca90a 100644 --- a/src/config/pre.in +++ b/src/config/pre.in @@ -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)