]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-openssl.m4
Mirror 1.1.x changes.
[thirdparty/cups.git] / config-scripts / cups-openssl.m4
CommitLineData
74456259 1dnl
bcf61448 2dnl "$Id: cups-openssl.m4,v 1.4.2.6 2003/01/15 04:25:48 mike Exp $"
74456259 3dnl
bcf61448 4dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
74456259 5dnl
d5660646 6dnl Copyright 1997-2002 by Easy Software Products, all rights reserved.
74456259 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-3111 USA
19dnl
20dnl Voice: (301) 373-9603
21dnl EMail: cups-info@cups.org
22dnl WWW: http://www.cups.org
23dnl
24
1fc6b5c4 25AC_ARG_ENABLE(ssl, [ --enable-ssl turn on SSL/TLS support, default=yes])
bcf61448 26AC_ARG_ENABLE(openssl, [ --enable-openssl use OpenSSL for SSL/TLS support, default=yes])
27AC_ARG_ENABLE(gnutls, [ --enable-gnutls use GNU TLS for SSL/TLS support, default=yes])
9aa1f763 28AC_ARG_WITH(openssl-libs, [ --with-openssl-libs set directory for OpenSSL library],
74456259 29 LDFLAGS="-L$withval $LDFLAGS"
30 DSOFLAGS="-L$withval $DSOFLAGS",)
31AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenSSL includes],
32 CFLAGS="-I$withval $CFLAGS"
fb1d0a08 33 CXXFLAGS="-I$withval $CXXFLAGS"
34 CPPFLAGS="-I$withval $CPPFLAGS",)
74456259 35
36SSLLIBS=""
37
38if test x$enable_ssl != xno; then
bcf61448 39 if test x$enable_openssl != xno; then
40 AC_CHECK_HEADER(openssl/ssl.h,
41 dnl Save the current libraries so the crypto stuff isn't always
42 dnl included...
43 SAVELIBS="$LIBS"
74456259 44
bcf61448 45 dnl Some ELF systems can't resolve all the symbols in libcrypto
46 dnl if libcrypto was linked against RSAREF, and fail to link the
47 dnl test program correctly, even though a correct installation
48 dnl of OpenSSL exists. So we test the linking three times in
49 dnl case the RSAREF libraries are needed.
74456259 50
bcf61448 51 for libcrypto in \
52 "-lcrypto" \
53 "-lcrypto -lrsaref" \
54 "-lcrypto -lRSAglue -lrsaref"
55 do
56 AC_CHECK_LIB(ssl,SSL_new,
57 [SSLLIBS="-lssl $libcrypto"
58 AC_DEFINE(HAVE_SSL)
59 AC_DEFINE(HAVE_LIBSSL)],,
60 $libcrypto)
74456259 61
bcf61448 62 if test "x${SSLLIBS}" != "x"; then
63 break
64 fi
65 done
74456259 66
bcf61448 67 LIBS="$SAVELIBS")
68 fi
69
70 dnl If OpenSSL wasn't found, look for GNU TLS...
71
72 if test "x${SSLLIBS}" == "x" -a "x${enable_gnutls}" != "xno"; then
73 AC_CHECK_HEADER(gnutls/gnutls.h,
74 dnl Save the current libraries so the crypto stuff isn't always
75 dnl included...
76 SAVELIBS="$LIBS"
77
78 TEST_GNUTLS_LIBS=`libgnutls-config --libs`
79 AC_CHECK_LIB(gnutls, gnutls_init,
80 [SSLLIBS=$TEST_GNUTLS_LIBS
81 AC_DEFINE(HAVE_SSL)
82 AC_DEFINE(HAVE_GNUTLS)],,
83 $TEST_GNUTLS_LIBS)
84
85 LIBS="$SAVELIBS")
86 fi
74456259 87fi
88
89AC_SUBST(SSLLIBS)
90
91dnl
bcf61448 92dnl End of "$Id: cups-openssl.m4,v 1.4.2.6 2003/01/15 04:25:48 mike Exp $".
74456259 93dnl