diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 69 |
1 files changed, 41 insertions, 28 deletions
diff --git a/configure.in b/configure.in index da98155..3e94eab 100644 --- a/configure.in +++ b/configure.in @@ -49,6 +49,32 @@ AC_CHECK_HEADER(adns.h, [], \ AC_CHECK_LIB(adns, adns_init, [LIBS="$LIBS -ladns"],\ [AC_MSG_ERROR(You must have ADNS installed)]) +dnl Check for the regex library +AC_ARG_WITH(regex, \ + [--with-regex Use the GNU regex libary ], + [tinyproxy_cv_regex=yes], + [AC_CHECK_FUNCS(regcomp, tinyproxy_cv_regex=no, tinyproxy_cv_regex=yes)]) + +if test $tinyproxy_cv_regex = no ; then + AC_MSG_CHECKING(whether your system's regexp library is completely broken) + AC_TRY_RUN([ +#include <unistd.h> +#include <regex.h> +main() { regex_t blah ; return regcomp(&blah, "foo.*bar", REG_NOSUB) || regexec(&blah, "foobar", 0, NULL, 0); }], + tinyproxy_cv_regex_broken=no, tinyproxy_cv_regex_broken=yes, tinyproxy_cv_regex_broken=yes) + + AC_MSG_RESULT([$tinyproxy_cv_regex_broken]) + if test $tinyproxy_cv_regex_broken = yes ; then + echo "Using the included GNU regex instead." >&AC_FD_MSG + tinyproxy_cv_regex = yes + fi +fi + +if test $tinyproxy_cv_regex = yes ; then + AC_DEFINE(USE_GNU_REGEX) + LIBOBJS="$LIBOBJS gnuregex.o" +fi + dnl Checks for library functions. AC_TYPE_SIGNAL AC_FUNC_STRFTIME @@ -94,7 +120,7 @@ AC_CHECK_LIB(nsl, gethostname, [LIBS="$LIBS -lnsl"]) AC_CHECK_LIB(socket, setsockopt, [LIBS="$LIBS -lsocket"]) dnl Check to see if the debuging code is turned on -AC_MSG_CHECKING(Include debugging code) +AC_MSG_CHECKING(whether to include debugging code) AC_ARG_ENABLE(debug, \ [--enable-debug turn on additional debugging code], [debug_enabled=yes], [debug_enabled=no]) @@ -103,7 +129,8 @@ if test "$debug_enabled" = "no"; then fi AC_MSG_RESULT($debug_enabled) -AC_MSG_CHECKING(Include support for SOCKS) +dnl Check for SOCKS support +AC_MSG_CHECKING(whether to include support for SOCKS) AC_ARG_ENABLE(socks, \ [--enable-socks enable SOCKS support], [socks_enabled=yes], [socks_enabled=no]) @@ -119,7 +146,8 @@ if test "$socks_enabled" = "$yes"; then fi AC_MSG_RESULT($socks_enabled) -AC_MSG_CHECKING(Include the XTinyproxy header code) +dnl Check to see if the XTinyproxy header is to be included +AC_MSG_CHECKING(whether to include the XTinyproxy header code) AC_ARG_ENABLE(xtinyproxy, \ [--enable-xtinyproxy enable the use of the XTinyproxy header], [xtinyproxy_enabled=yes], [xtinyproxy_enabled=no]) @@ -128,7 +156,8 @@ if test "$xtinyproxy_enabled" = "yes"; then fi AC_MSG_RESULT($xtinyproxy_enabled) -AC_MSG_CHECKING(Include filtering of domain/URL) +dnl Include filtering for domain/URLs +AC_MSG_CHECKING(whether to include the filtering of domain/URL) AC_ARG_ENABLE(filter, \ [--enable-filter enable filtering of domains/URLs], [filter_enabled=yes], [filter_enabled=no]) @@ -138,31 +167,15 @@ if test "$filter_enabled" = "yes"; then fi AC_MSG_RESULT($filter_enabled) -dnl Check for the regex library -AC_ARG_WITH(regex, \ - [--with-regex Use the GNU regex libary ], - [tinyproxy_cv_regex=yes], - [AC_CHECK_FUNCS(regcomp, tinyproxy_cv_regex=no, tinyproxy_cv_regex=yes)]) - -if test $tinyproxy_cv_regex = no ; then - AC_MSG_CHECKING(whether your system's regexp library is completely broken) - AC_TRY_RUN([ -#include <unistd.h> -#include <regex.h> -main() { regex_t blah ; return regcomp(&blah, "foo.*bar", REG_NOSUB) || regexec(&blah, "foobar", 0, NULL, 0); }], - tinyproxy_cv_regex_broken=no, tinyproxy_cv_regex_broken=yes, tinyproxy_cv_regex_broken=yes) - - AC_MSG_RESULT([$tinyproxy_cv_regex_broken]) - if test $tinyproxy_cv_regex_broken = yes ; then - echo "Using the included GNU regex instead." >&AC_FD_MSG - tinyproxy_cv_regex = yes - fi -fi - -if test $tinyproxy_cv_regex = yes ; then - AC_DEFINE(USE_GNU_REGEX) - LIBOBJS="$LIBOBJS gnuregex.o" +dnl Include support for upstream proxies? +AC_MSG_CHECKING(whether to include support for upstream proxies) +AC_ARG_ENABLE(upstream, \ + [--enable-upstream enable support for upstream proxies], + [upstream_enabled=yes],[upstream_enabled=no]) +if test "$upstream_enabled" = "yes"; then + AC_DEFINE(UPSTREAM_PROXY) fi +AC_MSG_RESULT($upstream_enabled) AC_SUBST(CFLAGS)dnl AC_SUBST(LIBS)dnl |