+
+dnl pcre/pcrs is needed for CGI anyway, so
+dnl the choice is only between static and
+dnl dynamic:
+
+AC_ARG_ENABLE(dynamic-pcre,
+[ --disable-dynamic-pcre Use the built-in, static pcre, even if libpcre is available],
+[ if test $enableval = "no"; then have_pcre=no; fi ])
+
+dnl =================================================
+dnl libpcrs is temporarily disabled,
+dnl see comment above for the reason.
+dnl =================================================
+dnl AC_ARG_ENABLE(dynamic-pcrs,
+dnl [ --disable-dynamic-pcrs Use the built-in, static pcrs, even if libpcrs is available],
+dnl [ if test $enableval = "no"; then have_pcrs=no; fi ])
+
+
+dnl ====================================================
+dnl This check is incomplete. For mingw32 zlib is found
+dnl by configure, but not necessarily by the compiler.
+dnl ====================================================
+AC_ARG_ENABLE(zlib,
+[ --disable-zlib Don't use zlib to decompress data before filtering.],
+[enableval2=$enableval],
+[enableval2=yes])
+if test $enableval2 = yes; then
+ AC_CHECK_LIB(z, zlibVersion, [have_zlib="yes"], [have_zlib="no"])
+ if test $have_zlib = "yes"; then
+ LIBS="$LIBS -lz"
+ AC_DEFINE(FEATURE_ZLIB,1,[Define to 1 to use zlib to decompress data before filtering.])
+ else
+ AC_MSG_WARN([No zlib found.
+ Privoxy will not be able to filter compressed content.
+ This may become a fatal error in the future.])
+ fi
+fi
+
+AC_ARG_ENABLE(compression,
+[ --enable-compression Allow Privoxy to compress buffered content if the client supports it. Requires zlib support.],
+[enableval2=$enableval],
+[enableval2=no])
+if test $enableval2 = yes; then
+ if test $have_zlib = "yes"; then
+ echo Enabling compression support.
+ AC_DEFINE(FEATURE_COMPRESSION,1,[Define to 1 to use compression through the zlib library.])
+ else
+ AC_MSG_WARN([No zlib found. Privoxy will not be able to (re-)compressed buffered content.])
+ fi
+fi
+
+
+# If we have libpcre and either we also have pcreposix or
+# we don't need pcreposix, then link pcre dynamically; else
+# build it and link statically
+#
+if test $have_pcre = "yes"; then
+ echo "using libpcre"
+ pcre_dyn=yes
+ STATIC_PCRE_ONLY=#
+ LIBS="$LIBS -lpcre -lpcreposix"
+else
+ AC_MSG_WARN([You are using the static PCRE code which is out of date and scheduled for removal, for details see:
+ http://sourceforge.net/mailarchive/forum.php?thread_name=20080511195555.2dc6cfdc%40fabiankeil.de&forum_name=ijbswa-developers])
+ pcre_dyn=no
+ AC_DEFINE(STATIC_PCRE)
+ STATIC_PCRE_ONLY=
+fi
+
+AC_DEFINE(FEATURE_CONNECTION_KEEP_ALIVE)
+
+if test $have_pthread = "yes" -o $target_type = "mingw"; then
+ echo Enabling connection-sharing support.
+ AC_DEFINE(FEATURE_CONNECTION_SHARING)
+fi
+
+dnl =================================================
+dnl libpcrs is temporarily disabled,
+dnl see comment above for the reason.
+dnl =================================================
+dnl # If we have libpcrs and pcre is linked dynamically
+dnl # then also link pcrs dynamically, else build and link
+dnl # pcrs statically
+dnl
+dnl if test $have_pcrs = "yes" -a $pcre_dyn = "yes"; then
+dnl echo "using libpcrs"
+dnl STATIC_PCRS_ONLY=#
+dnl LIBS="$LIBS -lpcrs"
+dnl else
+dnl echo "using built-in static pcrs"
+ AC_DEFINE(STATIC_PCRS)
+ STATIC_PCRS_ONLY=
+dnl fi
+