]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-ssl.m4
The easysw/current branch should have the same properties as trunk...
[thirdparty/cups.git] / config-scripts / cups-ssl.m4
CommitLineData
ef416fc2 1dnl
7a6a01dd 2dnl "$Id$"
ef416fc2 3dnl
4dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
5dnl
89d46774 6dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
ef416fc2 7dnl
8dnl These coded instructions, statements, and computer programs are the
9dnl property of Easy Software Products and are protected by Federal
10dnl copyright law. Distribution and use rights are outlined in the file
11dnl "LICENSE.txt" which should have been included with this file. If this
12dnl file is missing or damaged please contact Easy Software Products
13dnl at:
14dnl
15dnl Attn: CUPS Licensing Information
16dnl Easy Software Products
17dnl 44141 Airport View Drive, Suite 204
18dnl Hollywood, Maryland 20636 USA
19dnl
20dnl Voice: (301) 373-9600
21dnl EMail: cups-info@cups.org
22dnl WWW: http://www.cups.org
23dnl
24
25AC_ARG_ENABLE(ssl, [ --enable-ssl turn on SSL/TLS support, default=yes])
26AC_ARG_ENABLE(cdsassl, [ --enable-cdsassl use CDSA for SSL/TLS support, default=first])
27AC_ARG_ENABLE(gnutls, [ --enable-gnutls use GNU TLS for SSL/TLS support, default=second])
28AC_ARG_ENABLE(openssl, [ --enable-openssl use OpenSSL for SSL/TLS support, default=third])
29AC_ARG_WITH(openssl-libs, [ --with-openssl-libs set directory for OpenSSL library],
30 LDFLAGS="-L$withval $LDFLAGS"
31 DSOFLAGS="-L$withval $DSOFLAGS",)
32AC_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
37SSLFLAGS=""
38SSLLIBS=""
89d46774 39ENCRYPTION_REQUIRED=""
ef416fc2 40
41if 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"
89d46774 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"
ef416fc2 51 AC_DEFINE(HAVE_SSL)
52 AC_DEFINE(HAVE_CDSASSL)])
53 fi
54 fi
55
56 dnl Then look for GNU TLS...
57 if test "x${SSLLIBS}" = "x" -a "x${enable_gnutls}" != "xno"; then
f301802f 58 AC_PATH_PROG(LIBGNUTLSCONFIG,libgnutls-config)
59 if test "x$LIBGNUTLSCONFIG" != x; then
60 SSLLIBS=`$LIBGNUTLSCONFIG --libs`
61 SSLFLAGS=`$LIBGNUTLSCONFIG --cflags`
62 ENCRYPTION_REQUIRED=" Encryption Required"
63 AC_DEFINE(HAVE_SSL)
64 AC_DEFINE(HAVE_GNUTLS)
65 fi
ef416fc2 66 fi
67
68 dnl Check for the OpenSSL library last...
69 if test "x${SSLLIBS}" = "x" -a "x${enable_openssl}" != "xno"; then
70 AC_CHECK_HEADER(openssl/ssl.h,
71 dnl Save the current libraries so the crypto stuff isn't always
72 dnl included...
73 SAVELIBS="$LIBS"
74
75 dnl Some ELF systems can't resolve all the symbols in libcrypto
76 dnl if libcrypto was linked against RSAREF, and fail to link the
77 dnl test program correctly, even though a correct installation
78 dnl of OpenSSL exists. So we test the linking three times in
79 dnl case the RSAREF libraries are needed.
80
81 for libcrypto in \
82 "-lcrypto" \
83 "-lcrypto -lrsaref" \
84 "-lcrypto -lRSAglue -lrsaref"
85 do
86 AC_CHECK_LIB(ssl,SSL_new,
87 [SSLFLAGS="-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
88 SSLLIBS="-lssl $libcrypto"
89d46774 89 ENCRYPTION_REQUIRED=" Encryption Required"
ef416fc2 90 AC_DEFINE(HAVE_SSL)
91 AC_DEFINE(HAVE_LIBSSL)],,
92 $libcrypto)
93
94 if test "x${SSLLIBS}" != "x"; then
95 break
96 fi
97 done
98
99 LIBS="$SAVELIBS")
100 fi
101fi
102
f301802f 103if test "x$SSLLIBS" != x; then
104 AC_MSG_RESULT([ Using SSLLIBS="$SSLLIBS"])
105 AC_MSG_RESULT([ Using SSLFLAGS="$SSLFLAGS"])
106fi
107
ef416fc2 108AC_SUBST(SSLFLAGS)
109AC_SUBST(SSLLIBS)
89d46774 110AC_SUBST(ENCRYPTION_REQUIRED)
ef416fc2 111
112EXPORT_SSLLIBS="$SSLLIBS"
113AC_SUBST(EXPORT_SSLLIBS)
114
115
116dnl
7a6a01dd 117dnl End of "$Id$".
ef416fc2 118dnl