path: root/acinclude.m4
diff options
authorGuy Harris <guy@alum.mit.edu>2004-09-25 09:33:53 +0000
committerGuy Harris <guy@alum.mit.edu>2004-09-25 09:33:53 +0000
commitd0842822ada578c47644bc217530d128aad31ee0 (patch)
tree528a77d617dc4288e1556f419c9a6b355a4e6d48 /acinclude.m4
parent477eef9312cf7d7740466102875600d72ab537f9 (diff)
Don't just add "-lresolv" to KRB5_LIBS if it's missing - on some
platforms, it's missing because it's not needed, which is good because it's not even *present* on those platforms (the resolver functions are built into libc). If there really are platforms where krb5-config is broken to the extent that it doesn't list -lresolv when it's required, the way to fix that is to try building a program with Heimdal and just the krb5-config libraries and, if that fails, try building with those libraries and -lresolv - if that works, add -lresolv to the list of libraries. Don't just replace -lcrypto with SSL_LIBS in KRB5_LIBS, as SSL_LIBS might not contain any libraries - replace it only if SSL_LIBS is defined as something. svn path=/trunk/; revision=12099
Diffstat (limited to 'acinclude.m4')
1 files changed, 20 insertions, 10 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index c5339c8a3b..972cdc4fe8 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1009,18 +1009,28 @@ AC_DEFUN([AC_ETHEREAL_KRB5_CHECK],
KRB5_FLAGS=`"$KRB5_CONFIG" --cflags`
- KRB5_LIBS=`"$KRB5_CONFIG" --libs | sed 's/-lcrypto//'`
- # Looks like krb5-config is lacking -lresolv on some systems
- AC_MSG_CHECKING(whether library list looks OK)
- if echo "$KRB5_LIBS" | grep resolv >/dev/null
+ #
+ # If we've set SSL_LIBS, use that instead of -lcrypto
+ # in KRB5_LIBS.
+ #
+ if test ! -z "$SSL_LIBS"
- else
- KRB5_LIBS="$KRB5_LIBS -lresolv"
- AC_MSG_RESULT(Adding -lresolv to libs)
+ KRB5_LIBS=`"$KRB5_CONFIG" --libs | sed 's/-lcrypto//'`
+ #
+ # Looks like krb5-config is lacking -lresolv on some systems.
+ # At least on some of those systems (such as FreeBSD 4.6),
+ # this is because it is not required and, in fact, is not
+ # even present! This means that just adding -lresolv
+ # if it's missing is the wrong thing to do.
+ #
+ # If there are systems where it's not present, but is
+ # required, we'd have to add a test that tries to link
+ # a program using Heimdal with just KRB5_LIBS and, if
+ # that fails, adds -lresolv to KRB5_LIBS and tries that.
+ #
+ #
ac_krb5_version=`"$KRB5_CONFIG" --version | head -n 1 | sed 's/^.*heimdal.*$/HEIMDAL/'`