Hi folks,

here is a patch which corrects configure.ac to compile against fbopenssl SPNEGO library.
The changes and reasons in/for this patch:

0. Undefined variable used => broken
1. Improve/align wording of messages
2. Provide a reasonable SPNEGO_ROOT where fbopenssl is installed (the path layout provided by fbopenssl Makefile is unusable, one mus copy manually)
3. Put -lfbopenssl into LIBS and not LDFLAGS
4. Moved after GSS-API block because it is a prerequisite (for upcoming patches in that area from my side)

Patch has been tested on Ubuntu and HP-UX.

Git diff: https://github.com/michael-o/curl/compare/configure-spnego

Please review and report back,

Michael
diff --git a/configure.ac b/configure.ac
index 1177244..cd7f7d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1135,41 +1135,6 @@ no)
 esac
 
 dnl **********************************************************************
-dnl Check for FBopenssl(SPNEGO) libraries
-dnl **********************************************************************
-
-AC_ARG_WITH(spnego,
-  AC_HELP_STRING([--with-spnego=DIR],
-                 [Specify location of SPNEGO library fbopenssl]), [
-  SPNEGO_ROOT="$withval"
-  if test x"$SPNEGO_ROOT" != xno; then
-    want_spnego="yes"
-  fi
-])
-
-AC_MSG_CHECKING([if SPNEGO support is requested])
-if test x"$want_spnego" = xyes; then
-
-  if test X"$SPNEGO_ROOT" = Xyes; then
-     AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where 
specified!])
-     AC_MSG_RESULT(no)
-  else
-     if test -z "$SPNEGO_LIB_DIR"; then
-        LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
-     else
-        LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
-     fi
-
-     AC_MSG_RESULT(yes)
-     AC_DEFINE(HAVE_SPNEGO, 1,
-               [Define this if you have the SPNEGO library fbopenssl])
-     curl_spnego_msg="enabled"
-  fi
-else
-  AC_MSG_RESULT(no)
-fi
-
-dnl **********************************************************************
 dnl Check for GSS-API libraries
 dnl **********************************************************************
 
@@ -1329,6 +1294,41 @@ else
   CPPFLAGS="$save_CPPFLAGS"
 fi
 
+dnl **********************************************************************
+dnl Check for the fbopenssl SPNEGO library
+dnl **********************************************************************
+
+dnl check for fbopenssl in the /usr/local as default
+
+SPNEGO_ROOT="/usr/local"
+AC_ARG_WITH(spnego,
+  AC_HELP_STRING([--with-spnego=DIR],
+                 [Where to look for the fbopenssl SPNEGO library]), [
+  SPNEGO_ROOT="$withval"
+  if test x"$SPNEGO_ROOT" != xno; then
+    want_spnego="yes"
+    if test x"$SPNEGO_ROOT" = xyes; then
+      dnl if yes, then use default root
+      SPNEGO_ROOT="/usr/local"
+    fi
+  fi
+])
+
+AC_MSG_CHECKING([if SPNEGO support is requested])
+if test x"$want_spnego" = xyes; then
+AC_MSG_RESULT(yes)
+
+  CPPFLAGS="$CPPFLAGS -I$SPNEGO_ROOT/include"
+  LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT/lib$libsuff"
+  LIBS="-lfbopenssl $LIBS"
+
+   AC_DEFINE(HAVE_SPNEGO, 1,
+             [if you have the fbopenssl SPNEGO library])
+  curl_spnego_msg="enabled"
+else
+  AC_MSG_RESULT(no)
+fi
+
 dnl -------------------------------------------------
 dnl check winssl option before other SSL libraries
 dnl -------------------------------------------------
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to