]> 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
2dnl "$Id: cups-ssl.m4 4800 2005-10-18 18:06:20Z mike $"
3dnl
4dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
5dnl
6dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
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=""
39
40if test x$enable_ssl != xno; then
41 dnl Look for CDSA...
42 if test "x${SSLLIBS}" = "x" -a "x${enable_cdsassl}" != "xno"; then
43 if test $uname = Darwin; then
44 AC_CHECK_HEADER(Security/SecureTransport.h,
45 [SSLLIBS="-framework CoreFoundation -framework Security"
46 AC_DEFINE(HAVE_SSL)
47 AC_DEFINE(HAVE_CDSASSL)])
48 fi
49 fi
50
51 dnl Then look for GNU TLS...
52 if test "x${SSLLIBS}" = "x" -a "x${enable_gnutls}" != "xno"; then
53 AC_CHECK_HEADER(gnutls/gnutls.h,
54 dnl Save the current libraries so the crypto stuff isn't always
55 dnl included...
56 SAVELIBS="$LIBS"
57
58 AC_CHECK_LIB(gnutls, gnutls_init,
59 [SSLLIBS="-lgnutls"
60 AC_DEFINE(HAVE_SSL)
61 AC_DEFINE(HAVE_GNUTLS)])
62
63 LIBS="$SAVELIBS")
64 fi
65
66 dnl Check for the OpenSSL library last...
67 if test "x${SSLLIBS}" = "x" -a "x${enable_openssl}" != "xno"; then
68 AC_CHECK_HEADER(openssl/ssl.h,
69 dnl Save the current libraries so the crypto stuff isn't always
70 dnl included...
71 SAVELIBS="$LIBS"
72
73 dnl Some ELF systems can't resolve all the symbols in libcrypto
74 dnl if libcrypto was linked against RSAREF, and fail to link the
75 dnl test program correctly, even though a correct installation
76 dnl of OpenSSL exists. So we test the linking three times in
77 dnl case the RSAREF libraries are needed.
78
79 for libcrypto in \
80 "-lcrypto" \
81 "-lcrypto -lrsaref" \
82 "-lcrypto -lRSAglue -lrsaref"
83 do
84 AC_CHECK_LIB(ssl,SSL_new,
85 [SSLFLAGS="-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
86 SSLLIBS="-lssl $libcrypto"
87 AC_DEFINE(HAVE_SSL)
88 AC_DEFINE(HAVE_LIBSSL)],,
89 $libcrypto)
90
91 if test "x${SSLLIBS}" != "x"; then
92 break
93 fi
94 done
95
96 LIBS="$SAVELIBS")
97 fi
98fi
99
100AC_SUBST(SSLFLAGS)
101AC_SUBST(SSLLIBS)
102
103EXPORT_SSLLIBS="$SSLLIBS"
104AC_SUBST(EXPORT_SSLLIBS)
105
106
107dnl
108dnl End of "$Id: cups-ssl.m4 4800 2005-10-18 18:06:20Z mike $".
109dnl