2 # Process this file with autoconf to produce a configure script.
5 AC_INIT(vde2, [2.1.5], renzo@cs.unibo.it)
6 AM_INIT_AUTOMAKE([foreign])
7 AC_CONFIG_SRCDIR([vde.h])
8 AC_CONFIG_HEADER([config.h])
10 # Checks for programs.
17 # Checks for libraries.
18 AC_CHECK_LIB([dl], [dlopen])
19 AC_CHECK_LIB([crypto], [EVP_EncryptInit],
20 [add_cryptcab_support=yes],
21 [add_cryptcab_support=no ; warn_cryptcab=yes])
23 # Checks for header files.
26 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termio.h termios.h unistd.h sys/filio.h sys/bitypes.h sys/wait.h sys/select.h sys/signal.h sys/stropts.h termios.h sys/type32.h])
28 AC_CHECK_HEADERS([syslimits.h sys/syslimits.h])
30 AC_CHECK_HEADERS([openssl/blowfish.h],
32 [add_cryptcab_support=no ; warn_cryptcab=yes])
34 # Checks for typedefs, structures, and compiler characteristics.
44 # Checks for library functions.
47 AC_PROG_GCC_TRADITIONAL
51 AC_FUNC_SELECT_ARGTYPES
54 AC_CHECK_FUNCS([atexit dup2 gethostbyname gethostname gettimeofday inet_ntoa memmove memset putenv select setenv socket strchr strdup strndup strerror strstr uname inet_aton sprintf readv random srandom index bcmp drand48 memmove gethostid revoke fchmod getopt_long_only])
56 # All other nice checks I have to make for recostructing missing parts of
57 # slirp's config.h file
59 AC_CHECK_SIZEOF(short)
61 AC_CHECK_SIZEOF(char *)
63 # Define VDE_LINUX or VDE_DARWIN
66 AC_DEFINE([VDE_LINUX], 1, [If defined, this is a Linux system])
69 AC_DEFINE([VDE_DARWIN], 1, [If defined, this is a Darwin system])
72 AC_MSG_ERROR([Unsupported architecture: $build_os. At the moment, only
73 Linux and Darwin are supported. Contributions are appreciated! :-)])
78 # Disable vde_cryptcab? (depends on ssl, maybe unwanted)
79 AC_ARG_ENABLE([cryptcab],
80 AS_HELP_STRING([--disable-cryptcab],
81 [Disable libcrypto-dependend vde_cryptcab compilation]),
82 [if test $enableval = "no" ; then add_cryptcab_support=no ; warn_cryptcab=no ; fi])
84 # Check of tuntap device
85 AC_ARG_ENABLE([tuntap],
86 AS_HELP_STRING([--disable-tuntap],
87 [Disable tuntap compilation]),
88 [if test $enableval != "no" ; then add_tuntap_support=yes ; else add_tuntap_support=no ; fi],
89 [add_tuntap_support=yes])
91 # Check for tuntap support for Linux and OSX
92 if test "$add_tuntap_support" = yes ; then
95 AC_CHECK_HEADER([linux/if_tun.h],
96 [AC_DEFINE([TUNTAP], 1, [If defined, tuntap support is compiled in])],
97 [AC_MSG_ERROR([Tuntap support seem to be not enabled on your kernel])])
98 can_make_libvdetap=yes
101 # I don't use AC_CHECK_FILES because I need test -e and not test -r
102 for i in /dev/tap0 /Library/Extensions/tap.kext /System/Library/Extensions/tap.kext ; do
103 AC_MSG_CHECKING([for $i])
104 if test -e "$i" ; then
106 definename="`echo "$i" | tr "a-z*" "A-ZP" | tr -c "0-9A-Z" "_"`"
107 AC_DEFINE_UNQUOTED([HAVE_$definename])
108 eval HAVE_$definename=yes
114 if test "$HAVE__DEV_TAP0_" ; then
115 AC_DEFINE([TUNTAP], 1, [If defined, tuntap support is compiled in])
116 if ! test "$HAVE__LIBRARY_EXTENSIONS_TAP_KEXT_" -o "$HAVE__SYSTEM_LIBRARY_EXTENSIONS_TAP_KEXT_" ; then
117 AC_MSG_WARN([/dev/tap0 exists, but the kext cannot be found. Let's hope your
118 configuration does work...])
120 AC_MSG_CHECKING([for broken poll() support in Tiger])
121 if expr "$build_os" : "darwin8\..*" > /dev/null; then
122 AC_MSG_RESULT([yes, emulating with select()])
123 AC_DEFINE([HAVE_BROKEN_POLL], 1, [If defined, use poll2select])
129 AC_MSG_ERROR([You do not have tuntap support. You can get it here:
130 http://www-user.rhrk.uni-kl.de/~nissler/tuntap/])
136 AM_CONDITIONAL(ENABLE_CRYPTCAB, test "$add_cryptcab_support" = yes)
137 AM_CONDITIONAL(WANT_TUNTAP, test "$add_tuntap_support" = yes)
138 AM_CONDITIONAL(CAN_MAKE_LIBVDETAP, test "$can_make_libvdetap" = yes)
139 AM_CONDITIONAL(HAVE_BROKEN_POLL, test "$have_broken_poll" = yes)
141 AC_CONFIG_FILES([Makefile]
146 [libvdeplug/Makefile]
148 [vde_plug2tap/Makefile]
149 [vde_cryptcab/Makefile]
153 [wirefilter/Makefile]
157 if test x$warn_cryptcab = "xyes"
159 AC_MSG_WARN([VDE CryptCab support has been disabled because libcrypto is
160 not installed on your system, or because openssl/blowfish.h could not be
161 found. Please install them if you want CryptCab to be compiled and installed.])