Fixed building with gss libs (by Sam Hartman)
authorkouril <kouril>
Mon, 28 Mar 2011 19:13:37 +0000 (19:13 +0000)
committerkouril <kouril>
Mon, 28 Mar 2011 19:13:37 +0000 (19:13 +0000)
Makefile.in
configure.in

index e9005d8..492a4bd 100644 (file)
@@ -1,6 +1,6 @@
 APXS = @APXS@
 GSS_CPPFLAGS = @GSS_CPPFLAGS@
-GSS_LDFLAGS = @GSS_LDFLAGS@
+GSS_LDFLAGS = @GSS_LDFLAGS@ @LIBS@
 SPNEGO_SRCS = @SPNEGO_SRCS@
 
 CPPFLAGS = -I. -Ispnegokrb5 $(GSS_CPPFLAGS) $(DEFS)
index a189bf8..413b539 100644 (file)
@@ -1,4 +1,3 @@
-# Process this file with autoconf to produce a configure script.
 AC_REVISION($Revision$)
 AC_PREREQ(2.57)
 AC_INIT(mod_auth_gssapi, 0.1, modauthkerb-developers@lists.sourceforge.net)
@@ -60,12 +59,16 @@ if test -z "$GSS_LDFLAGS"; then
 # XXX think about lib64, etc
       TMP_GSS_LDFLAGS="-L $with_gss/lib"
    fi
-
-   LIBS="$LIBS $TMP_GSS_LDFLAGS"
-   AC_CHECK_LIB(gssapi, gss_accept_sec_context, [ GSS_LDFLAGS="$TMP_GSS_LDFLAGS" ])
-   LIBS="$ac_save_LIBS"
 fi
-if test -z "$GSS_LDFLAGS"; then
+LIBS="$LIBS $TMP_GSS_LDFLAGS"
+AC_CHECK_LIB(
+       [gssapi_krb5], gss_accept_sec_context,
+       [found_gssapi=yes
+               LIBS="-lgssapi_krb5 $LIBS"],
+       [AC_CHECK_LIB(gssapi, gss_accept_sec_context, [ found_gssapi=yes
+               LIBS="$LIBS -lgssapi"],
+               [LIBS="$ac_save_LIBS"])])
+if test -z "$found_gssapi"; then
    AC_MSG_ERROR([failed to find a GSS-API library])
 fi
 
@@ -83,8 +86,6 @@ LDFLAGS="$GSS_LDFLAGS"
 if test -n "$with_gss"; then
    LDFLAGS="$LDFLAGS -Wl,-rpath -Wl,$with_gss/lib"
 fi
-#XXX schovat nebo dat primo do LDFLAGS:
-LIBS=-lgssapi
      AC_TRY_RUN([
 #include <string.h>
 #include <gssapi.h>
@@ -115,7 +116,7 @@ int main(int argc, char** argv)
 }],
      [ if test $? -eq 0; then 
          AC_MSG_RESULT(yes)
-         AC_DEFINE(GSSAPI_SUPPORTS_SPNEGO)
+         AC_DEFINE(GSSAPI_SUPPORTS_SPNEGO,1,[GSS-API implementation has its own SPNEGO])
          gssapi_supports_spnego=yes 
        else
          AC_MSG_RESULT(no)