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