]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - config-scripts/cups-ssl.m4
Load cups into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-ssl.m4
index 6147b3e8cd1dff337bd2db3ff7972ee9c99fd769..a208b712f160eb70068f5723d262c57def1aa945 100644 (file)
@@ -1,9 +1,9 @@
 dnl
-dnl "$Id: cups-ssl.m4 5466 2006-04-26 19:52:27Z mike $"
+dnl "$Id: cups-ssl.m4 6237 2007-02-06 15:56:14Z mike $"
 dnl
 dnl   OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
 dnl
-dnl   Copyright 1997-2006 by Easy Software Products, all rights reserved.
+dnl   Copyright 1997-2007 by Easy Software Products, all rights reserved.
 dnl
 dnl   These coded instructions, statements, and computer programs are the
 dnl   property of Easy Software Products and are protected by Federal
@@ -42,31 +42,46 @@ if test x$enable_ssl != xno; then
     dnl Look for CDSA...
     if test "x${SSLLIBS}" = "x" -a "x${enable_cdsassl}" != "xno"; then
        if test $uname = Darwin; then
-           AC_CHECK_HEADER(Security/SecureTransport.h,
-               [SSLLIBS="-framework CoreFoundation -framework Security"
-                # MacOS X doesn't (yet) come with pre-installed encryption
-                # certificates for CUPS, so don't enable encryption on
-                # /admin just yet...
-                #ENCRYPTION_REQUIRED="  Encryption Required"
-                AC_DEFINE(HAVE_SSL)
-                AC_DEFINE(HAVE_CDSASSL)])
+           AC_CHECK_HEADER(Security/SecureTransport.h, [
+               SSLLIBS="-framework CoreFoundation -framework Security"
+               # MacOS X doesn't (yet) come with pre-installed encryption
+               # certificates for CUPS, so don't enable encryption on
+               # /admin just yet...
+               #ENCRYPTION_REQUIRED="  Encryption Required"
+               AC_DEFINE(HAVE_SSL)
+               AC_DEFINE(HAVE_CDSASSL)
+
+               dnl Check for the various security headers...
+               AC_CHECK_HEADER(Security/SecPolicy.h,
+                   AC_DEFINE(HAVE_SECPOLICY_H))
+               AC_CHECK_HEADER(Security/SecPolicyPriv.h,
+                   AC_DEFINE(HAVE_SECPOLICYPRIV_H))
+               AC_CHECK_HEADER(Security/SecBasePriv.h,
+                   AC_DEFINE(HAVE_SECBASEPRIV_H))
+               AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h,
+                   AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))
+
+               dnl Check for SecIdentitySearchCreateWithPolicy...
+               AC_MSG_CHECKING(for SecIdentitySearchCreateWithPolicy)
+               if test $uversion -ge 80; then
+                   AC_DEFINE(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY)
+                   AC_MSG_RESULT(yes)
+               else
+                   AC_MSG_RESULT(no)
+               fi])
        fi
     fi
 
     dnl Then look for GNU TLS...
     if test "x${SSLLIBS}" = "x" -a "x${enable_gnutls}" != "xno"; then
-       AC_CHECK_HEADER(gnutls/gnutls.h,
-           dnl Save the current libraries so the crypto stuff isn't always
-           dnl included...
-           SAVELIBS="$LIBS"
-
-           AC_CHECK_LIB(gnutls, gnutls_x509_crt_set_dn_by_oid,
-               [SSLLIBS="-lgnutls"
-                ENCRYPTION_REQUIRED="  Encryption Required"
-                AC_DEFINE(HAVE_SSL)
-                AC_DEFINE(HAVE_GNUTLS)])
-
-           LIBS="$SAVELIBS")
+       AC_PATH_PROG(LIBGNUTLSCONFIG,libgnutls-config)
+       if test "x$LIBGNUTLSCONFIG" != x; then
+           SSLLIBS=`$LIBGNUTLSCONFIG --libs`
+           SSLFLAGS=`$LIBGNUTLSCONFIG --cflags`
+           ENCRYPTION_REQUIRED="  Encryption Required"
+           AC_DEFINE(HAVE_SSL)
+           AC_DEFINE(HAVE_GNUTLS)
+       fi
     fi
 
     dnl Check for the OpenSSL library last...
@@ -104,6 +119,11 @@ if test x$enable_ssl != xno; then
     fi
 fi
 
+if test "x$SSLLIBS" != x; then
+    AC_MSG_RESULT([    Using SSLLIBS="$SSLLIBS"])
+    AC_MSG_RESULT([    Using SSLFLAGS="$SSLFLAGS"])
+fi
+
 AC_SUBST(SSLFLAGS)
 AC_SUBST(SSLLIBS)
 AC_SUBST(ENCRYPTION_REQUIRED)
@@ -113,5 +133,5 @@ AC_SUBST(EXPORT_SSLLIBS)
 
 
 dnl
-dnl End of "$Id: cups-ssl.m4 5466 2006-04-26 19:52:27Z mike $".
+dnl End of "$Id: cups-ssl.m4 6237 2007-02-06 15:56:14Z mike $".
 dnl