1 dnl Process this file with autoconf to produce a configure script.
3 dnl $Id: configure.in,v 1.6 2001/06/29 21:56:40 oes Exp $
5 dnl Written by and Copyright (C) 2001 the SourceForge
6 dnl IJBSWA team. http://ijbswa.sourceforge.net
8 dnl Based on the Internet Junkbuster originally written
9 dnl by and Copyright (C) 1997 Anonymous Coders and
10 dnl Junkbusters Corporation. http://www.junkbusters.com
12 dnl This program is free software; you can redistribute it
13 dnl and/or modify it under the terms of the GNU General
14 dnl Public License as published by the Free Software
15 dnl Foundation; either version 2 of the License, or (at
16 dnl your option) any later version.
18 dnl This program is distributed in the hope that it will
19 dnl be useful, but WITHOUT ANY WARRANTY; without even the
20 dnl implied warranty of MERCHANTABILITY or FITNESS FOR A
21 dnl PARTICULAR PURPOSE. See the GNU General Public
22 dnl License for more details.
24 dnl The GNU General Public License should be included with
25 dnl this file. If not, you can view it at
26 dnl http://www.gnu.org/copyleft/gpl.html
27 dnl or write to the Free Software Foundation, Inc., 59
28 dnl Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 dnl $Log: configure.in,v $
31 dnl Revision 1.6 2001/06/29 21:56:40 oes
34 dnl Revision 1.5 2001/06/29 13:26:27 oes
35 dnl Introduced #define CODE_STATUS
37 dnl Revision 1.4 2001/05/29 09:50:24 jongfoster
38 dnl Unified blocklist/imagelist/permissionslist.
39 dnl File format is still under discussion, but the internal changes
40 dnl are (mostly) done.
42 dnl Also modified interceptor behaviour:
43 dnl - We now intercept all URLs beginning with one of the following
44 dnl prefixes (and *only* these prefixes):
46 dnl * http://ijbswa.sf.net/config/
47 dnl * http://ijbswa.sourceforge.net/config/
48 dnl - New interceptors "home page" - go to http://i.j.b/ to see it.
49 dnl - Internal changes so that intercepted and fast redirect pages
50 dnl are not replaced with an image.
51 dnl - Interceptors now have the option to send a binary page direct
52 dnl to the client. (i.e. ijb-send-banner uses this)
53 dnl - Implemented show-url-info interceptor. (Which is why I needed
54 dnl the above interceptors changes - a typical URL is
55 dnl "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif".
56 dnl The previous mechanism would not have intercepted that, and
57 dnl if it had been intercepted then it then it would have replaced
58 dnl it with an image.)
60 dnl Revision 1.3 2001/05/22 18:46:04 oes
62 dnl - Enabled filtering banners by size rather than URL
63 dnl by adding patterns that replace all standard banner
64 dnl sizes with the "Junkbuster" gif to the re_filterfile
66 dnl - Enabled filtering WebBugs by providing a pattern
67 dnl which kills all 1x1 images
69 dnl - Added support for PCRE_UNGREEDY behaviour to pcrs,
70 dnl which is selected by the (nonstandard and therefore
71 dnl capital) letter 'U' in the option string.
72 dnl It causes the quantifiers to be ungreedy by default.
73 dnl Appending a ? turns back to greedy (!).
75 dnl - Added a new interceptor ijb-send-banner, which
76 dnl sends back the "Junkbuster" gif. Without imagelist or
77 dnl MSIE detection support, or if tinygif = 1, or the
78 dnl URL isn't recognized as an imageurl, a lame HTML
79 dnl explanation is sent instead.
81 dnl - Added new feature, which permits blocking remote
82 dnl script redirects and firing back a local redirect
84 dnl The feature is conditionally compiled, i.e. it
85 dnl can be disabled with --disable-fast-redirects,
86 dnl plus it must be activated by a "fast-redirects"
87 dnl line in the config file, has its own log level
88 dnl and of course wants to be displayed by show-proxy-args
89 dnl Note: Boy, all the #ifdefs in 1001 locations and
90 dnl all the fumbling with configure.in and acconfig.h
91 dnl were *way* more work than the feature itself :-(
93 dnl - Because a generic redirect template was needed for
94 dnl this, tinygif = 3 now uses the same.
96 dnl - Moved GIFs, and other static HTTP response templates
99 dnl - Some minor fixes
101 dnl - Removed some >400 CRs again (Jon, you really worked
104 dnl Revision 1.2 2001/05/20 01:21:20 jongfoster
105 dnl Version 2.9.4 checkin.
106 dnl - Merged popupfile and cookiefile, and added control over PCRS
107 dnl filtering, in new "permissionsfile".
108 dnl - Implemented LOG_LEVEL_FATAL, so that if there is a configuration
109 dnl file error you now get a message box (in the Win32 GUI) rather
110 dnl than the program exiting with no explanation.
111 dnl - Made killpopup use the PCRS MIME-type checking and HTTP-header
113 dnl - Removed tabs from "config"
114 dnl - Moved duplicated url parsing code in "loaders.c" to a new funcition.
115 dnl - Bumped up version number.
117 dnl Revision 1.1.1.1 2001/05/15 13:58:50 oes
118 dnl Initial import of version 2.9.3 source tree
122 AC_CONFIG_HEADER(config.h)
128 AC_SUBST(VERSION_MAJOR)
129 AC_SUBST(VERSION_MINOR)
130 AC_SUBST(VERSION_POINT)
132 dnl This can be "alpha", "beta", or "stable"
133 dnl and will be used for CGI output
135 AC_DEFINE(CODE_STATUS, "alpha")
137 AC_DEFINE_UNQUOTED(VERSION_MAJOR,${VERSION_MAJOR})
138 AC_DEFINE_UNQUOTED(VERSION_MINOR,${VERSION_MINOR})
139 AC_DEFINE_UNQUOTED(VERSION_POINT,${VERSION_POINT})
140 AC_DEFINE_UNQUOTED(VERSION,"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_POINT}")
142 dnl Checks for programs.
149 dnl RANLIB is for PCRE:
157 dnl Checks for libraries.
158 AC_CHECK_LIB(pcre, pcre_compile, [have_pcre=yes], [have_pcre=no])
159 AC_CHECK_LIB(pcreposix, regcomp, [have_pcreposix=yes], [have_pcreposix=no], -lpcre)
160 AC_CHECK_LIB(pcrs, pcrs_compile, [have_pcrs=yes], [have_pcrs=no])
162 dnl Checks for header files.
164 dnl AC_HEADER_SYS_WAIT
165 dnl AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/time.h unistd.h)
166 dnl limits.h is for PCRE:
167 dnl AC_CHECK_HEADERS(limits.h)
169 dnl Checks for typedefs, structures, and compiler characteristics.
173 dnl Checks for library functions.
175 dnl AC_CHECK_FUNC(strstr)
176 dnl bcopy and memmove are for PCRE
177 AC_CHECK_FUNCS(strerror bcopy memmove)
181 AC_ARG_ENABLE(mingw32,
182 [ --enable-mingw32 Use mingw32 for a Windows GUI],
183 [if test $enableval = yes; then
185 CYGWIN_FLAGS="-mwindows -mno-cygwin"
186 echo "Using mingw32 (Win32 GUI)"
189 if test "$CYGWIN" = "yes"; then
190 CYGWIN_FLAGS="-mno-win32"
191 echo "Using Cygnus (Win32 command line)"
196 [if test "$MINGW32" = "yes"; then
198 CYGWIN_FLAGS="-mwindows -mno-cygwin"
199 echo "Using mingw32 (Win32 GUI)"
202 if test "$CYGWIN" = "yes"; then
203 CYGWIN_FLAGS="-mno-win32"
204 echo "Using Cygnus (Win32 command line)"
211 AC_SUBST(CYGWIN_FLAGS)
214 AC_SUBST(SOLARIS_ONLY)
218 AC_ARG_ENABLE(toggle,
219 [ --disable-toggle Don't support temporary disable],
220 [if test $enableval = yes; then
222 fi],AC_DEFINE(TOGGLE))
225 [ --enable-gzip Allow gzip'ed transfer of documents. Note that this will make content modification impossible.],
226 [if test $enableval = "no"; then
231 [ --disable-force Don't allow blockfle to be bypassed],
232 [if test $enableval = yes; then
233 AC_DEFINE(FORCE_LOAD)
234 fi],AC_DEFINE(FORCE_LOAD))
236 AC_ARG_ENABLE(fast-redirects,
237 [ --disable-fast-redirects Don't support fast redirects],
238 [if test $enableval = yes; then
239 AC_DEFINE(FAST_REDIRECTS)
240 fi], AC_DEFINE(FAST_REDIRECTS))
242 AC_ARG_ENABLE(killpopup,
243 [ --disable-killpopup Never block popups],
244 [if test $enableval = yes; then
245 AC_DEFINE(KILLPOPUPS)
246 fi],AC_DEFINE(KILLPOPUPS))
249 [ --disable-stats Don't keep statistics],
250 [if test $enableval = yes; then
251 AC_DEFINE(STATISTICS)
252 fi],AC_DEFINE(STATISTICS))
254 AC_ARG_ENABLE(split-proxy-args,
255 [ --disable-split-proxy-args One big show-proxy-args page, not one per file.],
256 [if test $enableval = yes; then
257 AC_DEFINE(SPLIT_PROXY_ARGS)
258 fi],AC_DEFINE(SPLIT_PROXY_ARGS))
260 AC_ARG_ENABLE(webdav,
261 [ --disable-webdav Don't support WebDAV. This option stops MS Outlook
262 Express from accessing HotMail e-mail.],
263 [if test $enableval = yes; then
268 AC_ARG_ENABLE(ie-images,
269 [ --disable-ie-images Don't auto-detect whether a request from MS Internet
270 Explorer is for an image or HTML.],
271 [if test $enableval = yes; then
272 AC_DEFINE(DETECT_MSIE_IMAGES)
274 AC_DEFINE(DETECT_MSIE_IMAGES))
276 AC_ARG_ENABLE(image-blocking,
277 [ --disable-image-blocking Don't try to figure out whether a request is
278 for an image or HTML - assume HTML.],
279 [if test $enableval = yes; then
280 AC_DEFINE(IMAGE_BLOCKING)
282 AC_DEFINE(IMAGE_BLOCKING))
284 AC_ARG_ENABLE(acl-files,
285 [ --disable-acl-files Prevents the use of ACL files to control access to
286 the proxy by IP address.],
287 [if test $enableval = yes; then
290 AC_DEFINE(ACL_FILES))
292 AC_ARG_ENABLE(trust-files,
293 [ --disable-trust-files Prevents the use of trust files.],
294 [if test $enableval = yes; then
295 AC_DEFINE(TRUST_FILES)
297 AC_DEFINE(TRUST_FILES))
299 AC_ARG_ENABLE(jar-files,
300 [ --disable-jar-files Prevents the use of jar files to capture cookies.],
301 [if test $enableval = yes; then
304 AC_DEFINE(JAR_FILES))
306 dnl pcre/pcrs is needed for CGI anyway, so
307 dnl the choice is only between static and
310 AC_ARG_ENABLE(regex-matching,
311 [ --enable-regex-matching=pcre Use perl-compatible regex for actionsfile pattern matching (default)
312 --enable-regex-matching=gnu Use gnu style regex for actionsfile pattern matching (-> bigger binary)
313 --disable-regex-matching Don't use regex matching, compare URL prefix instead (won't shrink birary)],
314 [ regex_matching=$enableval ],
315 [ regex_matching=pcre ])
317 AC_ARG_ENABLE(dynamic-pcre,
318 [ --disable-dynamic-pcre Use the built-in, static pcre, even if libpcre is available],
319 [ if test $enableval = "no"; then have_pcre=no; fi ])
321 AC_ARG_ENABLE(dynamic-pcrs,
322 [ --disable-dynamic-pcrs Use the built-in, static pcrs, even if libpcrs is available],
323 [ if test $enableval = "no"; then have_pcrs=no; fi ])
326 # Is the regex URL matching based on libpcreposix, but we
327 # don't have that library?
329 if test $have_pcreposix = "yes" -o $regex_matching != "pcre"; then
330 dont_miss_pcreposix=yes
332 dont_miss_pcreposix=no
335 # If we have libpcre and either we also have pcreposix or
336 # we don't need pcreposix, then link pcre dynamically; else
337 # build it and link statically
339 if test $have_pcre = "yes" -a $dont_miss_pcreposix = "yes"; then
345 echo "using built-in static pcre"
351 # If we have libpcrs and pcre is linked dynamically
352 # then also link pcrs dynamically, else build and link
355 if test $have_pcrs = "yes" -a $pcre_dyn = "yes"; then
360 echo "using built-in static pcrs"
361 AC_DEFINE(STATIC_PCRS)
365 # Which method should be used for URL matching?
366 # pcre, gnu regex or prefix matching?
368 if test $regex_matching = "gnu"; then
369 echo "using gnu regex for URL matching"
373 elif test $regex_matching = "pcre"; then
374 echo "using pcre regex for URL matching"
375 AC_DEFINE(REGEX_PCRE)
378 if test $pcre_dyn = "yes"; then
379 LIBS="$LIBS -lpcreposix"
382 echo -e "using prefix matching for URLs\nHint: This does NOT make the executable any smaller!"
387 AC_SUBST(GNU_REGEX_ONLY)
388 AC_SUBST(PCRE_REGEX_ONLY)
389 AC_SUBST(STATIC_PCRE_ONLY)
390 AC_SUBST(STATIC_PCRS_ONLY)