5488N/A#
5488N/A# Fixes krb5-config to produce correct output on Solaris.
5488N/A#
5488N/A# The krb5-config generated in Userland gate produces some superfluous
5488N/A# output, that can even break some consumers:
5488N/A#
5488N/A# $ /usr/bin/krb5-config --libs krb5
5488N/A# -L/usr/lib/amd64 -R/usr/lib/amd64 -lc -z defs -lkrb5 -lk5crypto -lcom_err
5488N/A#
5488N/A# - default library path and runpath are not required
5488N/A# - explicit paths are 64-bit specific
5488N/A# - explicit linking with libc is not required for shared libraries
5488N/A# - '-z defs' can break samba modules
5488N/A#
5488N/A# Note that we are adding -lc to LDFLAGS in component Makefile, because
5488N/A# Solaris Studio 12.3 and newer no longer auto-adds it for shared objects.
5488N/A# We need -lc for krb5 libs and plugins, but we shouldn't add -lc to
5488N/A# krb5-config output.
5488N/A#
5488N/A# Also note, that we are adding -z defs to LDFLAGS, to achieve complete
5488N/A# dependency closure of krb5 plugins, so that they can be used with RTLD_GROUP.
5488N/A# Using RTLD_GROUP is motivated by symbol clashes avoidance; using direct
5488N/A# bindings is not possible, because we support plugins from outside of Solaris.
5488N/A#
5488N/A# The patch is not intended for upstream contribution.
5488N/A# Patch source: in-house
5488N/A#
6597N/A--- a/src/build-tools/krb5-config.in
6597N/A+++ b/src/build-tools/krb5-config.in
6597N/A@@ -30,10 +30,11 @@ version_string="Kerberos 5 release @KRB5_VERSION@"
5488N/A prefix=@prefix@
5488N/A exec_prefix=@exec_prefix@
5488N/A includedir=@includedir@
5488N/A-libdir=@libdir@
5488N/A+libdir=/usr/lib
5488N/A CC_LINK='@CC_LINK@'
5488N/A KDB5_DB_LIB=@KDB5_DB_LIB@
5488N/A-LDFLAGS='@LDFLAGS@'
5488N/A+# explicitly emptying LDFLAGS
5488N/A+LDFLAGS=
5488N/A RPATH_FLAG='@RPATH_FLAG@'
5488N/A PROG_RPATH_FLAGS='@PROG_RPATH_FLAGS@'
5488N/A PTHREAD_CFLAGS='@PTHREAD_CFLAGS@'
5488N/A@@ -207,6 +208,7 @@ if test -n "$do_libs"; then
5488N/A # Assumes /usr/lib is the standard library directory everywhere...
5488N/A if test "$libdir" = /usr/lib; then
5488N/A libdirarg=
5488N/A+ PROG_RPATH_FLAGS=
5488N/A else
5488N/A libdirarg="-L$libdir"
5488N/A fi