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