Bumping version number to 2.9.8
[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.11 2001/07/21 18:00:07 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.11  2001/07/21 18:00:07  jongfoster
32 dnl Bumping version number to 2.9.7
33 dnl
34 dnl Revision 1.10  2001/07/18 17:25:04  oes
35 dnl Fixed a typo
36 dnl
37 dnl Revision 1.9  2001/07/15 19:45:13  jongfoster
38 dnl Added support for linking with POSIX threads library
39 dnl
40 dnl Revision 1.8  2001/07/15 17:54:29  jongfoster
41 dnl Renaming #define STATIC to STATIC_PCRE
42 dnl Adding new #define FEATURE_PTHREAD that will be used to enable
43 dnl POSIX threads support.
44 dnl
45 dnl Revision 1.7  2001/07/13 13:58:05  oes
46 dnl    Completely reorganized the selection scheme for
47 dnl    pcre, pcreposix, pcrs and gnu_regex:
48 dnl
49 dnl    The presence of shared pcre, pcreposix or pcrs
50 dnl    libraried is now autodetected. Additionally, the
51 dnl    user can enforce using the built-in static variants
52 dnl    by specifying --disable-dynamic-(pcre|pcrs).
53 dnl    Care is taken to avoid that pcre is dyn, while pcreposix
54 dnl    is static, if both are used and that pcrs is static if
55 dnl    pcrs is.
56 dnl
57 dnl    The choice between pcre, gnu or no regex for actionsfile
58 dnl    URL matching is now via
59 dnl    --(enable|disable)-regex-matching[=(gnu|pcre|no)] with the
60 dnl    default being pcre.
61 dnl
62 dnl Revision 1.6  2001/06/29 21:56:40  oes
63 dnl Version -> 2.9.5
64 dnl
65 dnl Revision 1.5  2001/06/29 13:26:27  oes
66 dnl Introduced #define CODE_STATUS
67 dnl
68 dnl Revision 1.4  2001/05/29 09:50:24  jongfoster
69 dnl Unified blocklist/imagelist/permissionslist.
70 dnl File format is still under discussion, but the internal changes
71 dnl are (mostly) done.
72 dnl
73 dnl Also modified interceptor behaviour:
74 dnl - We now intercept all URLs beginning with one of the following
75 dnl   prefixes (and *only* these prefixes):
76 dnl     * http://i.j.b/
77 dnl     * http://ijbswa.sf.net/config/
78 dnl     * http://ijbswa.sourceforge.net/config/
79 dnl - New interceptors "home page" - go to http://i.j.b/ to see it.
80 dnl - Internal changes so that intercepted and fast redirect pages
81 dnl   are not replaced with an image.
82 dnl - Interceptors now have the option to send a binary page direct
83 dnl   to the client. (i.e. ijb-send-banner uses this)
84 dnl - Implemented show-url-info interceptor.  (Which is why I needed
85 dnl   the above interceptors changes - a typical URL is
86 dnl   "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif".
87 dnl   The previous mechanism would not have intercepted that, and
88 dnl   if it had been intercepted then it then it would have replaced
89 dnl   it with an image.)
90 dnl
91 dnl Revision 1.3  2001/05/22 18:46:04  oes
92 dnl
93 dnl - Enabled filtering banners by size rather than URL
94 dnl   by adding patterns that replace all standard banner
95 dnl   sizes with the "Junkbuster" gif to the re_filterfile
96 dnl
97 dnl - Enabled filtering WebBugs by providing a pattern
98 dnl   which kills all 1x1 images
99 dnl
100 dnl - Added support for PCRE_UNGREEDY behaviour to pcrs,
101 dnl   which is selected by the (nonstandard and therefore
102 dnl   capital) letter 'U' in the option string.
103 dnl   It causes the quantifiers to be ungreedy by default.
104 dnl   Appending a ? turns back to greedy (!).
105 dnl
106 dnl - Added a new interceptor ijb-send-banner, which
107 dnl   sends back the "Junkbuster" gif. Without imagelist or
108 dnl   MSIE detection support, or if tinygif = 1, or the
109 dnl   URL isn't recognized as an imageurl, a lame HTML
110 dnl   explanation is sent instead.
111 dnl
112 dnl - Added new feature, which permits blocking remote
113 dnl   script redirects and firing back a local redirect
114 dnl   to the browser.
115 dnl   The feature is conditionally compiled, i.e. it
116 dnl   can be disabled with --disable-fast-redirects,
117 dnl   plus it must be activated by a "fast-redirects"
118 dnl   line in the config file, has its own log level
119 dnl   and of course wants to be displayed by show-proxy-args
120 dnl   Note: Boy, all the #ifdefs in 1001 locations and
121 dnl   all the fumbling with configure.in and acconfig.h
122 dnl   were *way* more work than the feature itself :-(
123 dnl
124 dnl - Because a generic redirect template was needed for
125 dnl   this, tinygif = 3 now uses the same.
126 dnl
127 dnl - Moved GIFs, and other static HTTP response templates
128 dnl   to project.h
129 dnl
130 dnl - Some minor fixes
131 dnl
132 dnl - Removed some >400 CRs again (Jon, you really worked
133 dnl   a lot! ;-)
134 dnl
135 dnl Revision 1.2  2001/05/20 01:21:20  jongfoster
136 dnl Version 2.9.4 checkin.
137 dnl - Merged popupfile and cookiefile, and added control over PCRS
138 dnl   filtering, in new "permissionsfile".
139 dnl - Implemented LOG_LEVEL_FATAL, so that if there is a configuration
140 dnl   file error you now get a message box (in the Win32 GUI) rather
141 dnl   than the program exiting with no explanation.
142 dnl - Made killpopup use the PCRS MIME-type checking and HTTP-header
143 dnl   skipping.
144 dnl - Removed tabs from "config"
145 dnl - Moved duplicated url parsing code in "loaders.c" to a new funcition.
146 dnl - Bumped up version number.
147 dnl
148 dnl Revision 1.1.1.1  2001/05/15 13:58:50  oes
149 dnl Initial import of version 2.9.3 source tree
150 dnl
151 dnl 
152 AC_INIT(jcc.c)
153 AC_CONFIG_HEADER(config.h)
154
155 VERSION_MAJOR=2
156 VERSION_MINOR=9
157 VERSION_POINT=8
158
159 AC_SUBST(VERSION_MAJOR)
160 AC_SUBST(VERSION_MINOR)
161 AC_SUBST(VERSION_POINT)
162
163 dnl This can be "alpha", "beta", or "stable"
164 dnl and will be used for CGI output
165 dnl
166 AC_DEFINE(CODE_STATUS, "alpha")
167
168 AC_DEFINE_UNQUOTED(VERSION_MAJOR,${VERSION_MAJOR})
169 AC_DEFINE_UNQUOTED(VERSION_MINOR,${VERSION_MINOR})
170 AC_DEFINE_UNQUOTED(VERSION_POINT,${VERSION_POINT})
171 AC_DEFINE_UNQUOTED(VERSION,"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_POINT}")
172
173 dnl Checks for programs.
174 dnl AC_PROG_CXX
175 AC_PROG_CC
176 AC_PROG_CPP
177 dnl AC_PROG_INSTALL
178 dnl AC_PROG_LN_S
179 dnl AC_PROG_MAKE_SET
180 dnl RANLIB is for PCRE:
181 dnl AC_PROG_RANLIB
182
183 AC_MINGW32
184 AC_CYGWIN
185 AC_EXEEXT
186 AC_OBJEXT
187
188 dnl Checks for libraries.
189 dnl Note: Some systems have the library but not the system header file,
190 dnl       so we must check for both.
191 AC_CHECK_LIB(pcre, pcre_compile, [AC_CHECK_HEADER(pcre.h, [have_pcre=yes], [have_pcre=no])], [have_pcre=no])
192 AC_CHECK_LIB(pcreposix, regcomp, [AC_CHECK_HEADER(pcreposix.h, [have_pcreposix=yes], [have_pcreposix=no])], [have_pcreposix=no], -lpcre)
193 AC_CHECK_LIB(pcrs, pcrs_compile, [AC_CHECK_HEADER(pcrs.h, [have_pcrs=yes], [have_pcrs=no])], [have_pcrs=no])
194
195 dnl Checks for header files.
196 AC_HEADER_STDC
197 dnl AC_HEADER_SYS_WAIT
198 dnl AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/time.h unistd.h)
199 dnl limits.h is for PCRE:
200 dnl AC_CHECK_HEADERS(limits.h)
201
202 dnl Checks for typedefs, structures, and compiler characteristics.
203 AC_C_CONST
204 AC_TYPE_SIZE_T
205
206 dnl Checks for library functions.
207 dnl AC_TYPE_SIGNAL
208 dnl AC_CHECK_FUNC(strstr)
209 dnl bcopy and memmove are for PCRE
210 AC_CHECK_FUNCS(strerror bcopy memmove)
211
212 dnl Build type
213
214 dnl Note: PTHREAD_LIB is always set, even if pthread is disabled.
215
216 AC_ARG_ENABLE(mingw32,
217 [  --enable-mingw32        Use mingw32 for a Windows GUI],
218 [if test $enableval = yes; then
219     WIN_ONLY=
220     CYGWIN_FLAGS="-mwindows -mno-cygwin"
221     PTHREAD_LIB=-lpthreadGC
222     echo "Using mingw32 (Win32 GUI)"
223   else
224     WIN_ONLY=#
225     if test "$CYGWIN" = "yes"; then
226       CYGWIN_FLAGS="-mno-win32"
227       PTHREAD_LIB=
228       echo "Using Cygnus (Win32 command line)"
229     else
230       CYGWIN_FLAGS=
231       PTHREAD_LIB=-lpthread
232     fi
233   fi],
234 [if test "$MINGW32" = "yes"; then
235     WIN_ONLY=
236     CYGWIN_FLAGS="-mwindows -mno-cygwin"
237     PTHREAD_LIB=-lpthreadGC
238     echo "Using mingw32 (Win32 GUI)"
239   else
240     WIN_ONLY=#
241     if test "$CYGWIN" = "yes"; then
242       CYGWIN_FLAGS="-mno-win32"
243       PTHREAD_LIB=
244       echo "Using Cygnus (Win32 command line)"
245     else
246       CYGWIN_FLAGS=
247       PTHREAD_LIB=-lpthread
248     fi
249   fi])
250
251 AC_SUBST(WIN_ONLY)
252 AC_SUBST(CYGWIN_FLAGS)
253 AC_SUBST(PTHREAD_LIB)
254
255 SOLARIS_ONLY=#
256 AC_SUBST(SOLARIS_ONLY)
257
258 dnl Features
259
260 AC_ARG_ENABLE(toggle,
261 [  --disable-toggle        Don't support temporary disable],
262 [if test $enableval = yes; then
263   AC_DEFINE(TOGGLE)
264 fi],AC_DEFINE(TOGGLE))
265
266 AC_ARG_ENABLE(pthread,
267 [  --disable-pthread       Don't use POSIX threads (pthreads)],
268 [if test $enableval = yes; then
269   PTHREAD_ONLY=
270   AC_DEFINE(FEATURE_PTHREAD)
271 else
272   PTHREAD_ONLY=#
273 fi],[AC_DEFINE(FEATURE_PTHREAD)
274   PTHREAD_ONLY=
275 ])
276 AC_SUBST(PTHREAD_ONLY)
277
278 AC_ARG_ENABLE(gzip,
279 [  --enable-gzip           Allow gzip'ed transfer of documents. Note that this will make content modification impossible.],
280 [if test $enableval = "no"; then
281   AC_DEFINE(DENY_GZIP)
282 fi])
283
284 AC_ARG_ENABLE(force,
285 [  --disable-force         Don't allow blockfle to be bypassed],
286 [if test $enableval = yes; then
287   AC_DEFINE(FORCE_LOAD)
288 fi],AC_DEFINE(FORCE_LOAD))
289
290 AC_ARG_ENABLE(fast-redirects,
291 [  --disable-fast-redirects Don't support fast redirects],
292 [if test $enableval = yes; then
293   AC_DEFINE(FAST_REDIRECTS)
294 fi], AC_DEFINE(FAST_REDIRECTS))
295
296 AC_ARG_ENABLE(killpopup,
297 [  --disable-killpopup     Never block popups],
298 [if test $enableval = yes; then
299   AC_DEFINE(KILLPOPUPS)
300 fi],AC_DEFINE(KILLPOPUPS))
301
302 AC_ARG_ENABLE(stats,
303 [  --disable-stats         Don't keep statistics],
304 [if test $enableval = yes; then
305   AC_DEFINE(STATISTICS)
306 fi],AC_DEFINE(STATISTICS))
307
308 AC_ARG_ENABLE(split-proxy-args,
309 [  --disable-split-proxy-args  One big show-proxy-args page, not one per file.],
310 [if test $enableval = yes; then
311   AC_DEFINE(SPLIT_PROXY_ARGS)
312 fi],AC_DEFINE(SPLIT_PROXY_ARGS))
313
314 AC_ARG_ENABLE(webdav,
315 [  --disable-webdav        Don't support WebDAV.  This option stops MS Outlook
316                           Express from accessing HotMail e-mail.],
317 [if test $enableval = yes; then
318   AC_DEFINE(WEBDAV)
319 fi],
320 AC_DEFINE(WEBDAV))
321
322 AC_ARG_ENABLE(ie-images,
323 [  --disable-ie-images     Don't auto-detect whether a request from MS Internet
324                           Explorer is for an image or HTML.],
325 [if test $enableval = yes; then
326   AC_DEFINE(DETECT_MSIE_IMAGES)
327 fi],
328 AC_DEFINE(DETECT_MSIE_IMAGES))
329
330 AC_ARG_ENABLE(image-blocking,
331 [  --disable-image-blocking  Don't try to figure out whether a request is 
332                             for an image or HTML - assume HTML.],
333 [if test $enableval = yes; then
334   AC_DEFINE(IMAGE_BLOCKING)
335 fi],
336 AC_DEFINE(IMAGE_BLOCKING))
337
338 AC_ARG_ENABLE(acl-files,
339 [  --disable-acl-files     Prevents the use of ACL files to control access to
340                           the proxy by IP address.],
341 [if test $enableval = yes; then
342   AC_DEFINE(ACL_FILES)
343 fi],
344 AC_DEFINE(ACL_FILES))
345
346 AC_ARG_ENABLE(trust-files,
347 [  --disable-trust-files   Prevents the use of trust files.],
348 [if test $enableval = yes; then
349   AC_DEFINE(TRUST_FILES)
350 fi],
351 AC_DEFINE(TRUST_FILES))
352
353 AC_ARG_ENABLE(jar-files,
354 [  --disable-jar-files     Prevents the use of jar files to capture cookies.],
355 [if test $enableval = yes; then
356   AC_DEFINE(JAR_FILES)
357 fi],
358 AC_DEFINE(JAR_FILES))
359
360 dnl pcre/pcrs is needed for CGI anyway, so
361 dnl the choice is only between static and
362 dnl dynamic:
363
364 AC_ARG_ENABLE(regex-matching,
365 [  --enable-regex-matching=pcre     Use perl-compatible regex for actionsfile pattern matching (default)
366   --enable-regex-matching=gnu      Use gnu style regex for actionsfile pattern matching (-> bigger binary)
367   --disable-regex-matching         Don't use regex matching, compare URL prefix instead (won't shrink birary)],
368 [ regex_matching=$enableval ],
369 [ regex_matching=pcre ])
370
371 AC_ARG_ENABLE(dynamic-pcre,
372 [  --disable-dynamic-pcre           Use the built-in, static pcre, even if libpcre is available],
373 [ if test $enableval = "no"; then have_pcre=no; fi ])
374
375 AC_ARG_ENABLE(dynamic-pcrs,
376 [  --disable-dynamic-pcrs           Use the built-in, static pcrs, even if libpcrs is available],
377 [ if test $enableval = "no"; then have_pcrs=no; fi ])
378
379
380 # Is the regex URL matching based on libpcreposix, but we
381 # don't have that library?
382 #
383 if test $have_pcreposix = "yes" -o $regex_matching != "pcre"; then
384   dont_miss_pcreposix=yes
385 else
386   dont_miss_pcreposix=no
387 fi
388
389 # If we have libpcre and either we also have pcreposix or
390 # we don't need pcreposix, then link pcre dynamically; else
391 # build it and link statically
392 #
393 if test $have_pcre = "yes" -a $dont_miss_pcreposix = "yes"; then
394   echo "using libpcre"
395   pcre_dyn=yes
396   STATIC_PCRE_ONLY=#
397   LIBS="$LIBS -lpcre"
398 else
399   echo "using built-in static pcre"
400   pcre_dyn=no
401   AC_DEFINE(STATIC_PCRE)
402   STATIC_PCRE_ONLY=
403 fi
404
405 # If we have libpcrs and pcre is linked dynamically
406 # then also link pcrs dynamically, else build and link
407 # pcrs statically
408 #
409 if test $have_pcrs = "yes" -a $pcre_dyn = "yes"; then
410   echo "using libpcrs"
411   STATIC_PCRS_ONLY=#
412   LIBS="$LIBS -lpcrs"
413 else
414   echo "using built-in static pcrs"
415   AC_DEFINE(STATIC_PCRS)
416   STATIC_PCRS_ONLY=
417 fi
418
419 # Which method should be used for URL matching?
420 # pcre, gnu regex or prefix matching?
421 #
422 if test $regex_matching = "gnu"; then
423   echo "using gnu regex for URL matching"
424   AC_DEFINE(REGEX_GNU)
425   GNU_REGEX_ONLY=
426   PCRE_REGEX_ONLY=#
427 elif test $regex_matching = "pcre"; then
428   echo "using pcre regex for URL matching"
429   AC_DEFINE(REGEX_PCRE)
430   GNU_REGEX_ONLY=#
431   PCRE_REGEX_ONLY=
432   if test $pcre_dyn = "yes"; then
433     LIBS="$LIBS -lpcreposix"
434   fi
435 else
436   echo -e "using prefix matching for URLs\nHint: This does NOT make the executable any smaller!"
437   GNU_REGEX_ONLY=#
438   PCRE_REGEX_ONLY=#
439 fi
440
441 AC_SUBST(GNU_REGEX_ONLY)
442 AC_SUBST(PCRE_REGEX_ONLY)
443 AC_SUBST(STATIC_PCRE_ONLY)
444 AC_SUBST(STATIC_PCRS_ONLY)
445
446 AC_OUTPUT(Makefile)
447