- Cleaned up, renamed and reorderd functions
[privoxy.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl 
3 dnl $Id: configure.in,v 1.4 2001/05/29 09:50:24 jongfoster Exp $
4 dnl 
5 dnl Written by and Copyright (C) 2001 the SourceForge
6 dnl IJBSWA team.  http://ijbswa.sourceforge.net
7 dnl
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
11 dnl
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.
17 dnl 
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.
23 dnl 
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.
29 dnl 
30 dnl $Log: configure.in,v $
31 dnl Revision 1.4  2001/05/29 09:50:24  jongfoster
32 dnl Unified blocklist/imagelist/permissionslist.
33 dnl File format is still under discussion, but the internal changes
34 dnl are (mostly) done.
35 dnl
36 dnl Also modified interceptor behaviour:
37 dnl - We now intercept all URLs beginning with one of the following
38 dnl   prefixes (and *only* these prefixes):
39 dnl     * http://i.j.b/
40 dnl     * http://ijbswa.sf.net/config/
41 dnl     * http://ijbswa.sourceforge.net/config/
42 dnl - New interceptors "home page" - go to http://i.j.b/ to see it.
43 dnl - Internal changes so that intercepted and fast redirect pages
44 dnl   are not replaced with an image.
45 dnl - Interceptors now have the option to send a binary page direct
46 dnl   to the client. (i.e. ijb-send-banner uses this)
47 dnl - Implemented show-url-info interceptor.  (Which is why I needed
48 dnl   the above interceptors changes - a typical URL is
49 dnl   "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif".
50 dnl   The previous mechanism would not have intercepted that, and
51 dnl   if it had been intercepted then it then it would have replaced
52 dnl   it with an image.)
53 dnl
54 dnl Revision 1.3  2001/05/22 18:46:04  oes
55 dnl
56 dnl - Enabled filtering banners by size rather than URL
57 dnl   by adding patterns that replace all standard banner
58 dnl   sizes with the "Junkbuster" gif to the re_filterfile
59 dnl
60 dnl - Enabled filtering WebBugs by providing a pattern
61 dnl   which kills all 1x1 images
62 dnl
63 dnl - Added support for PCRE_UNGREEDY behaviour to pcrs,
64 dnl   which is selected by the (nonstandard and therefore
65 dnl   capital) letter 'U' in the option string.
66 dnl   It causes the quantifiers to be ungreedy by default.
67 dnl   Appending a ? turns back to greedy (!).
68 dnl
69 dnl - Added a new interceptor ijb-send-banner, which
70 dnl   sends back the "Junkbuster" gif. Without imagelist or
71 dnl   MSIE detection support, or if tinygif = 1, or the
72 dnl   URL isn't recognized as an imageurl, a lame HTML
73 dnl   explanation is sent instead.
74 dnl
75 dnl - Added new feature, which permits blocking remote
76 dnl   script redirects and firing back a local redirect
77 dnl   to the browser.
78 dnl   The feature is conditionally compiled, i.e. it
79 dnl   can be disabled with --disable-fast-redirects,
80 dnl   plus it must be activated by a "fast-redirects"
81 dnl   line in the config file, has its own log level
82 dnl   and of course wants to be displayed by show-proxy-args
83 dnl   Note: Boy, all the #ifdefs in 1001 locations and
84 dnl   all the fumbling with configure.in and acconfig.h
85 dnl   were *way* more work than the feature itself :-(
86 dnl
87 dnl - Because a generic redirect template was needed for
88 dnl   this, tinygif = 3 now uses the same.
89 dnl
90 dnl - Moved GIFs, and other static HTTP response templates
91 dnl   to project.h
92 dnl
93 dnl - Some minor fixes
94 dnl
95 dnl - Removed some >400 CRs again (Jon, you really worked
96 dnl   a lot! ;-)
97 dnl
98 dnl Revision 1.2  2001/05/20 01:21:20  jongfoster
99 dnl Version 2.9.4 checkin.
100 dnl - Merged popupfile and cookiefile, and added control over PCRS
101 dnl   filtering, in new "permissionsfile".
102 dnl - Implemented LOG_LEVEL_FATAL, so that if there is a configuration
103 dnl   file error you now get a message box (in the Win32 GUI) rather
104 dnl   than the program exiting with no explanation.
105 dnl - Made killpopup use the PCRS MIME-type checking and HTTP-header
106 dnl   skipping.
107 dnl - Removed tabs from "config"
108 dnl - Moved duplicated url parsing code in "loaders.c" to a new funcition.
109 dnl - Bumped up version number.
110 dnl
111 dnl Revision 1.1.1.1  2001/05/15 13:58:50  oes
112 dnl Initial import of version 2.9.3 source tree
113 dnl
114 dnl 
115 AC_INIT(jcc.c)
116 AC_CONFIG_HEADER(config.h)
117
118 VERSION_MAJOR=2
119 VERSION_MINOR=9
120 VERSION_POINT=4
121
122 AC_SUBST(VERSION_MAJOR)
123 AC_SUBST(VERSION_MINOR)
124 AC_SUBST(VERSION_POINT)
125
126 dnl This can be "alpha", "beta", or "stable"
127 dnl and will be used for CGI output
128 dnl
129 AC_DEFINE(CODE_STATUS, "alpha")
130
131 AC_DEFINE_UNQUOTED(VERSION_MAJOR,${VERSION_MAJOR})
132 AC_DEFINE_UNQUOTED(VERSION_MINOR,${VERSION_MINOR})
133 AC_DEFINE_UNQUOTED(VERSION_POINT,${VERSION_POINT})
134 AC_DEFINE_UNQUOTED(VERSION,"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_POINT}")
135
136 dnl Checks for programs.
137 dnl AC_PROG_CXX
138 AC_PROG_CC
139 AC_PROG_CPP
140 dnl AC_PROG_INSTALL
141 dnl AC_PROG_LN_S
142 dnl AC_PROG_MAKE_SET
143 dnl RANLIB is for PCRE:
144 dnl AC_PROG_RANLIB
145
146 AC_MINGW32
147 AC_CYGWIN
148 AC_EXEEXT
149 AC_OBJEXT
150
151 dnl Checks for libraries.
152 dnl AC_CHECK_LIB(pcre, pcre_compile)
153 dnl AC_CHECK_LIB(pcreposix, regcomp, pcre)
154
155 dnl Checks for header files.
156 AC_HEADER_STDC
157 dnl AC_HEADER_SYS_WAIT
158 dnl AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/time.h unistd.h)
159 dnl limits.h is for PCRE:
160 dnl AC_CHECK_HEADERS(limits.h)
161
162 dnl Checks for typedefs, structures, and compiler characteristics.
163 AC_C_CONST
164 AC_TYPE_SIZE_T
165
166 dnl Checks for library functions.
167 dnl AC_TYPE_SIGNAL
168 dnl AC_CHECK_FUNC(strstr)
169 dnl bcopy and memmove are for PCRE
170 AC_CHECK_FUNCS(strerror bcopy memmove)
171
172 dnl Build type
173
174 AC_ARG_ENABLE(mingw32,
175 [  --enable-mingw32        Use mingw32 for a Windows GUI],
176 [if test $enableval = yes; then
177     WIN_ONLY=
178     CYGWIN_FLAGS="-mwindows -mno-cygwin"
179     echo "Using mingw32 (Win32 GUI)"
180   else
181     WIN_ONLY=#
182     if test "$CYGWIN" = "yes"; then
183       CYGWIN_FLAGS="-mno-win32"
184       echo "Using Cygnus (Win32 command line)"
185     else
186       CYGWIN_FLAGS=
187     fi
188   fi],
189 [if test "$MINGW32" = "yes"; then
190     WIN_ONLY=
191     CYGWIN_FLAGS="-mwindows -mno-cygwin"
192     echo "Using mingw32 (Win32 GUI)"
193   else
194     WIN_ONLY=#
195     if test "$CYGWIN" = "yes"; then
196       CYGWIN_FLAGS="-mno-win32"
197       echo "Using Cygnus (Win32 command line)"
198     else
199       CYGWIN_FLAGS=
200     fi
201   fi])
202
203 AC_SUBST(WIN_ONLY)
204 AC_SUBST(CYGWIN_FLAGS)
205
206 SOLARIS_ONLY=#
207 AC_SUBST(SOLARIS_ONLY)
208
209 dnl Features
210
211 dnl Regex engine:
212
213 GNU_REGEX_ONLY=
214 PCRE_REGEX_ONLY=
215 NO_REGEX_ONLY=#
216
217 AC_ARG_ENABLE(regex,
218 [  --disable-regex         Don't allow regular expressions in the blockfile],
219 [if test $enableval = yes; then
220   AC_DEFINE(REGEX)
221 else
222   NO_REGEX_ONLY=
223   GNU_REGEX_ONLY=#
224   PCRE_REGEX_ONLY=#
225 fi],AC_DEFINE(REGEX))
226
227 AC_ARG_ENABLE(pcre-regex,
228 [  --disable-pcre-regex    Use old, slow GNU Regex instead of PCRE.],
229 [if test $enableval = yes; then
230   AC_DEFINE(PCRE)
231   GNU_REGEX_ONLY=#
232 else
233   PCRE_REGEX_ONLY=#
234 fi],[AC_DEFINE(PCRE)
235   GNU_REGEX_ONLY=#
236 ])
237
238 AC_SUBST(GNU_REGEX_ONLY)
239 AC_SUBST(PCRE_REGEX_ONLY)
240 AC_SUBST(NO_REGEX_ONLY)
241
242
243 dnl Other features:
244
245 AC_ARG_ENABLE(toggle,
246 [  --disable-toggle        Don't support temporary disable],
247 [if test $enableval = yes; then
248   AC_DEFINE(TOGGLE)
249 fi],AC_DEFINE(TOGGLE))
250
251 PCRS_ONLY=
252 AC_ARG_ENABLE(pcrs,
253 [  --disable-pcrs          Don't support arbitrary content modification],
254 [if test $enableval = yes; then
255   AC_DEFINE(PCRS)
256   AC_DEFINE(DENY_GZIP)
257 else
258   PCRS_ONLY=#
259 fi],[AC_DEFINE(PCRS) AC_DEFINE(DENY_GZIP)])
260 AC_SUBST(PCRS_ONLY)
261
262 AC_ARG_ENABLE(force,
263 [  --disable-force         Don't allow blockfle to be bypassed],
264 [if test $enableval = yes; then
265   AC_DEFINE(FORCE_LOAD)
266 fi],AC_DEFINE(FORCE_LOAD))
267
268 AC_ARG_ENABLE(fast-redirects,
269 [  --disable-fast-redirects Don't support fast redirects],
270 [if test $enableval = yes; then
271   AC_DEFINE(FAST_REDIRECTS)
272 fi], AC_DEFINE(FAST_REDIRECTS))
273
274 AC_ARG_ENABLE(killpopup,
275 [  --disable-killpopup     Never block popups],
276 [if test $enableval = yes; then
277   AC_DEFINE(KILLPOPUPS)
278 fi],AC_DEFINE(KILLPOPUPS))
279
280 AC_ARG_ENABLE(stats,
281 [  --disable-stats         Don't keep statistics],
282 [if test $enableval = yes; then
283   AC_DEFINE(STATISTICS)
284 fi],AC_DEFINE(STATISTICS))
285
286 AC_ARG_ENABLE(split-proxy-args,
287 [  --disable-split-proxy-args  One big show-proxy-args page, not one per file.],
288 [if test $enableval = yes; then
289   AC_DEFINE(SPLIT_PROXY_ARGS)
290 fi],AC_DEFINE(SPLIT_PROXY_ARGS))
291
292 AC_ARG_ENABLE(webdav,
293 [  --disable-webdav        Don't support WebDAV.  This option stops MS Outlook
294                           Express from accessing HotMail e-mail.],
295 [if test $enableval = yes; then
296   AC_DEFINE(WEBDAV)
297 fi],
298 AC_DEFINE(WEBDAV))
299
300 AC_ARG_ENABLE(ie-images,
301 [  --disable-ie-images     Don't auto-detect whether a request from MS Internet
302                           Explorer is for an image or HTML.],
303 [if test $enableval = yes; then
304   AC_DEFINE(DETECT_MSIE_IMAGES)
305 fi],
306 AC_DEFINE(DETECT_MSIE_IMAGES))
307
308 AC_ARG_ENABLE(image-blocking,
309 [  --disable-image-blocking  Don't try to figure out whether a request is 
310                             for an image or HTML - assume HTML.],
311 [if test $enableval = yes; then
312   AC_DEFINE(IMAGE_BLOCKING)
313 fi],
314 AC_DEFINE(IMAGE_BLOCKING))
315
316 AC_ARG_ENABLE(acl-files,
317 [  --disable-acl-files     Prevents the use of ACL files to control access to
318                           the proxy by IP address.],
319 [if test $enableval = yes; then
320   AC_DEFINE(ACL_FILES)
321 fi],
322 AC_DEFINE(ACL_FILES))
323
324 AC_ARG_ENABLE(trust-files,
325 [  --disable-trust-files   Prevents the use of trust files.],
326 [if test $enableval = yes; then
327   AC_DEFINE(TRUST_FILES)
328 fi],
329 AC_DEFINE(TRUST_FILES))
330
331 AC_ARG_ENABLE(jar-files,
332 [  --disable-jar-files     Prevents the use of jar files to capture cookies.],
333 [if test $enableval = yes; then
334   AC_DEFINE(JAR_FILES)
335 fi],
336 AC_DEFINE(JAR_FILES))
337
338 LIBRARY_PCRE_ONLY=#
339 STATIC_PCRE_ONLY=
340 AC_ARG_ENABLE(static-pcre,
341 [  --disable-static-pcre   Link dynamically with the pcre and pcreposix
342                           libraries.  You must build the libraries seperately.],
343 [if test $enableval = no; then
344   LIBRARY_PCRE_ONLY=
345   STATIC_PCRE_ONLY=#
346 fi])
347 AC_SUBST(LIBRARY_PCRE_ONLY)
348 AC_SUBST(STATIC_PCRE_ONLY)
349
350 AC_OUTPUT(Makefile)
351