]> granicus.if.org Git - apache/blob - modules/filters/config.m4
mod_deflate: follow up to r1619383.
[apache] / modules / filters / config.m4
1 dnl modules enabled in this directory by default
2
3 dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
4
5 APACHE_MODPATH_INIT(filters)
6
7 APACHE_MODULE(buffer, Filter Buffering, , , most)
8 APACHE_MODULE(data, RFC2397 data encoder, , , )
9 APACHE_MODULE(ratelimit, Output Bandwidth Limiting, , , most)
10 APACHE_MODULE(reqtimeout, Limit time waiting for request from client, , , yes)
11 APACHE_MODULE(ext_filter, external filter module, , , most)
12 APACHE_MODULE(request, Request Body Filtering, , , most)
13 APACHE_MODULE(include, Server Side Includes, , , most)
14 APACHE_MODULE(filter, Smart Filtering, , , yes)
15 APACHE_MODULE(reflector, Reflect request through the output filter stack, , , )
16 APACHE_MODULE(substitute, response content rewrite-like filtering, , , most)
17
18 sed_obj="mod_sed.lo sed0.lo sed1.lo regexp.lo"
19 APACHE_MODULE(sed, filter request and/or response bodies through sed, $sed_obj, , most, [
20     if test "x$enable_sed" = "xshared"; then
21         # The only symbol which needs to be exported is the module
22         # structure, so ask libtool to hide libsed internals:
23         APR_ADDTO(MOD_SED_LDADD, [-export-symbols-regex sed_module])
24     fi
25 ])
26
27 if test "$ac_cv_ebcdic" = "yes"; then
28 # mod_charset_lite can be very useful on an ebcdic system,
29 #   so include it by default
30     APACHE_MODULE(charset_lite, character set translation.  Enabled by default only on EBCDIC systems., , , yes)
31 else
32     APACHE_MODULE(charset_lite, character set translation.  Enabled by default only on EBCDIC systems., , , )
33 fi
34
35
36 APACHE_MODULE(deflate, Deflate transfer encoding support, , , most, [
37   AC_ARG_WITH(z, APACHE_HELP_STRING(--with-z=PATH,use a specific zlib library),
38   [
39     if test "x$withval" != "xyes" && test "x$withval" != "x"; then
40       ap_zlib_base="$withval"
41       ap_zlib_with="yes"
42     fi
43   ])
44   if test "x$ap_zlib_base" = "x"; then
45     AC_MSG_CHECKING([for zlib location])
46     AC_CACHE_VAL(ap_cv_zlib,[
47       for dir in /usr/local /usr ; do
48         if test -d $dir && test -f $dir/include/zlib.h; then
49           ap_cv_zlib=$dir
50           break
51         fi
52       done
53     ])
54     ap_zlib_base=$ap_cv_zlib
55     if test "x$ap_zlib_base" = "x"; then
56       enable_deflate=no
57       AC_MSG_RESULT([not found])
58     else
59       AC_MSG_RESULT([$ap_zlib_base])
60     fi
61   fi
62   if test "$enable_deflate" != "no"; then
63     ap_save_includes=$INCLUDES
64     ap_save_ldflags=$LDFLAGS
65     ap_save_cppflags=$CPPFLAGS
66     ap_zlib_ldflags=""
67     if test "$ap_zlib_base" != "/usr"; then
68       APR_ADDTO(INCLUDES, [-I${ap_zlib_base}/include])
69       APR_ADDTO(MOD_INCLUDES, [-I${ap_zlib_base}/include])
70       dnl put in CPPFLAGS temporarily so that AC_TRY_LINK below will work
71       CPPFLAGS="$CPPFLAGS $INCLUDES"
72       APR_ADDTO(LDFLAGS, [-L${ap_zlib_base}/lib])
73       APR_ADDTO(ap_zlib_ldflags, [-L${ap_zlib_base}/lib])
74       if test "x$ap_platform_runtime_link_flag" != "x"; then
75          APR_ADDTO(LDFLAGS, [$ap_platform_runtime_link_flag${ap_zlib_base}/lib])
76          APR_ADDTO(ap_zlib_ldflags, [$ap_platform_runtime_link_flag${ap_zlib_base}/lib])
77       fi
78     fi
79     APR_ADDTO(LIBS, [-lz])
80     AC_MSG_CHECKING([for zlib library])
81     AC_TRY_LINK([#include <zlib.h>], [int i = Z_OK;], 
82       [AC_MSG_RESULT(found) 
83        APR_ADDTO(MOD_DEFLATE_LDADD, [$ap_zlib_ldflags -lz])],
84       [AC_MSG_RESULT(not found)
85        enable_deflate=no
86        if test "x$ap_zlib_with" = "x"; then
87          AC_MSG_WARN([... Error, zlib was missing or unusable])
88        else
89          AC_MSG_ERROR([... Error, zlib was missing or unusable])
90        fi
91       ])
92     INCLUDES=$ap_save_includes
93     LDFLAGS=$ap_save_ldflags
94     CPPFLAGS=$ap_save_cppflags
95     APR_REMOVEFROM(LIBS, [-lz])
96   fi
97 ])
98
99 AC_DEFUN(FIND_LIBXML2, [
100   AC_CACHE_CHECK([for libxml2], [ac_cv_libxml2], [
101     AC_ARG_WITH(libxml2,
102       [APACHE_HELP_STRING(--with-libxml2=PATH,location for libxml2)],
103       [test_paths="${with_libxml2}"],
104       [test_paths="/usr/include/libxml2 /usr/local/include/libxml2 /usr/include /usr/local/include"]
105     )
106     AC_MSG_CHECKING(for libxml2)
107     xml2_path=""
108     for x in ${test_paths}; do
109         if test -f "${x}/libxml/parser.h"; then
110           xml2_path="${x}"
111           break
112         fi
113     done
114     if test -n "${xml2_path}" ; then
115       ac_cv_libxml2=yes
116       XML2_INCLUDES="${xml2_path}"
117     else
118       ac_cv_libxml2=no
119     fi
120   ])
121 ])
122
123 APACHE_MODULE(xml2enc, i18n support for markup filters, , , , [
124   FIND_LIBXML2
125   if test "$ac_cv_libxml2" = "yes" ; then
126     APR_ADDTO(MOD_CFLAGS, [-I${XML2_INCLUDES}])
127     APR_ADDTO(MOD_XML2ENC_LDADD, [-lxml2])
128   else
129     enable_xml2enc=no
130   fi
131 ])
132 APACHE_MODULE(proxy_html, Fix HTML Links in a Reverse Proxy, , , , [
133   FIND_LIBXML2
134   if test "$ac_cv_libxml2" = "yes" ; then
135     APR_ADDTO(MOD_CFLAGS, [-I${XML2_INCLUDES}])
136     APR_ADDTO(MOD_PROXY_HTML_LDADD, [-lxml2])
137   else
138     enable_proxy_html=no
139   fi
140 ]
141 )
142
143 APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])
144
145 APACHE_MODPATH_FINISH