2 # Process this file with autoconf to produce a configure script.
5 AC_INIT(vde2, [2.1.6], renzo@cs.unibo.it)
6 AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects])
7 AC_CONFIG_SRCDIR([vde.h])
8 AC_CONFIG_HEADER([config.h])
9 AC_CONFIG_LIBOBJ_DIR(utils)
11 # Checks for programs.
18 # Checks for libraries.
19 AC_CHECK_LIB([dl], [dlopen])
20 AC_CHECK_LIB([crypto], [EVP_EncryptInit],
21 [add_cryptcab_support=yes],
22 [add_cryptcab_support=no ; warn_cryptcab=yes])
23 AC_CHECK_LIB([pcap], [pcap_open_dead],
25 [add_pcap=no ; warn_pcap=yes])
27 # Checks for header files.
30 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])
32 AC_CHECK_HEADERS([syslimits.h sys/syslimits.h])
34 AC_CHECK_HEADERS([openssl/blowfish.h],
36 [add_cryptcab_support=no ; warn_cryptcab=yes])
38 # Checks for typedefs, structures, and compiler characteristics.
48 # Checks for library functions.
51 AC_PROG_GCC_TRADITIONAL
55 AC_FUNC_SELECT_ARGTYPES
58 AC_CHECK_FUNCS([atexit dup2 gethostbyname gethostname gettimeofday inet_ntoa memmove memset putenv select setenv socket strchr strdup strerror strstr uname inet_aton sprintf readv random srandom index bcmp drand48 memmove gethostid revoke fchmod getopt_long_only funopen])
59 AC_REPLACE_FUNCS([open_memstream strndup])
60 AC_MSG_CHECKING([for broken poll()])
61 if expr "$build_os" : "darwin8\..*" > /dev/null; then
62 AC_MSG_RESULT([yes, emulating with select()])
63 AC_DEFINE([HAVE_POLL], 0, [Define to 1 if your system has a working poll() function.])
65 AC_DEFINE([poll], [rpl_poll], [Define to rpl_poll if the replacement function should be used.])
68 AC_DEFINE([HAVE_POLL], 1, [Define to 1 if your system has a working poll() function.])
72 # All other nice checks I have to make for recostructing missing parts of
73 # slirp's config.h file
75 AC_CHECK_SIZEOF(short)
77 AC_CHECK_SIZEOF(char *)
79 # Define VDE_LINUX or VDE_DARWIN
82 AC_DEFINE([VDE_LINUX], 1, [If defined, this is a Linux system])
85 AC_DEFINE([VDE_DARWIN], 1, [If defined, this is a Darwin system])
89 AC_DEFINE([VDE_FREEBSD], 1, [If defined, this is a FreeBSD system])
92 AC_MSG_ERROR([Unsupported architecture: $build_os. At the moment, only
93 Linux, Darwin and FreeBSD are supported. Contributions are appreciated! :-)])
97 # Enable experimental features
98 AC_ARG_ENABLE([experimental],
99 AS_HELP_STRING([--enable-experimental],
100 [Enable experimental features (async notifies, plugin support, packet counter)]),
101 [if test $enableval = "yes"; then enable_experimental=yes; fi])
103 # Disable vde_cryptcab? (depends on ssl, maybe unwanted)
104 AC_ARG_ENABLE([cryptcab],
105 AS_HELP_STRING([--disable-cryptcab],
106 [Disable libcrypto-dependend vde_cryptcab compilation]),
107 [if test $enableval = "no" ; then add_cryptcab_support=no ; warn_cryptcab=no ; fi])
109 # Check of tuntap device
110 AC_ARG_ENABLE([tuntap],
111 AS_HELP_STRING([--disable-tuntap],
112 [Disable tuntap compilation]), [:],
115 AC_CHECK_HEADER([linux/if_tun.h],
116 [AC_DEFINE([HAVE_TUNTAP], 1, [If defined, tuntap support is compiled in])],
117 [AC_MSG_WARN([Tuntap support seem to be not enabled on your kernel])])
118 can_make_libvdetap=yes
121 # I don't use AC_CHECK_FILES because I need test -e and not test -r
122 for i in /dev/tap0 /Library/Extensions/tap.kext /System/Library/Extensions/tap.kext ; do
123 AC_MSG_CHECKING([for $i])
124 if test -e "$i" ; then
126 definename="`echo "$i" | tr "a-z*" "A-ZP" | tr -c "0-9A-Z" "_"`"
127 AC_DEFINE_UNQUOTED([HAVE_$definename])
128 eval HAVE_$definename=yes
134 if test "$HAVE__DEV_TAP0_" ; then
135 AC_DEFINE([HAVE_TUNTAP], 1, [If defined, tuntap support is compiled in])
136 if ! test "$HAVE__LIBRARY_EXTENSIONS_TAP_KEXT_" -o "$HAVE__SYSTEM_LIBRARY_EXTENSIONS_TAP_KEXT_" ; then
137 AC_MSG_WARN([/dev/tap0 exists, but the kext cannot be found. Let's hope your
138 configuration does work...])
141 AC_MSG_WARN([You do not have tuntap support. You can get it here:
142 http://www-user.rhrk.uni-kl.de/~nissler/tuntap/])
146 AC_CHECK_HEADER([net/if_tun.h],
147 [AC_DEFINE([HAVE_TUNTAP], 1, [If defined, tuntap support is compiled in])],
148 [AC_MSG_WARN([Tuntap support seem to be not enabled on your kernel])])
152 AM_CONDITIONAL(ENABLE_CRYPTCAB, test "$add_cryptcab_support" = yes)
153 AM_CONDITIONAL(ENABLE_PCAP, test "$add_pcap" = yes)
154 AM_CONDITIONAL(CAN_MAKE_LIBVDETAP, test "$can_make_libvdetap" = yes)
155 AM_CONDITIONAL(ENABLE_EXPERIMENTAL, test "$enable_experimental" = yes)
156 AM_CONDITIONAL(DARWIN_GCC, test "$darwin_gcc" = yes)
158 if test "x${prefix}" = "xNONE"; then
159 AC_DEFINE_UNQUOTED(INSTALLPATH, "${ac_default_prefix}",[PREFIX])
161 AC_DEFINE_UNQUOTED(INSTALLPATH, "${prefix}",[PREFIX])
165 AC_CONFIG_FILES([Makefile]
170 [libvdeplug/Makefile]
172 [vde_plug2tap/Makefile]
173 [vde_cryptcab/Makefile]
177 [wirefilter/Makefile]
178 [vde_over_ns/Makefile]
182 [libvdemgmt/Makefile]
185 [vde_autolink/Makefile])
188 if test x$warn_cryptcab = "xyes"
190 AC_MSG_WARN([VDE CryptCab support has been disabled because libcrypto is
191 not installed on your system, or because openssl/blowfish.h could not be
192 found. Please install them if you want CryptCab to be compiled and installed.])
195 if test x$warn_pcap = "xyes"
197 AC_MSG_WARN([VDE packet dump plugin has been disabled because libpcap is
198 not installed on your system, or because it's too old.
199 Please install it if you want pdump to be compiled and installed.])