- [Daniel Johnson] I've been trying to build libcurl with clang on Darwin and
authorDaniel Stenberg <daniel@haxx.se>
Tue, 2 Mar 2010 22:02:56 +0000 (22:02 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 2 Mar 2010 22:02:56 +0000 (22:02 +0000)
  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
RELEASE-NOTES
configure.ac

diff --git a/CHANGES b/CHANGES
index 12ba9b5..e404411 100644 (file)
--- 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
index 4a6b353..b96171c 100644 (file)
@@ -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)
index a9a913b..2320dce 100644 (file)
@@ -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"