From 013d5a72d47d14000c6022cdf70c1cc3275a0476 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 2 Mar 2010 22:02:56 +0000 Subject: [PATCH] - [Daniel Johnson] I've been trying to build libcurl with clang on Darwin and ran into some issues with the GSSAPI tests in configure.ac. The tests first try to determine the include dirs and libs and set CPPFLAGS and LIBS accordingly. It then checks for the headers and finally sets LIBS a second time, causing the libs to be included twice. The first setting of LIBS seems redundant and should be left out, since the first part is otherwise just about finding headers. My second issue is that 'krb5-config --libs gssapi' on Darwin is less than useless and returns junk that, while it happens to work with gcc, causes clang to choke. For example, --libs returns $CFLAGS along with the libs, which is really retarded. Simply setting 'LIBS="$LIBS -lgssapi_krb5 -lresolv"' on Darwin is sufficient. --- CHANGES | 14 ++++++++++++++ RELEASE-NOTES | 3 ++- configure.ac | 32 ++++++++++++++++++-------------- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index 12ba9b50f..e40441152 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,20 @@ Changelog Daniel Stenberg (2 Mar 2010) +- [Daniel Johnson] I've been trying to build libcurl with clang on Darwin and + ran into some issues with the GSSAPI tests in configure.ac. The tests first + try to determine the include dirs and libs and set CPPFLAGS and LIBS + accordingly. It then checks for the headers and finally sets LIBS a second + time, causing the libs to be included twice. The first setting of LIBS seems + redundant and should be left out, since the first part is otherwise just + about finding headers. + + My second issue is that 'krb5-config --libs gssapi' on Darwin is less than + useless and returns junk that, while it happens to work with gcc, causes + clang to choke. For example, --libs returns $CFLAGS along with the libs, + which is really retarded. Simply setting 'LIBS="$LIBS -lgssapi_krb5 + -lresolv"' on Darwin is sufficient. + - Based on patch provided by Jacob Moshenko, the transfer logic now properly makes sure that when using sub-second timeouts, there's no final bad 1000ms wait. Previously, a sub-second timeout would often make the elapsed time end diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4a6b353d0..b96171cc5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -27,6 +27,7 @@ This release includes the following bugfixes: o skip poll() on Interix o CURLOPT_CERTINFO memory leak o sub-second timeouts improvements + o configure fixes for GSSAPI This release includes the following known bugs: @@ -37,6 +38,6 @@ advice from friends like these: Steven M. Schweda, Yang Tse, Jack Zhang, Tom Donovan, Martin Hager, Daniel Fandrich, Patrick Monnerat, Pat Ray, Wesley Miaw, Ben Greear, - Ryan Chan, Markus Duft, Andrei Benea, Jacob Moshenko + Ryan Chan, Markus Duft, Andrei Benea, Jacob Moshenko, Daniel Johnson Thanks! (and sorry if I forgot to mention someone) diff --git a/configure.ac b/configure.ac index a9a913b2c..2320dce4d 100644 --- a/configure.ac +++ b/configure.ac @@ -1123,15 +1123,12 @@ if test x"$want_gss" = xyes; then if test -z "$GSSAPI_INCS"; then if test -f "$GSSAPI_ROOT/bin/krb5-config"; then GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi` - GSSAPI_LIBS=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi` elif test "$GSSAPI_ROOT" != "yes"; then GSSAPI_INCS="-I$GSSAPI_ROOT/include" - GSSAPI_LIBS="-lgssapi" fi fi CPPFLAGS="$CPPFLAGS $GSSAPI_INCS" - LIBS="$LIBS $GSSAPI_LIBS" AC_CHECK_HEADER(gss.h, [ @@ -1198,17 +1195,24 @@ if test x"$want_gss" = xyes; then LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" LIBS="$LIBS -lgss" elif test -z "$GSSAPI_LIB_DIR"; then - if test -f "$GSSAPI_ROOT/bin/krb5-config"; then - dnl krb5-config doesn't have --libs-only-L or similar, put everything - dnl into LIBS - gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi` - LIBS="$LIBS $gss_libs" - elif test "$GSSAPI_ROOT" != "yes"; then - LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" - LIBS="$LIBS -lgssapi" - else - LIBS="$LIBS -lgssapi" - fi + case $host in + *-*-darwin*) + LIBS="$LIBS -lgssapi_krb5 -lresolv" + ;; + *) + if test -f "$GSSAPI_ROOT/bin/krb5-config"; then + dnl krb5-config doesn't have --libs-only-L or similar, put everything + dnl into LIBS + gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi` + LIBS="$LIBS $gss_libs" + elif test "$GSSAPI_ROOT" != "yes"; then + LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" + LIBS="$LIBS -lgssapi" + else + LIBS="$LIBS -lgssapi" + fi + ;; + esac else LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" LIBS="$LIBS -lgssapi"