]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
5ec1fd3d | 2 | dnl "$Id$" |
ef416fc2 | 3 | dnl |
724e1819 | 4 | dnl TLS stuff for CUPS. |
ef416fc2 | 5 | dnl |
a19c48e0 | 6 | dnl Copyright 2007-2014 by Apple Inc. |
724e1819 | 7 | dnl Copyright 1997-2007 by Easy Software Products, all rights reserved. |
ef416fc2 | 8 | dnl |
724e1819 MS |
9 | dnl These coded instructions, statements, and computer programs are the |
10 | dnl property of Apple Inc. and are protected by Federal copyright | |
11 | dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
12 | dnl which should have been included with this file. If this file is | |
13 | dnl file is missing or damaged, see the license at "http://www.cups.org/". | |
ef416fc2 | 14 | dnl |
15 | ||
bf3816c7 | 16 | AC_ARG_ENABLE(ssl, [ --disable-ssl disable SSL/TLS support]) |
ef416fc2 | 17 | AC_ARG_ENABLE(cdsassl, [ --enable-cdsassl use CDSA for SSL/TLS support, default=first]) |
18 | AC_ARG_ENABLE(gnutls, [ --enable-gnutls use GNU TLS for SSL/TLS support, default=second]) | |
ef416fc2 | 19 | |
20 | SSLFLAGS="" | |
21 | SSLLIBS="" | |
f8b3a85b | 22 | have_ssl=0 |
c41769ff MS |
23 | CUPS_SERVERCERT="" |
24 | CUPS_SERVERKEY="" | |
ef416fc2 | 25 | |
26 | if test x$enable_ssl != xno; then | |
27 | dnl Look for CDSA... | |
0268488e | 28 | if test $have_ssl = 0 -a "x$enable_cdsassl" != "xno"; then |
ef416fc2 | 29 | if test $uname = Darwin; then |
b86bc4cf | 30 | AC_CHECK_HEADER(Security/SecureTransport.h, [ |
f8b3a85b | 31 | have_ssl=1 |
b86bc4cf | 32 | AC_DEFINE(HAVE_SSL) |
33 | AC_DEFINE(HAVE_CDSASSL) | |
c41769ff | 34 | CUPS_SERVERCERT="/Library/Keychains/System.keychain" |
b86bc4cf | 35 | |
36 | dnl Check for the various security headers... | |
eac3a0a0 MS |
37 | AC_CHECK_HEADER(Security/SecureTransportPriv.h, |
38 | AC_DEFINE(HAVE_SECURETRANSPORTPRIV_H)) | |
7cf5915e MS |
39 | AC_CHECK_HEADER(Security/SecCertificate.h, |
40 | AC_DEFINE(HAVE_SECCERTIFICATE_H)) | |
0268488e MS |
41 | AC_CHECK_HEADER(Security/SecItem.h, |
42 | AC_DEFINE(HAVE_SECITEM_H)) | |
c7017ecc | 43 | AC_CHECK_HEADER(Security/SecItemPriv.h, |
eac3a0a0 MS |
44 | AC_DEFINE(HAVE_SECITEMPRIV_H),, |
45 | [#include <Security/SecItem.h>]) | |
b86bc4cf | 46 | AC_CHECK_HEADER(Security/SecPolicy.h, |
47 | AC_DEFINE(HAVE_SECPOLICY_H)) | |
48 | AC_CHECK_HEADER(Security/SecPolicyPriv.h, | |
49 | AC_DEFINE(HAVE_SECPOLICYPRIV_H)) | |
50 | AC_CHECK_HEADER(Security/SecBasePriv.h, | |
51 | AC_DEFINE(HAVE_SECBASEPRIV_H)) | |
52 | AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h, | |
53 | AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H)) | |
54 | ||
eb66bc71 MS |
55 | AC_DEFINE(HAVE_CSSMERRORSTRING) |
56 | AC_DEFINE(HAVE_SECKEYCHAINOPEN)]) | |
ef416fc2 | 57 | fi |
58 | fi | |
59 | ||
60 | dnl Then look for GNU TLS... | |
0268488e | 61 | if test $have_ssl = 0 -a "x$enable_gnutls" != "xno" -a "x$PKGCONFIG" != x; then |
cffefbac MS |
62 | AC_PATH_TOOL(LIBGNUTLSCONFIG,libgnutls-config) |
63 | AC_PATH_TOOL(LIBGCRYPTCONFIG,libgcrypt-config) | |
f11a948a | 64 | if $PKGCONFIG --exists gnutls; then |
eac3a0a0 MS |
65 | have_ssl=1 |
66 | SSLLIBS=`$PKGCONFIG --libs gnutls` | |
67 | SSLFLAGS=`$PKGCONFIG --cflags gnutls` | |
68 | AC_DEFINE(HAVE_SSL) | |
69 | AC_DEFINE(HAVE_GNUTLS) | |
c7017ecc | 70 | elif test "x$LIBGNUTLSCONFIG" != x; then |
eac3a0a0 MS |
71 | have_ssl=1 |
72 | SSLLIBS=`$LIBGNUTLSCONFIG --libs` | |
73 | SSLFLAGS=`$LIBGNUTLSCONFIG --cflags` | |
74 | AC_DEFINE(HAVE_SSL) | |
75 | AC_DEFINE(HAVE_GNUTLS) | |
6d2f911b MS |
76 | fi |
77 | ||
78 | if test $have_ssl = 1; then | |
c41769ff MS |
79 | CUPS_SERVERCERT="ssl/server.crt" |
80 | CUPS_SERVERKEY="ssl/server.key" | |
9483577f MS |
81 | |
82 | SAVELIBS="$LIBS" | |
83 | LIBS="$LIBS $SSLLIBS" | |
84 | AC_CHECK_FUNC(gnutls_transport_set_pull_timeout_function, AC_DEFINE(HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION)) | |
85 | LIBS="$SAVELIBS" | |
f301802f | 86 | fi |
ef416fc2 | 87 | fi |
ef416fc2 | 88 | fi |
89 | ||
eac3a0a0 | 90 | IPPALIASES="http" |
f8b3a85b | 91 | if test $have_ssl = 1; then |
f301802f | 92 | AC_MSG_RESULT([ Using SSLLIBS="$SSLLIBS"]) |
93 | AC_MSG_RESULT([ Using SSLFLAGS="$SSLFLAGS"]) | |
eac3a0a0 | 94 | IPPALIASES="http https ipps" |
724e1819 | 95 | elif test x$enable_cdsa = xyes -o x$enable_gnutls = xyes; then |
0268488e | 96 | AC_MSG_ERROR([Unable to enable SSL support.]) |
f301802f | 97 | fi |
98 | ||
c41769ff MS |
99 | AC_SUBST(CUPS_SERVERCERT) |
100 | AC_SUBST(CUPS_SERVERKEY) | |
eac3a0a0 | 101 | AC_SUBST(IPPALIASES) |
ef416fc2 | 102 | AC_SUBST(SSLFLAGS) |
103 | AC_SUBST(SSLLIBS) | |
104 | ||
105 | EXPORT_SSLLIBS="$SSLLIBS" | |
106 | AC_SUBST(EXPORT_SSLLIBS) | |
107 | ||
ef416fc2 | 108 | dnl |
5ec1fd3d | 109 | dnl End of "$Id$". |
ef416fc2 | 110 | dnl |