|author||Guy Harris <email@example.com>||2004-09-25 09:33:53 +0000|
|committer||Guy Harris <firstname.lastname@example.org>||2004-09-25 09:33:53 +0000|
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
@@ -1009,18 +1009,28 @@ AC_DEFUN([AC_ETHEREAL_KRB5_CHECK],
- KRB5_LIBS=`"$KRB5_CONFIG" --libs | sed 's/-lcrypto//'`
- KRB5_LIBS="$KRB5_LIBS $SSL_LIBS"
- # 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"
- KRB5_LIBS="$KRB5_LIBS -lresolv"
- AC_MSG_RESULT(Adding -lresolv to libs)
+ KRB5_LIBS=`"$KRB5_CONFIG" --libs | sed 's/-lcrypto//'`
+ KRB5_LIBS="$KRB5_LIBS $SSL_LIBS"
+ # 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/'`