diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-08-10 09:01:46 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-08-10 09:01:46 +0000 |
commit | d893d8c52ed7a66eaea630cffe94cdaf82fbc99d (patch) | |
tree | a5f150c89866f69116da7ffa6c31568bc2bfdfd8 /configure.in | |
parent | 5cff4164a08af2a869e5e85aa6d359b865eee9aa (diff) | |
download | tor-d893d8c52ed7a66eaea630cffe94cdaf82fbc99d.tar.gz tor-d893d8c52ed7a66eaea630cffe94cdaf82fbc99d.zip |
r7300@Kushana: nickm | 2006-08-10 01:36:40 -0700
Distinguish netfilter vs pf at configure time based on headers, not on OS.
svn:r7008
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/configure.in b/configure.in index f8adb490b1..331d99689e 100644 --- a/configure.in +++ b/configure.in @@ -58,23 +58,11 @@ fi AC_ARG_ENABLE(transparent, AC_HELP_STRING(--disable-transparent, disable transparent proxy support), - [case "${enableval}" in + [case "${enableval}" in yes) transparent=true ;; no) transparent=false ;; *) AC_MSG_ERROR(bad value for --enable-transparent) ;; esac], [transparent=true]) -if test x$transparent = xtrue; then - AC_DEFINE(USE_TRANSPARENT, 1, "Define to enable transparent proxy support") - case $host in - *-*-linux* ) - AC_DEFINE(TRANS_NETFILTER, 1, "Define for transparent netfilter") ;; - *-*-openbsd*) - AC_DEFINE(TRANS_PF, 1, "Define for transparent pf") - AC_DEFINE(OPENBSD, 1, "Define to handle pf on OpenBSD properly") ;; - *-*-*bsd* ) - AC_DEFINE(TRANS_PF, 1, "Define for transparent pf") ;; - esac -fi case $host in *-*-solaris* ) @@ -379,6 +367,11 @@ dnl These headers are not essential AC_CHECK_HEADERS(stdint.h sys/types.h inttypes.h sys/param.h sys/wait.h limits.h sys/limits.h netinet/in.h arpa/inet.h machine/limits.h syslog.h sys/time.h sys/resource.h stddef.h inttypes.h utime.h sys/utime.h sys/mman.h alloca.h) +AC_CHECK_HEADERS(net/if.h, [net_if_found=1], [net_if_found=0]) +AC_CHECK_HEADERS(net/pfvar.h, [net_pfvar_found=1], [net_pfvar_found=0]) +AC_CHECK_HEADERS(linux/netfilter_ipv4, [linux_netfilter_ipv4=1], + [linux_netfilter_ipv4=0]) + AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime getrlimit setrlimit strlcat strlcpy strtoull getpwnam getpwuid ftello getaddrinfo localtime_r gmtime_r event_get_version event_get_method event_set_log_callback memmem mmap strtok_r) if test $enable_threads = "yes"; then @@ -386,6 +379,25 @@ if test $enable_threads = "yes"; then AC_CHECK_FUNCS(pthread_create) fi +if test x$transparent = xtrue ; then + transparent_ok=0 + if test x$net_if_found = x1 -a x$net_pfvar_found = x1 ; then + transparent_ok=1 + fi + if test x$linux_netfilter_ipv4 = x1 ; then + transparent_ok=1 + fi + if x$transparent_ok = x1 ; then + AC_DEFINE(USE_TRANSPARENT, 1, "Define to enable transparent proxy support") + case $host in + *-*-openbsd*) + AC_DEFINE(OPENBSD, 1, "Define to handle pf on OpenBSD properly") ;; + esac + else + AC_MSG_NOTICE([Transparent proxy support enabled, but missing headers.]) + fi +fi + AC_FUNC_FSEEKO AC_CHECK_MEMBERS([struct timeval.tv_sec]) |