2 dnl "$Id: cups-ssl.m4 5457 2006-04-24 15:36:12Z mike $"
4 dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
6 dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
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
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
20 dnl Voice: (301) 373-9600
21 dnl EMail: cups-info@cups.org
22 dnl WWW: http://www.cups.org
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",)
39 ENCRYPTION_REQUIRED=""
41 if test x$enable_ssl != xno; then
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
50 #ENCRYPTION_REQUIRED=" Encryption Required"
52 AC_DEFINE(HAVE_CDSASSL)])
56 dnl Then look for GNU TLS...
57 if test "x${SSLLIBS}" = "x" -a "x${enable_gnutls}" != "xno"; then
58 AC_CHECK_HEADER(gnutls/gnutls.h,
59 dnl Save the current libraries so the crypto stuff isn't always
63 AC_CHECK_LIB(gnutls, gnutls_x509_crt_set_dn_by_oid,
65 ENCRYPTION_REQUIRED=" Encryption Required"
67 AC_DEFINE(HAVE_GNUTLS)])
72 dnl Check for the OpenSSL library last...
73 if test "x${SSLLIBS}" = "x" -a "x${enable_openssl}" != "xno"; then
74 AC_CHECK_HEADER(openssl/ssl.h,
75 dnl Save the current libraries so the crypto stuff isn't always
79 dnl Some ELF systems can't resolve all the symbols in libcrypto
80 dnl if libcrypto was linked against RSAREF, and fail to link the
81 dnl test program correctly, even though a correct installation
82 dnl of OpenSSL exists. So we test the linking three times in
83 dnl case the RSAREF libraries are needed.
88 "-lcrypto -lRSAglue -lrsaref"
90 AC_CHECK_LIB(ssl,SSL_new,
91 [SSLFLAGS="-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
92 SSLLIBS="-lssl $libcrypto"
93 ENCRYPTION_REQUIRED=" Encryption Required"
95 AC_DEFINE(HAVE_LIBSSL)],,
98 if test "x${SSLLIBS}" != "x"; then
109 AC_SUBST(ENCRYPTION_REQUIRED)
111 EXPORT_SSLLIBS="$SSLLIBS"
112 AC_SUBST(EXPORT_SSLLIBS)
116 dnl End of "$Id: cups-ssl.m4 5457 2006-04-24 15:36:12Z mike $".