]> granicus.if.org Git - apache/blob - modules/ssl/config.m4
c26f604a1f6e96acedd355a62e77feb2cd7c4750
[apache] / modules / ssl / config.m4
1 dnl  Copyright 2001-2006 The Apache Software Foundation or its licensors, as
2 dnl  applicable.
3 dnl
4 dnl  Licensed under the Apache License, Version 2.0 (the "License");
5 dnl  you may not use this file except in compliance with the License.
6 dnl  You may obtain a copy of the License at
7 dnl 
8 dnl       http://www.apache.org/licenses/LICENSE-2.0
9 dnl 
10 dnl  Unless required by applicable law or agreed to in writing, software
11 dnl  distributed under the License is distributed on an "AS IS" BASIS,
12 dnl  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 dnl  See the License for the specific language governing permissions and
14 dnl  limitations under the License.
15
16 AC_DEFUN([CHECK_DISTCACHE], [
17   AC_MSG_CHECKING(whether Distcache is required)
18   ap_ssltk_dc="no"
19   tmp_nomessage=""
20   tmp_forced="no"
21   AC_ARG_ENABLE(distcache,
22     APACHE_HELP_STRING(--enable-distcache,Select distcache support in mod_ssl),
23     ap_ssltk_dc="$enableval"
24     tmp_nomessage=""
25     tmp_forced="yes"
26     if test "x$ap_ssltk_dc" = "x"; then
27       ap_ssltk_dc="yes"
28       dnl our "error"s become "tests revealed that..."
29       tmp_forced="no"
30     fi
31     if test "$ap_ssltk_dc" != "yes" -a "$ap_ssltk_dc" != "no"; then
32       tmp_nomessage="--enable-distcache had illegal syntax - disabling"
33       ap_ssltk_dc="no"
34     fi)
35   if test "$tmp_forced" = "no"; then
36     AC_MSG_RESULT($ap_ssltk_dc (default))
37   else
38     AC_MSG_RESULT($ap_ssltk_dc (specified))
39   fi
40   if test "$tmp_forced" = "yes" -a "x$ap_ssltk_dc" = "xno" -a "x$tmp_nomessage" != "x"; then
41     AC_MSG_ERROR(distcache support failed: $tmp_nomessage)
42   fi
43   if test "$ap_ssltk_dc" = "yes"; then
44     AC_CHECK_HEADER(
45       [distcache/dc_client.h],
46       [],
47       [tmp_nomessage="can't include distcache headers"
48       ap_ssltk_dc="no"])
49     if test "$tmp_forced" = "yes" -a "x$ap_ssltk_dc" = "xno"; then
50       AC_MSG_ERROR(distcache support failed: $tmp_nomessage)
51     fi
52   fi
53   if test "$ap_ssltk_dc" = "yes"; then
54     AC_MSG_CHECKING(for Distcache version)
55     AC_TRY_COMPILE(
56 [#include <distcache/dc_client.h>],
57 [#if DISTCACHE_CLIENT_API != 0x0001
58 #error "distcache API version is unrecognised"
59 #endif],
60 [],
61 [tmp_nomessage="distcache has an unsupported API version"
62 ap_ssltk_dc="no"])
63     AC_MSG_RESULT($ap_ssltk_dc)
64     if test "$tmp_forced" = "yes" -a "x$ap_ssltk_dc" = "xno"; then
65       AC_MSG_ERROR(distcache support failed: $tmp_nomessage)
66     fi
67   fi
68   if test "$ap_ssltk_dc" = "yes"; then
69     AC_MSG_CHECKING(for Distcache libraries)
70     save_libs=$LIBS
71     LIBS="$LIBS -ldistcache -lnal"
72     AC_TRY_LINK(
73       [#include <distcache/dc_client.h>],
74       [DC_CTX *foo = DC_CTX_new((const char *)0,0);],
75       [],
76       [tmp_no_message="failed to link with distcache libraries"
77       ap_ssltk_dc="no"])
78     LIBS=$save_libs
79     AC_MSG_RESULT($ap_ssltk_dc)
80     if test "$tmp_forced" = "yes" -a "x$ap_ssltk_dc" = "xno"; then
81       AC_MSG_ERROR(distcache support failed: $tmp_nomessage)
82     else
83       APR_ADDTO(MOD_SSL_LDADD, [-ldistcache -lnal])
84       AC_DEFINE(HAVE_DISTCACHE, 1, [Define if distcache support is enabled])
85     fi
86   fi
87 ])
88
89 dnl #  start of module specific part
90 APACHE_MODPATH_INIT(ssl)
91
92 dnl #  list of module object files
93 ssl_objs="dnl
94 mod_ssl.lo dnl
95 ssl_engine_config.lo dnl
96 ssl_engine_dh.lo dnl
97 ssl_engine_init.lo dnl
98 ssl_engine_io.lo dnl
99 ssl_engine_kernel.lo dnl
100 ssl_engine_log.lo dnl
101 ssl_engine_mutex.lo dnl
102 ssl_engine_pphrase.lo dnl
103 ssl_engine_rand.lo dnl
104 ssl_engine_vars.lo dnl
105 ssl_expr.lo dnl
106 ssl_expr_eval.lo dnl
107 ssl_expr_parse.lo dnl
108 ssl_expr_scan.lo dnl
109 ssl_scache.lo dnl
110 ssl_scache_dbm.lo dnl
111 ssl_scache_shmcb.lo dnl
112 ssl_scache_dc.lo dnl
113 ssl_util.lo dnl
114 ssl_util_ssl.lo dnl
115 "
116 dnl #  hook module into the Autoconf mechanism (--enable-ssl option)
117 APACHE_MODULE(ssl, [SSL/TLS support (mod_ssl)], $ssl_objs, , no, [
118     APACHE_CHECK_SSL_TOOLKIT
119     APR_SETVAR(MOD_SSL_LDADD, [\$(SSL_LIBS)])
120     CHECK_DISTCACHE
121     if test "x$enable_ssl" = "xshared"; then
122        # The only symbol which needs to be exported is the module
123        # structure, so ask libtool to hide everything else:
124        APR_ADDTO(MOD_SSL_LDADD, [-export-symbols-regex ssl_module])
125     fi
126 ])
127
128 # Ensure that other modules can pick up mod_ssl.h
129 APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])
130
131 dnl #  end of module specific part
132 APACHE_MODPATH_FINISH
133