]>
Commit | Line | Data |
---|---|---|
74456259 | 1 | dnl |
bcf61448 | 2 | dnl "$Id: cups-openssl.m4,v 1.4.2.6 2003/01/15 04:25:48 mike Exp $" |
74456259 | 3 | dnl |
bcf61448 | 4 | dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS). |
74456259 | 5 | dnl |
d5660646 | 6 | dnl Copyright 1997-2002 by Easy Software Products, all rights reserved. |
74456259 | 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-3111 USA | |
19 | dnl | |
20 | dnl Voice: (301) 373-9603 | |
21 | dnl EMail: cups-info@cups.org | |
22 | dnl WWW: http://www.cups.org | |
23 | dnl | |
24 | ||
1fc6b5c4 | 25 | AC_ARG_ENABLE(ssl, [ --enable-ssl turn on SSL/TLS support, default=yes]) |
bcf61448 | 26 | AC_ARG_ENABLE(openssl, [ --enable-openssl use OpenSSL for SSL/TLS support, default=yes]) |
27 | AC_ARG_ENABLE(gnutls, [ --enable-gnutls use GNU TLS for SSL/TLS support, default=yes]) | |
9aa1f763 | 28 | AC_ARG_WITH(openssl-libs, [ --with-openssl-libs set directory for OpenSSL library], |
74456259 | 29 | LDFLAGS="-L$withval $LDFLAGS" |
30 | DSOFLAGS="-L$withval $DSOFLAGS",) | |
31 | AC_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 | |
36 | SSLLIBS="" | |
37 | ||
38 | if 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 | 87 | fi |
88 | ||
89 | AC_SUBST(SSLLIBS) | |
90 | ||
91 | dnl | |
bcf61448 | 92 | dnl End of "$Id: cups-openssl.m4,v 1.4.2.6 2003/01/15 04:25:48 mike Exp $". |
74456259 | 93 | dnl |