Use --deps option to krb5-config

Sam Hartman hartmans at MIT.EDU
Sun May 13 16:45:39 EDT 2007

Hi.  While integrating krb5 1.5 into Debian, Russ and I ran into some
trouble.  Krb5 1.6 has several internal dependencies, such as a
dependency on the keyutils library.  For a variety of reasons you
don't actually want these dependencies appearing in shared library
builds for third party applications.  As an example, this would
require applications to be rebuilt if keyutils changese its soname.
Since the keyutils dependency never makes it into the krb5 ABI, it
would normally be sufficient just to rebuild libkrb5.

There's a --deps switch in krb5-config that does nothing today.  I
propose to make it handle this situation and only include dependent
libraries if this switch is used.

I propose the following patch.  If people do not object, I will

=== src/
--- src/	(revision 2796)
+++ src/	(local)
@@ -121,6 +121,7 @@
     echo "        [--prefix]        Kerberos installed prefix"
     echo "        [--exec-prefix]   Kerberos installed exec_prefix"
     echo "        [--cflags]        Compile time CFLAGS"
+    echo "        [--deps]          Include dependent libraries"
     echo "        [--libs]          List libraries required to link [LIBRARIES]"
     echo "Libraries:"
     echo "        krb5              Kerberos 5 application"
@@ -217,7 +218,12 @@
     if test $library = 'krb5'; then
-	lib_flags="$lib_flags -lkrb5 -lk5crypto -lcom_err $GEN_LIB $LIBS $DL_LIB"
+	if [ "x$do_deps" = "x1" ] ; then
+	    dep_libs="$GEN_LIB $LIBS $DL_LIB"
+	    else
+	    dep_libs=""
+	    fi
+	lib_flags="$lib_flags -lkrb5 -lk5crypto -lcom_err  $dep_libs"
     echo $lib_flags

More information about the krbdev mailing list