use pkgconfig
authorLuke Howard <lukeh@padl.com>
Fri, 24 Sep 2010 15:25:25 +0000 (17:25 +0200)
committerLuke Howard <lukeh@padl.com>
Fri, 24 Sep 2010 15:25:25 +0000 (17:25 +0200)
acinclude.m4
init_sec_context.c

index 4e15e0e..0ac828b 100644 (file)
@@ -11,10 +11,10 @@ AC_ARG_WITH(krb5,
     [check_krb5_dir=])
 for dir in $check_krb5_dir /usr /usr/local ; do
    krb5dir="$dir"
-   if test -f "$dir/include/krb5.h"; then
+   if test -x "$dir/bin/krb5-config"; then
      found_krb5="yes";
-     KRB5_DIR="${krb5dir}"
-     KRB5_CFLAGS="-I$krb5dir/include";
+     KRB5_CFLAGS=`$dir/bin/krb5-config gssapi --cflags`;
+     KRB5_LIBS=`$dir/bin/krb5-config gssapi --libs`;
      break;
    fi
 done
@@ -30,10 +30,7 @@ if test x_$found_krb5 != x_yes; then
 ])
 else
        printf "Kerberos found in $krb5dir\n";
-       KRB5_LIBS="-lgssapi_krb5 -lkrb5 -lk5crypto";
-       KRB5_LDFLAGS="-L$krb5dir/lib";
        AC_SUBST(KRB5_CFLAGS)
-       AC_SUBST(KRB5_LDFLAGS)
        AC_SUBST(KRB5_LIBS)
        AC_CHECK_LIB(gssapi_krb5, GSS_C_NT_COMPOSITE_EXPORT, [AC_DEFINE_UNQUOTED([HAVE_GSS_C_NT_COMPOSITE_EXPORT], 1, [Define if GSS-API library supports recent naming extensions draft])], [], "$KRB5_LDFLAGS")
 fi
index 8d55101..cdc5ddb 100644 (file)
@@ -639,6 +639,7 @@ gss_init_sec_context(OM_uint32 *minor,
             goto cleanup;
         }
     } else {
+        /* XXX TODO should we store this in the context handle? */
         major = gssEapAcquireCred(minor, GSS_C_NO_NAME, GSS_C_NO_BUFFER,
                                   time_req, GSS_C_NO_OID_SET, GSS_C_INITIATE,
                                   &defaultCred, NULL, NULL);