Linking to a custom heimdal version

Stefan (metze) Metzmacher metze at samba.org
Tue Jan 25 16:11:29 GMT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stefan (metze) Metzmacher schrieb:
| Hi Andrew,
|
| I think I have found what your problem is with linking to a custom heimdal
|
| heimdal's krb5-config returns this:
|
| metze at COMPILIX:~> krb5-config --libs
| -L/usr/lib -lkrb5 -lasn1 -lcrypto -lroken -lcrypt -lresolv
|
| or this for a custom version
|
| metze at COMPILIX:~/samba4/samba4-heimdal/bin> ./krb5-config --libs
| -L/home/People/metze/samba4/samba4-heimdal/lib -lkrb5 -lasn1 -lcrypto
| -lroken -lcrypt -lresolv
|
|
| and MIT krb5-config returns this
|
| metze at routox:~> krb5-config --libs
| -L/usr/lib -Wl,-rpath -Wl,/usr/lib -lkrb5 -lk5crypto -lcom_err
|
| so heimdal is missing the -Wl,-rpath -Wl,<LIBPATH>
|
| that means samba links fine to the custom libs (-L is for that) but at
| runtime the loader uses the
| system libs (-Wl,-rpath... is for this one)

I have a patch for this, but I think -Wl,-rpath is maybe not portable to all linkers, we need to
check that...

But it should fix your current problem, and only add the path flags when they are not the system default


- --
metze

Stefan Metzmacher <metze at samba.org> www.samba.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3-nr1 (Windows XP)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB9m+xm70gjA5TCD8RAqH9AJ9NXshkERGOmBN12+/Cvpr7CG1bvgCeIDXF
CX3pyByNs0rlDOPRJd7yLX0=
=XLXQ
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: tools/krb5-config.in
===================================================================
--- tools/krb5-config.in	(revision 199)
+++ tools/krb5-config.in	(working copy)
@@ -87,7 +87,10 @@
 fi
 
 if test "$do_libs" = "yes"; then
-    lib_flags="-L${libdir}"
+    lib_flags=""
+    if test x"/usr/lib" != x"${libdir}"; then
+    	lib_flags="-L${libdir} -Wl,-rpath -Wl,${libdir}"
+    fi
     case $library in
     gssapi)
 	lib_flags="$lib_flags -lgssapi"


More information about the samba-technical mailing list