2 dnl AUTHOR: Squid Web Cache team
4 dnl SQUID Web Proxy Cache http://www.squid-cache.org/
5 dnl ----------------------------------------------------------
6 dnl Squid is the result of efforts by numerous individuals from
7 dnl the Internet community; see the CONTRIBUTORS file for full
8 dnl details. Many organizations have provided support for Squid's
9 dnl development; see the SPONSORS file for full details. Squid is
10 dnl Copyrighted (C) 2001 by the Regents of the University of
11 dnl California; see the COPYRIGHT file for full details. Squid
12 dnl incorporates software developed and/or copyrighted by other
13 dnl sources; see the CREDITS file for full details.
15 dnl This program is free software; you can redistribute it and/or modify
16 dnl it under the terms of the GNU General Public License as published by
17 dnl the Free Software Foundation; either version 2 of the License, or
18 dnl (at your option) any later version.
20 dnl This program is distributed in the hope that it will be useful,
21 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
22 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 dnl GNU General Public License for more details.
25 dnl You should have received a copy of the GNU General Public License
26 dnl along with this program; if not, write to the Free Software
27 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
30 dnl checks whether dbopen needs -ldb to be added to libs
31 dnl sets ac_cv_dbopen_libdb to either "yes" or "no"
33 AC_DEFUN([SQUID_CHECK_DBOPEN_NEEDS_LIBDB],[
34 AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
35 SQUID_STATE_SAVE(dbopen_libdb)
37 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
39 #include <sys/types.h>
49 [[dbopen("", 0, 0, DB_HASH, (void *)0L)]])],
50 [ac_cv_dbopen_libdb="yes"],
51 [ac_cv_dbopen_libdb="no"])
52 SQUID_STATE_ROLLBACK(dbopen_libdb)
57 dnl check whether regex works by actually compiling one
58 dnl sets squid_cv_regex_works to either yes or no
60 AC_DEFUN([SQUID_CHECK_REGEX_WORKS],[
61 AC_CACHE_CHECK([if the system-supplied regex lib actually works],squid_cv_regex_works,[
62 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
64 #include <sys/types.h>
70 regex_t t; regcomp(&t,"",0);]])],
71 [ squid_cv_regex_works=yes ],
72 [ squid_cv_regex_works=no ])
77 AC_DEFUN([SQUID_CHECK_LIBIPHLPAPI],[
78 AC_CACHE_CHECK([for libIpHlpApi],squid_cv_have_libiphlpapi,[
79 SQUID_STATE_SAVE(iphlpapi)
80 LIBS="$LIBS -liphlpapi"
81 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
87 unsigned long isz=sizeof(i);
88 GetIpNetTable(&i,&isz,FALSE);
90 [squid_cv_have_libiphlpapi=yes
91 SQUID_STATE_COMMIT(iphlpapi)],
92 [squid_cv_have_libiphlpapi=no
93 SQUID_STATE_ROLLBACK(iphlpapi)])
95 SQUID_STATE_ROLLBACK(iphlpapi)
98 dnl Checks whether the OpenSSL SSL_get_certificate crashes squid and if a
99 dnl workaround can be used instead of using the SSL_get_certificate
100 AC_DEFUN([SQUID_CHECK_OPENSSL_GETCERTIFICATE_WORKS],[
101 AH_TEMPLATE(SQUID_SSLGETCERTIFICATE_BUGGY, "Define to 1 if the SSL_get_certificate crashes squid")
102 AH_TEMPLATE(SQUID_USE_SSLGETCERTIFICATE_HACK, "Define to 1 to use squid workaround for SSL_get_certificate")
103 SQUID_STATE_SAVE(check_SSL_get_certificate)
105 if test "x$SSLLIBDIR" != "x"; then
106 LIBS="$LIBS -Wl,-rpath -Wl,$SSLLIBDIR"
109 AC_MSG_CHECKING(whether the SSL_get_certificate is buggy)
113 #include <openssl/ssl.h>
114 #include <openssl/err.h>
117 SSLeay_add_ssl_algorithms();
118 SSL_CTX *sslContext = SSL_CTX_new(SSLv3_method());
119 SSL *ssl = SSL_new(sslContext);
120 X509* cert = SSL_get_certificate(ssl);
128 AC_DEFINE(SQUID_SSLGETCERTIFICATE_BUGGY, 1)
133 AC_MSG_CHECKING(whether the workaround for SSL_get_certificate works)
137 #include <openssl/ssl.h>
138 #include <openssl/err.h>
141 SSLeay_add_ssl_algorithms();
142 SSL_CTX *sslContext = SSL_CTX_new(SSLv3_method());
143 X509 ***pCert = (X509 ***)sslContext->cert;
144 X509 *sslCtxCert = pCert && *pCert ? **pCert : (X509 *)0x1;
145 if (sslCtxCert != NULL)
152 AC_DEFINE(SQUID_USE_SSLGETCERTIFICATE_HACK, 1)
159 SQUID_STATE_ROLLBACK(check_SSL_get_certificate)