]> git.ipfire.org Git - thirdparty/cups.git/blob - config-scripts/cups-openssl.m4
081c49d8f5b10677f72ac4a460646e17b27727ec
[thirdparty/cups.git] / config-scripts / cups-openssl.m4
1 dnl
2 dnl "$Id: cups-openssl.m4,v 1.9 2002/06/06 19:39:37 mike Exp $"
3 dnl
4 dnl OpenSSL stuff for the Common UNIX Printing System (CUPS).
5 dnl
6 dnl Copyright 1997-2002 by Easy Software Products, all rights reserved.
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
25 AC_ARG_ENABLE(ssl, [ --enable-ssl turn on SSL/TLS support, default=yes])
26 AC_ARG_WITH(openssl-libs, [ --with-openssl-libs set directory for OpenSSL library],
27 LDFLAGS="-L$withval $LDFLAGS"
28 DSOFLAGS="-L$withval $DSOFLAGS",)
29 AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenSSL includes],
30 CFLAGS="-I$withval $CFLAGS"
31 CXXFLAGS="-I$withval $CXXFLAGS"
32 CPPFLAGS="-I$withval $CPPFLAGS",)
33
34 SSLLIBS=""
35
36 if test x$enable_ssl != xno; then
37 AC_CHECK_HEADER(openssl/ssl.h,
38 dnl Save the current libraries so the crypto stuff isn't always
39 dnl included...
40 SAVELIBS="$LIBS"
41
42 dnl Some ELF systems can't resolve all the symbols in libcrypto
43 dnl if libcrypto was linked against RSAREF, and fail to link the
44 dnl test program correctly, even though a correct installation
45 dnl of OpenSSL exists. So we test the linking three times in
46 dnl case the RSAREF libraries are needed.
47
48 for libcrypto in \
49 "-lcrypto" \
50 "-lcrypto -lrsaref" \
51 "-lcrypto -lRSAglue -lrsaref"
52 do
53 AC_CHECK_LIB(ssl,SSL_new,
54 [SSLLIBS="-lssl $libcrypto"
55 AC_DEFINE(HAVE_LIBSSL)],,
56 $libcrypto)
57
58 if test "x${SSLLIBS}" != "x"; then
59 break
60 fi
61 done
62
63 LIBS="$SAVELIBS")
64 fi
65
66 AC_SUBST(SSLLIBS)
67
68 EXPORT_SSLLIBS="$SSLLIBS"
69 AC_SUBST(EXPORT_SSLLIBS)
70
71
72 dnl
73 dnl End of "$Id: cups-openssl.m4,v 1.9 2002/06/06 19:39:37 mike Exp $".
74 dnl