build: Divide mit-krb5-gssapi link flags between LDFLAGS and LIBS
authorSimon McVittie <smcv@collabora.com>
Tue, 22 Nov 2022 20:43:41 +0000 (20:43 +0000)
committerCarlos Henrique Lima Melara <charlesmelara@riseup.net>
Sat, 8 Feb 2025 23:08:26 +0000 (00:08 +0100)
From the comments nearby about not having --libs-only-L, it looks as
though the intention was to apply a split like this to all dependency
libraries where possible, and the only reason it was not done for
Kerberos is that krb5-config doesn't have that feature and pkg-config
was originally not supported here. For example, zlib, libssh and librtmp
all have their flags from pkg-config split in this way.

Now that pkg-config is supported here, we can do the intended split.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Gbp-Pq: Name build-Divide-mit-krb5-gssapi-link-flags-between-LDFLAGS-a.patch

configure.ac

index 5501bee56a7de2d4bbb537981bab79a300957cdc..29153f7016e5b2c6def7ecca0e6c1bc1d95bcc8a 100644 (file)
@@ -1959,7 +1959,8 @@ if test x"$want_gss" = xyes; then
           gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
           LIBS="$gss_libs $LIBS"
         elif test "$PKGCONFIG" != "no"; then
-          gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi`
+          LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L mit-krb5-gssapi`"
+          gss_libs=`$PKGCONFIG --libs-only-l mit-krb5-gssapi`
           LIBS="$gss_libs $LIBS"
           link_pkgconfig=1
         elif test -f "$KRB5CONFIG"; then