]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-ssl.m4
Load cups into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-ssl.m4
CommitLineData
ef416fc2 1dnl
bc44d920 2dnl "$Id: cups-ssl.m4 6649 2007-07-11 21:46:42Z mike $"
ef416fc2 3dnl
4dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
5dnl
bc44d920 6dnl Copyright 2007 by Apple Inc.
b86bc4cf 7dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
ef416fc2 8dnl
9dnl These coded instructions, statements, and computer programs are the
bc44d920 10dnl property of Apple Inc. and are protected by Federal copyright
11dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
12dnl which should have been included with this file. If this file is
13dnl file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 14dnl
15
16AC_ARG_ENABLE(ssl, [ --enable-ssl turn on SSL/TLS support, default=yes])
17AC_ARG_ENABLE(cdsassl, [ --enable-cdsassl use CDSA for SSL/TLS support, default=first])
18AC_ARG_ENABLE(gnutls, [ --enable-gnutls use GNU TLS for SSL/TLS support, default=second])
19AC_ARG_ENABLE(openssl, [ --enable-openssl use OpenSSL for SSL/TLS support, default=third])
20AC_ARG_WITH(openssl-libs, [ --with-openssl-libs set directory for OpenSSL library],
21 LDFLAGS="-L$withval $LDFLAGS"
22 DSOFLAGS="-L$withval $DSOFLAGS",)
23AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenSSL includes],
24 CFLAGS="-I$withval $CFLAGS"
25 CXXFLAGS="-I$withval $CXXFLAGS"
26 CPPFLAGS="-I$withval $CPPFLAGS",)
27
28SSLFLAGS=""
29SSLLIBS=""
89d46774 30ENCRYPTION_REQUIRED=""
ef416fc2 31
32if test x$enable_ssl != xno; then
33 dnl Look for CDSA...
34 if test "x${SSLLIBS}" = "x" -a "x${enable_cdsassl}" != "xno"; then
35 if test $uname = Darwin; then
b86bc4cf 36 AC_CHECK_HEADER(Security/SecureTransport.h, [
37 SSLLIBS="-framework CoreFoundation -framework Security"
38 # MacOS X doesn't (yet) come with pre-installed encryption
39 # certificates for CUPS, so don't enable encryption on
40 # /admin just yet...
41 #ENCRYPTION_REQUIRED=" Encryption Required"
42 AC_DEFINE(HAVE_SSL)
43 AC_DEFINE(HAVE_CDSASSL)
44
45 dnl Check for the various security headers...
46 AC_CHECK_HEADER(Security/SecPolicy.h,
47 AC_DEFINE(HAVE_SECPOLICY_H))
48 AC_CHECK_HEADER(Security/SecPolicyPriv.h,
49 AC_DEFINE(HAVE_SECPOLICYPRIV_H))
50 AC_CHECK_HEADER(Security/SecBasePriv.h,
51 AC_DEFINE(HAVE_SECBASEPRIV_H))
52 AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h,
53 AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))
54
55 dnl Check for SecIdentitySearchCreateWithPolicy...
56 AC_MSG_CHECKING(for SecIdentitySearchCreateWithPolicy)
57 if test $uversion -ge 80; then
58 AC_DEFINE(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY)
59 AC_MSG_RESULT(yes)
60 else
61 AC_MSG_RESULT(no)
62 fi])
ef416fc2 63 fi
64 fi
65
66 dnl Then look for GNU TLS...
67 if test "x${SSLLIBS}" = "x" -a "x${enable_gnutls}" != "xno"; then
f301802f 68 AC_PATH_PROG(LIBGNUTLSCONFIG,libgnutls-config)
69 if test "x$LIBGNUTLSCONFIG" != x; then
70 SSLLIBS=`$LIBGNUTLSCONFIG --libs`
71 SSLFLAGS=`$LIBGNUTLSCONFIG --cflags`
72 ENCRYPTION_REQUIRED=" Encryption Required"
73 AC_DEFINE(HAVE_SSL)
74 AC_DEFINE(HAVE_GNUTLS)
75 fi
ef416fc2 76 fi
77
78 dnl Check for the OpenSSL library last...
79 if test "x${SSLLIBS}" = "x" -a "x${enable_openssl}" != "xno"; then
80 AC_CHECK_HEADER(openssl/ssl.h,
81 dnl Save the current libraries so the crypto stuff isn't always
82 dnl included...
83 SAVELIBS="$LIBS"
84
85 dnl Some ELF systems can't resolve all the symbols in libcrypto
86 dnl if libcrypto was linked against RSAREF, and fail to link the
87 dnl test program correctly, even though a correct installation
88 dnl of OpenSSL exists. So we test the linking three times in
89 dnl case the RSAREF libraries are needed.
90
91 for libcrypto in \
92 "-lcrypto" \
93 "-lcrypto -lrsaref" \
94 "-lcrypto -lRSAglue -lrsaref"
95 do
96 AC_CHECK_LIB(ssl,SSL_new,
97 [SSLFLAGS="-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
98 SSLLIBS="-lssl $libcrypto"
89d46774 99 ENCRYPTION_REQUIRED=" Encryption Required"
ef416fc2 100 AC_DEFINE(HAVE_SSL)
101 AC_DEFINE(HAVE_LIBSSL)],,
102 $libcrypto)
103
104 if test "x${SSLLIBS}" != "x"; then
105 break
106 fi
107 done
108
109 LIBS="$SAVELIBS")
110 fi
111fi
112
f301802f 113if test "x$SSLLIBS" != x; then
114 AC_MSG_RESULT([ Using SSLLIBS="$SSLLIBS"])
115 AC_MSG_RESULT([ Using SSLFLAGS="$SSLFLAGS"])
116fi
117
ef416fc2 118AC_SUBST(SSLFLAGS)
119AC_SUBST(SSLLIBS)
89d46774 120AC_SUBST(ENCRYPTION_REQUIRED)
ef416fc2 121
122EXPORT_SSLLIBS="$SSLLIBS"
123AC_SUBST(EXPORT_SSLLIBS)
124
125
126dnl
bc44d920 127dnl End of "$Id: cups-ssl.m4 6649 2007-07-11 21:46:42Z mike $".
ef416fc2 128dnl