1 dnl Process this file with autoconf to produce a configure script.
3 dnl $Id: configure.in,v 1.30 2002/03/04 17:58:01 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.30 2002/03/04 17:58:01 oes
32 dnl Deleted _DEBUG and PID_FILE_PATH
34 dnl Revision 1.29 2002/02/28 14:20:53 oes
35 dnl Fixed detection of gethost*_r functions on Solaris
37 dnl Revision 1.28 2002/02/27 15:02:38 oes
38 dnl Incremented version number
40 dnl Revision 1.27 2002/01/10 12:35:18 oes
41 dnl Added cross-compile defaults to the AC_CHECK_SIZEOF macros
42 dnl to silence autoconf warnings. Numbers are for Intel/Linux.
43 dnl Is there a better way?
45 dnl Revision 1.26 2002/01/09 14:29:49 oes
46 dnl - Added AC_CHECK_FUNC tests for the availability of
47 dnl gethostbyname_r, gethostbyaddr_r, gmtime_r and
48 dnl localtime_r, as well as AC_TRY_COMPILE tests to
49 dnl determine their signatures.
51 dnl - Fixed a bug with the init of CFLAGS that was
52 dnl reported by barsnick
54 dnl Revision 1.25 2002/01/04 15:27:18 oes
55 dnl Changed quoting of CODE_STATUS for use in make
57 dnl Revision 1.24 2001/12/30 14:07:31 steudten
58 dnl - Add signal handling (unix)
59 dnl - Add SIGHUP handler (unix)
60 dnl - Add creation of pidfile (unix)
61 dnl - Add action 'top' in rc file (RH)
62 dnl - Add entry 'SIGNALS' to manpage
63 dnl - Add exit message to logfile (unix)
65 dnl Revision 1.23 2001/12/09 20:24:42 david__schmidt
66 dnl Change from "alpha" to "beta" in configure.in
68 dnl Revision 1.22 2001/12/01 11:24:01 jongfoster
69 dnl Renaming Makefile.in to GNUmakefile.in so that non-GNU versions of
70 dnl make break in a more obvious way.
72 dnl Revision 1.21 2001/11/30 21:35:54 jongfoster
73 dnl Bumping version number to 2.9.10
75 dnl Revision 1.20 2001/10/23 21:24:09 jongfoster
76 dnl Support for FEATURE_CGI_EDIT_ACTIONS
78 dnl Revision 1.19 2001/10/07 15:33:14 oes
79 dnl Removed FEATURE_DENY_GZIP
80 dnl Bumped up version number
82 dnl Revision 1.18 2001/09/13 13:10:24 steudten
84 dnl PreWork for Debug Interface.
85 dnl Add new option "--with-debug" to enable debugging (flags aso.)
87 dnl Revision 1.17 2001/09/12 23:44:55 david__schmidt
88 dnl Mac OSX (Darwin) support added.
90 dnl Revision 1.16 2001/09/12 22:55:45 joergs
91 dnl AmigaOS support added.
93 dnl Revision 1.15 2001/09/12 17:28:59 david__schmidt
95 dnl OS/2 port: update autoconf'd support for the platform.
97 dnl Revision 1.14 2001/07/30 22:12:11 jongfoster
98 dnl Fixing Solaris build (I hope) and tidying up #defines:
99 dnl - All feature #defines are now of the form FEATURE_xxx
100 dnl - Permanently turned off WIN_GUI_EDIT
101 dnl - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS
103 dnl Revision 1.13 2001/07/29 17:09:17 jongfoster
104 dnl Major changes to build system in order to fix these bugs:
105 dnl - pthreads under Linux was broken - changed -lpthread to -pthread
106 dnl - Compiling in MinGW32 mode under CygWin now correctly detects
107 dnl which shared libraries are available
108 dnl - Solaris support (?) (Not tested under Solaris yet)
110 dnl Revision 1.12 2001/07/25 19:16:27 oes
111 dnl Bumping version number to 2.9.8
113 dnl Revision 1.11 2001/07/21 18:00:07 jongfoster
114 dnl Bumping version number to 2.9.7
116 dnl Revision 1.10 2001/07/18 17:25:04 oes
119 dnl Revision 1.9 2001/07/15 19:45:13 jongfoster
120 dnl Added support for linking with POSIX threads library
122 dnl Revision 1.8 2001/07/15 17:54:29 jongfoster
123 dnl Renaming #define STATIC to STATIC_PCRE
124 dnl Adding new #define FEATURE_PTHREAD that will be used to enable
125 dnl POSIX threads support.
127 dnl Revision 1.7 2001/07/13 13:58:05 oes
128 dnl Completely reorganized the selection scheme for
129 dnl pcre, pcreposix, pcrs and gnu_regex:
131 dnl The presence of shared pcre, pcreposix or pcrs
132 dnl libraried is now autodetected. Additionally, the
133 dnl user can enforce using the built-in static variants
134 dnl by specifying --disable-dynamic-(pcre|pcrs).
135 dnl Care is taken to avoid that pcre is dyn, while pcreposix
136 dnl is static, if both are used and that pcrs is static if
139 dnl The choice between pcre, gnu or no regex for actionsfile
140 dnl URL matching is now via
141 dnl --(enable|disable)-regex-matching[=(gnu|pcre|no)] with the
142 dnl default being pcre.
144 dnl Revision 1.6 2001/06/29 21:56:40 oes
147 dnl Revision 1.5 2001/06/29 13:26:27 oes
148 dnl Introduced #define CODE_STATUS
150 dnl Revision 1.4 2001/05/29 09:50:24 jongfoster
151 dnl Unified blocklist/imagelist/permissionslist.
152 dnl File format is still under discussion, but the internal changes
153 dnl are (mostly) done.
155 dnl Also modified interceptor behaviour:
156 dnl - We now intercept all URLs beginning with one of the following
157 dnl prefixes (and *only* these prefixes):
159 dnl * http://ijbswa.sf.net/config/
160 dnl * http://ijbswa.sourceforge.net/config/
161 dnl - New interceptors "home page" - go to http://i.j.b/ to see it.
162 dnl - Internal changes so that intercepted and fast redirect pages
163 dnl are not replaced with an image.
164 dnl - Interceptors now have the option to send a binary page direct
165 dnl to the client. (i.e. ijb-send-banner uses this)
166 dnl - Implemented show-url-info interceptor. (Which is why I needed
167 dnl the above interceptors changes - a typical URL is
168 dnl "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif".
169 dnl The previous mechanism would not have intercepted that, and
170 dnl if it had been intercepted then it then it would have replaced
171 dnl it with an image.)
173 dnl Revision 1.3 2001/05/22 18:46:04 oes
175 dnl - Enabled filtering banners by size rather than URL
176 dnl by adding patterns that replace all standard banner
177 dnl sizes with the "Junkbuster" gif to the re_filterfile
179 dnl - Enabled filtering WebBugs by providing a pattern
180 dnl which kills all 1x1 images
182 dnl - Added support for PCRE_UNGREEDY behaviour to pcrs,
183 dnl which is selected by the (nonstandard and therefore
184 dnl capital) letter 'U' in the option string.
185 dnl It causes the quantifiers to be ungreedy by default.
186 dnl Appending a ? turns back to greedy (!).
188 dnl - Added a new interceptor ijb-send-banner, which
189 dnl sends back the "Junkbuster" gif. Without imagelist or
190 dnl MSIE detection support, or if tinygif = 1, or the
191 dnl URL isn't recognized as an imageurl, a lame HTML
192 dnl explanation is sent instead.
194 dnl - Added new feature, which permits blocking remote
195 dnl script redirects and firing back a local redirect
197 dnl The feature is conditionally compiled, i.e. it
198 dnl can be disabled with --disable-fast-redirects,
199 dnl plus it must be activated by a "fast-redirects"
200 dnl line in the config file, has its own log level
201 dnl and of course wants to be displayed by show-proxy-args
202 dnl Note: Boy, all the #ifdefs in 1001 locations and
203 dnl all the fumbling with configure.in and acconfig.h
204 dnl were *way* more work than the feature itself :-(
206 dnl - Because a generic redirect template was needed for
207 dnl this, tinygif = 3 now uses the same.
209 dnl - Moved GIFs, and other static HTTP response templates
212 dnl - Some minor fixes
214 dnl - Removed some >400 CRs again (Jon, you really worked
217 dnl Revision 1.2 2001/05/20 01:21:20 jongfoster
218 dnl Version 2.9.4 checkin.
219 dnl - Merged popupfile and cookiefile, and added control over PCRS
220 dnl filtering, in new "permissionsfile".
221 dnl - Implemented LOG_LEVEL_FATAL, so that if there is a configuration
222 dnl file error you now get a message box (in the Win32 GUI) rather
223 dnl than the program exiting with no explanation.
224 dnl - Made killpopup use the PCRS MIME-type checking and HTTP-header
226 dnl - Removed tabs from "config"
227 dnl - Moved duplicated url parsing code in "loaders.c" to a new funcition.
228 dnl - Bumped up version number.
230 dnl Revision 1.1.1.1 2001/05/15 13:58:50 oes
231 dnl Initial import of version 2.9.3 source tree
236 dnl =================================================================
237 dnl AutoConf Initialization
238 dnl =================================================================
240 AC_REVISION($Revision: 1.30 $)
242 AC_CONFIG_HEADER(config.h)
246 dnl =================================================================
247 dnl Application version number
248 dnl =================================================================
255 dnl CODE_STATUS can be "alpha", "beta", or "stable", and will be
256 dnl used for CGI output
258 dnl =================================================================
259 dnl Substitute the version numbers
260 dnl =================================================================
262 AC_SUBST(VERSION_MAJOR)
263 AC_SUBST(VERSION_MINOR)
264 AC_SUBST(VERSION_POINT)
265 AC_SUBST(CODE_STATUS)
268 AC_DEFINE_UNQUOTED(VERSION_MAJOR,${VERSION_MAJOR})
269 AC_DEFINE_UNQUOTED(VERSION_MINOR,${VERSION_MINOR})
270 AC_DEFINE_UNQUOTED(VERSION_POINT,${VERSION_POINT})
271 AC_DEFINE_UNQUOTED(VERSION,"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_POINT}")
272 AC_DEFINE_UNQUOTED(CODE_STATUS,"${CODE_STATUS}")
274 dnl =================================================================
275 dnl Checks for programs needed to build.
276 dnl =================================================================
283 dnl RANLIB is for PCRE:
286 AC_CHECK_PROG(GDB,gdb,yes,no)
288 dnl =================================================================
289 dnl debug, gcc and gdb support
290 dnl =================================================================
293 [ --with-debug Enable debug mode],
295 if test "x$withval" != "$xno" ; then
296 if test $ac_cv_prog_cc_g = yes; then
297 if test "$GCC" = yes; then
303 CFLAGS="$CFLAGS -Wshadow -Wconversion"
311 if test "X$CFLAGS" = "X"; then # if CFLAGS are unset
312 if test "$GCC" = yes; then
321 dnl =================================================================
322 dnl additional gcc flags
323 dnl =================================================================
326 CFLAGS="-pipe $CFLAGS"
330 dnl =================================================================
332 dnl =================================================================
334 dnl Must do this first.
336 dnl Reason: This sets CFLAGS in order to switch the Cygwin compiler
337 dnl into Cygwin or MinGW32 modes. Depending on the mode selected,
338 dnl the compiler will use completely different sets of library
339 dnl and include files.
341 dnl =================================================================
346 if test "$MINGW32" = "yes"; then
349 if test "$CYGWIN" = "yes"; then
356 dnl Decide what to do based on target_type
357 dnl Note: PTHREAD_LIB is always set, even if pthread is disabled.
358 dnl This is because we don't know yet whether pthread is enabled.
360 AC_ARG_ENABLE(mingw32,
361 [ --enable-mingw32 Use mingw32 for a Windows GUI],
362 [if test $enableval = yes; then
366 if test $target_type = mingw; then
368 SPECIAL_CFLAGS="-mwindows -mno-cygwin"
369 PTHREAD_LIB=-lpthreadGC
370 echo "Using mingw32 (Win32 GUI)"
373 if test $target_type = cygwin; then
374 SPECIAL_CFLAGS="-mno-win32"
376 echo "Using Cygnus (Win32 command line)"
379 PTHREAD_LIB=-lpthread
384 if test $target_type = unix; then
385 AC_CHECK_PROGS(WDUMP,w3m lynx links,false)
386 if test "$WDUMP" = false; then
387 AC_MSG_ERROR(You need some kind of text browser to continue \(w3m, lynx and links are supported\))
392 dnl Save old CFLAGS so we can restore them later, then add SPECIAL_CFLAGS
393 old_CFLAGS_nospecial=$CFLAGS
394 CFLAGS="$CFLAGS $SPECIAL_CFLAGS"
396 # Hack to force AutoConf to use the CFLAGS we just set
397 dnl Warning: This may break with a future version of Autoconf
398 dnl Tested with autoconf 2.13
399 ac_cpp='$CPP $CPPFLAGS $SPECIAL_CFLAGS'
400 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
401 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
404 dnl =================================================================
406 dnl =================================================================
408 AC_CHECK_HEADER(pthread.h, [have_pthread=yes], [have_pthread=no])
410 AC_ARG_ENABLE(pthread,
411 [ --disable-pthread Don't use POSIX threads (pthreads)],
412 [if test $enableval = no; then
417 if test $have_pthread = yes; then
419 AC_DEFINE(FEATURE_PTHREAD)
420 echo Using POSIX threads
421 if test "$GCC" = "yes"; then
422 # Set a GCC specific switch:
423 if test "$target_type" = "unix"; then
424 # This compiler switch makes Linux thread-safe
425 # Don't know about other OS's? Is this switch
428 SPECIAL_CFLAGS="-pthread"
433 echo Using native threads
436 AC_SUBST(PTHREAD_ONLY)
438 dnl =================================================================
439 dnl Support for thread-safe versions of gethostbyaddr, gethostbyname,
440 dnl gmtime and localtime
441 dnl =================================================================
443 dnl Next line needed to find the gethost*_r functions on Solaris
444 AC_CHECK_LIB(nsl, gethostbyname)
446 AC_CHECK_FUNC(gethostbyaddr_r, [
447 AC_MSG_CHECKING([signature of gethostbyaddr_r])
451 struct hostent *h, *hp;
454 (void) gethostbyaddr_r(a, l, t, h, b, bl, &hp, &e)
456 AC_DEFINE(HAVE_GETHOSTBYADDR_R_8_ARGS)
457 AC_MSG_RESULT([8 args])
465 (void) gethostbyaddr_r(a, l, t, h, b, bl, &e)
467 AC_DEFINE(HAVE_GETHOSTBYADDR_R_7_ARGS)
468 AC_MSG_RESULT([7 args])
473 struct hostent_data *d;
477 (void) gethostbyaddr_r(a, l, t, h, d)
479 AC_DEFINE(HAVE_GETHOSTBYADDR_R_5_ARGS)
480 AC_MSG_RESULT([5 args])
482 AC_MSG_RESULT(unrecognised)
490 AC_CHECK_FUNC(gethostbyname_r, [
491 AC_MSG_CHECKING([signature of gethostbyname_r])
495 struct hostent *h, *r;
498 (void) gethostbyname_r(n, h, b, bl, &r, &e)
500 AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARGS)
501 AC_MSG_RESULT([6 args])
509 (void) gethostbyname_r(n, h, b, bl, &e)
511 AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARGS)
512 AC_MSG_RESULT([5 args])
517 struct hostent_data *d;
520 (void) gethostbyname_r(n, h, d)
522 AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARGS)
523 AC_MSG_RESULT([3 args])
525 AC_MSG_RESULT(unrecognised)
533 AC_CHECK_FUNC(gmtime_r, [
534 AC_MSG_CHECKING([signature of gmtime_r])
540 (void) gmtime_r(t, tm)
543 AC_DEFINE(HAVE_GMTIME_R)
545 AC_MSG_RESULT(unrecognised)
551 AC_CHECK_FUNC(localtime_r, [
552 AC_MSG_CHECKING([signature of localtime_r])
558 (void) localtime_r(t, tm)
561 AC_DEFINE(HAVE_LOCALTIME_R)
563 AC_MSG_RESULT(unrecognised)
569 dnl =================================================================
571 dnl FIXME: Not tested on Solaris yet...
572 dnl =================================================================
578 *-solaris*) SOCKET_LIB="-lsocket -lnsl"
579 AC_DEFINE(__EXTENSIONS__)
580 if test "$GCC" = "yes"; then
581 # Set a GCC specific switch:
582 # This compiler switch makes Solaris thread-safe
584 SPECIAL_CFLAGS="-pthreads"
586 # What do we do without GCC? Guess this:
587 SPECIAL_CFLAGS="-D_REENTRANT"
594 dnl =================================================================
596 dnl =================================================================
599 *-os2-emx*) SOCKET_LIB=-lsocket
605 dnl =================================================================
607 dnl =================================================================
612 *-amigaos) AMIGAOS_ONLY=
616 AC_SUBST(AMIGAOS_ONLY)
618 dnl =================================================================
619 dnl Check for standard compiler stuff
620 dnl =================================================================
627 AC_CHECK_SIZEOF(int, 4)
628 AC_CHECK_SIZEOF(char *, 4)
629 AC_CHECK_SIZEOF(long, 4)
630 AC_CHECK_SIZEOF(long long, 8)
631 AC_CHECK_SIZEOF(size_t, 4)
633 dnl Checks for header files.
634 dnl AC_HEADER_SYS_WAIT
635 dnl AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/time.h unistd.h)
637 dnl Checks for library functions.
639 dnl AC_CHECK_FUNC(strstr)
640 dnl bcopy and memmove are for PCRE
641 AC_CHECK_FUNCS(strerror bcopy memmove)
644 dnl =================================================================
645 dnl Checks for libraries.
646 dnl =================================================================
647 dnl Note: Some systems may have the library but not the system header
648 dnl file, so we must check for both.
649 AC_CHECK_LIB(pcre, pcre_compile, [AC_CHECK_HEADER(pcre.h, [have_pcre=yes], [have_pcre=no])], [have_pcre=no])
650 AC_CHECK_LIB(pcreposix, regcomp, [AC_CHECK_HEADER(pcreposix.h, [have_pcreposix=yes], [have_pcreposix=no])], [have_pcreposix=no], -lpcre)
651 AC_CHECK_LIB(pcrs, pcrs_compile, [AC_CHECK_HEADER(pcrs.h, [have_pcrs=yes], [have_pcrs=no])], [have_pcrs=no])
654 dnl =================================================================
656 dnl =================================================================
660 dnl =================================================================
662 dnl =================================================================
664 AC_ARG_ENABLE(toggle,
665 [ --disable-toggle Don't support temporary disable],
666 [if test $enableval = yes; then
667 AC_DEFINE(FEATURE_TOGGLE)
668 fi],AC_DEFINE(FEATURE_TOGGLE))
671 [ --disable-force Don't allow single-page disable],
672 [if test $enableval = yes; then
673 AC_DEFINE(FEATURE_FORCE_LOAD)
674 fi],AC_DEFINE(FEATURE_FORCE_LOAD))
676 AC_ARG_ENABLE(fast-redirects,
677 [ --disable-fast-redirects Don't support fast redirects],
678 [if test $enableval = yes; then
679 AC_DEFINE(FEATURE_FAST_REDIRECTS)
680 fi], AC_DEFINE(FEATURE_FAST_REDIRECTS))
682 AC_ARG_ENABLE(killpopup,
683 [ --disable-killpopup Never block popups],
684 [if test $enableval = yes; then
685 AC_DEFINE(FEATURE_KILL_POPUPS)
686 fi],AC_DEFINE(FEATURE_KILL_POPUPS))
689 [ --disable-stats Don't keep statistics],
690 [if test $enableval = yes; then
691 AC_DEFINE(FEATURE_STATISTICS)
692 fi],AC_DEFINE(FEATURE_STATISTICS))
694 AC_ARG_ENABLE(ie-images,
695 [ --disable-ie-images Don't auto-detect whether a request from MS Internet
696 Explorer is for an image or HTML.],
697 [if test $enableval = yes; then
698 AC_DEFINE(FEATURE_IMAGE_DETECT_MSIE)
700 AC_DEFINE(FEATURE_IMAGE_DETECT_MSIE))
702 AC_ARG_ENABLE(image-blocking,
703 [ --disable-image-blocking Don't try to figure out whether a request is
704 for an image or HTML - assume HTML.],
705 [if test $enableval = yes; then
706 AC_DEFINE(FEATURE_IMAGE_BLOCKING)
708 AC_DEFINE(FEATURE_IMAGE_BLOCKING))
710 AC_ARG_ENABLE(acl-files,
711 [ --disable-acl-files Prevents the use of ACL files to control access to
712 the proxy by IP address.],
713 [if test $enableval = yes; then
714 AC_DEFINE(FEATURE_ACL)
716 AC_DEFINE(FEATURE_ACL))
718 AC_ARG_ENABLE(trust-files,
719 [ --disable-trust-files Prevents the use of trust files.],
720 [if test $enableval = yes; then
721 AC_DEFINE(FEATURE_TRUST)
723 AC_DEFINE(FEATURE_TRUST))
725 AC_ARG_ENABLE(jar-files,
726 [ --disable-jar-files Prevents the use of jar files to capture cookies.],
727 [if test $enableval = yes; then
728 AC_DEFINE(FEATURE_COOKIE_JAR)
730 AC_DEFINE(FEATURE_COOKIE_JAR))
732 AC_ARG_ENABLE(editor,
733 [ --disable-editor Prevents the use of the web-based actions file
734 editor and web-based temporary disable setting.],
735 [if test $enableval = yes; then
736 AC_DEFINE(FEATURE_CGI_EDIT_ACTIONS)
738 AC_DEFINE(FEATURE_CGI_EDIT_ACTIONS))
740 dnl pcre/pcrs is needed for CGI anyway, so
741 dnl the choice is only between static and
744 AC_ARG_ENABLE(regex-matching,
745 [ --enable-regex-matching=pcre Use perl-compatible regex for actionsfile
746 pattern matching (default)
747 --enable-regex-matching=gnu Use gnu style regex for actionsfile pattern
748 matching (-> bigger binary)
749 --disable-regex-matching Don't use regex matching, compare URL
750 prefix instead (won't shrink birary)],
751 [ regex_matching=$enableval ],
752 [ regex_matching=pcre ])
754 AC_ARG_ENABLE(dynamic-pcre,
755 [ --disable-dynamic-pcre Use the built-in, static pcre, even if
756 libpcre is available],
757 [ if test $enableval = "no"; then have_pcre=no; fi ])
759 AC_ARG_ENABLE(dynamic-pcrs,
760 [ --disable-dynamic-pcrs Use the built-in, static pcrs, even if
761 libpcrs is available],
762 [ if test $enableval = "no"; then have_pcrs=no; fi ])
765 # Is the regex URL matching based on libpcreposix, but we
766 # don't have that library?
768 if test $have_pcreposix = "yes" -o $regex_matching != "pcre"; then
769 dont_miss_pcreposix=yes
771 dont_miss_pcreposix=no
774 # If we have libpcre and either we also have pcreposix or
775 # we don't need pcreposix, then link pcre dynamically; else
776 # build it and link statically
778 if test $have_pcre = "yes" -a $dont_miss_pcreposix = "yes"; then
784 echo "using built-in static pcre"
786 AC_DEFINE(STATIC_PCRE)
790 # If we have libpcrs and pcre is linked dynamically
791 # then also link pcrs dynamically, else build and link
794 if test $have_pcrs = "yes" -a $pcre_dyn = "yes"; then
799 echo "using built-in static pcrs"
800 AC_DEFINE(STATIC_PCRS)
804 # Which method should be used for URL matching?
805 # pcre, gnu regex or prefix matching?
807 if test $regex_matching = "gnu"; then
808 echo "using gnu regex for URL matching"
812 elif test $regex_matching = "pcre"; then
813 echo "using pcre regex for URL matching"
814 AC_DEFINE(REGEX_PCRE)
817 if test $pcre_dyn = "yes"; then
818 LIBS="$LIBS -lpcreposix"
821 echo -e "using prefix matching for URLs\nHint: This does NOT make the executable any smaller!"
826 AC_SUBST(GNU_REGEX_ONLY)
827 AC_SUBST(PCRE_REGEX_ONLY)
828 AC_SUBST(STATIC_PCRE_ONLY)
829 AC_SUBST(STATIC_PCRS_ONLY)
831 dnl =================================================================
832 dnl Final cleanup and output
833 dnl =================================================================
835 dnl Remove the SPECIAL_CFLAGS stuff from CFLAGS, and add it seperately
837 CFLAGS=$old_CFLAGS_nospecial
838 AC_SUBST(SPECIAL_CFLAGS)
840 AC_SUBST(PTHREAD_LIB)
842 AC_OUTPUT(GNUmakefile)