]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
5ec1fd3d | 2 | dnl "$Id$" |
ef416fc2 | 3 | dnl |
724e1819 | 4 | dnl TLS stuff for CUPS. |
ef416fc2 | 5 | dnl |
724e1819 MS |
6 | dnl Copyright 2007-2013 by Apple Inc. |
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 | ||
c1420c87 | 55 | AC_DEFINE(HAVE_CSSMERRORSTRING)]) |
ef416fc2 | 56 | fi |
57 | fi | |
58 | ||
59 | dnl Then look for GNU TLS... | |
0268488e | 60 | if test $have_ssl = 0 -a "x$enable_gnutls" != "xno" -a "x$PKGCONFIG" != x; then |
f301802f | 61 | AC_PATH_PROG(LIBGNUTLSCONFIG,libgnutls-config) |
6d2f911b | 62 | AC_PATH_PROG(LIBGCRYPTCONFIG,libgcrypt-config) |
f11a948a | 63 | if $PKGCONFIG --exists gnutls; then |
eac3a0a0 MS |
64 | have_ssl=1 |
65 | SSLLIBS=`$PKGCONFIG --libs gnutls` | |
66 | SSLFLAGS=`$PKGCONFIG --cflags gnutls` | |
67 | AC_DEFINE(HAVE_SSL) | |
68 | AC_DEFINE(HAVE_GNUTLS) | |
c7017ecc | 69 | elif test "x$LIBGNUTLSCONFIG" != x; then |
eac3a0a0 MS |
70 | have_ssl=1 |
71 | SSLLIBS=`$LIBGNUTLSCONFIG --libs` | |
72 | SSLFLAGS=`$LIBGNUTLSCONFIG --cflags` | |
73 | AC_DEFINE(HAVE_SSL) | |
74 | AC_DEFINE(HAVE_GNUTLS) | |
6d2f911b MS |
75 | fi |
76 | ||
77 | if test $have_ssl = 1; then | |
c41769ff MS |
78 | CUPS_SERVERCERT="ssl/server.crt" |
79 | CUPS_SERVERKEY="ssl/server.key" | |
80 | ||
6d2f911b MS |
81 | if $PKGCONFIG --exists gcrypt; then |
82 | SSLLIBS="$SSLLIBS `$PKGCONFIG --libs gcrypt`" | |
83 | SSLFLAGS="$SSLFLAGS `$PKGCONFIG --cflags gcrypt`" | |
c7017ecc | 84 | elif test "x$LIBGCRYPTCONFIG" != x; then |
6d2f911b MS |
85 | SSLLIBS="$SSLLIBS `$LIBGCRYPTCONFIG --libs`" |
86 | SSLFLAGS="$SSLFLAGS `$LIBGCRYPTCONFIG --cflags`" | |
87 | fi | |
f301802f | 88 | fi |
ef416fc2 | 89 | fi |
ef416fc2 | 90 | fi |
91 | ||
eac3a0a0 | 92 | IPPALIASES="http" |
f8b3a85b | 93 | if test $have_ssl = 1; then |
f301802f | 94 | AC_MSG_RESULT([ Using SSLLIBS="$SSLLIBS"]) |
95 | AC_MSG_RESULT([ Using SSLFLAGS="$SSLFLAGS"]) | |
eac3a0a0 | 96 | IPPALIASES="http https ipps" |
724e1819 | 97 | elif test x$enable_cdsa = xyes -o x$enable_gnutls = xyes; then |
0268488e | 98 | AC_MSG_ERROR([Unable to enable SSL support.]) |
f301802f | 99 | fi |
100 | ||
c41769ff MS |
101 | AC_SUBST(CUPS_SERVERCERT) |
102 | AC_SUBST(CUPS_SERVERKEY) | |
eac3a0a0 | 103 | AC_SUBST(IPPALIASES) |
ef416fc2 | 104 | AC_SUBST(SSLFLAGS) |
105 | AC_SUBST(SSLLIBS) | |
106 | ||
107 | EXPORT_SSLLIBS="$SSLLIBS" | |
108 | AC_SUBST(EXPORT_SSLLIBS) | |
109 | ||
ef416fc2 | 110 | dnl |
5ec1fd3d | 111 | dnl End of "$Id$". |
ef416fc2 | 112 | dnl |