2 # Process this file with autoconf to produce a configure script.
5 AC_INIT(vde2, [2.2.0-pre1], 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.])
67 AC_DEFINE([HAVE_POLL], 1, [Define to 1 if your system has a working poll() function.])
71 # All other nice checks I have to make for recostructing missing parts of
72 # slirp's config.h file
74 AC_CHECK_SIZEOF(short)
76 AC_CHECK_SIZEOF(char *)
78 # Define VDE_LINUX or VDE_DARWIN
81 AC_DEFINE([VDE_LINUX], 1, [If defined, this is a Linux system])
84 AC_DEFINE([VDE_DARWIN], 1, [If defined, this is a Darwin system])
88 AC_DEFINE([VDE_FREEBSD], 1, [If defined, this is a FreeBSD system])
91 AC_MSG_ERROR([Unsupported architecture: $build_os. At the moment, only
92 Linux, Darwin and FreeBSD are supported. Contributions are appreciated! :-)])
96 # Enable experimental features
97 AC_ARG_ENABLE([experimental],
98 AS_HELP_STRING([--enable-experimental],
99 [Enable experimental features (async notifies, plugin support, packet counter)]),
100 [if test $enableval = "yes"; then enable_experimental=yes; fi])
102 # Disable vde_cryptcab? (depends on ssl, maybe unwanted)
103 AC_ARG_ENABLE([cryptcab],
104 AS_HELP_STRING([--disable-cryptcab],
105 [Disable libcrypto-dependend vde_cryptcab compilation]),
106 [if test $enableval = "no" ; then add_cryptcab_support=no ; warn_cryptcab=no ; fi])
108 # Check of tuntap device
109 AC_ARG_ENABLE([tuntap],
110 AS_HELP_STRING([--disable-tuntap],
111 [Disable tuntap compilation]), [:],
114 AC_CHECK_HEADER([linux/if_tun.h],
115 [AC_DEFINE([HAVE_TUNTAP], 1, [If defined, tuntap support is compiled in])],
117 can_make_libvdetap=yes
120 # I don't use AC_CHECK_FILES because I need test -e and not test -r
121 for i in /dev/tap0 /Library/Extensions/tap.kext /System/Library/Extensions/tap.kext ; do
122 AC_MSG_CHECKING([for $i])
123 if test -e "$i" ; then
125 definename="`echo "$i" | tr "a-z*" "A-ZP" | tr -c "0-9A-Z" "_"`"
126 AC_DEFINE_UNQUOTED([HAVE_$definename])
127 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...])
142 AC_MSG_WARN([You do not have tuntap support. You can get it here:
143 http://www-user.rhrk.uni-kl.de/~nissler/tuntap/])
147 AC_CHECK_HEADER([net/if_tun.h],
148 [AC_DEFINE([HAVE_TUNTAP], 1, [If defined, tuntap support is compiled in])],
153 AM_CONDITIONAL(ENABLE_CRYPTCAB, test "$add_cryptcab_support" = yes)
154 AM_CONDITIONAL(ENABLE_PCAP, test "$add_pcap" = yes)
155 AM_CONDITIONAL(CAN_MAKE_LIBVDETAP, test "$can_make_libvdetap" = yes)
156 AM_CONDITIONAL(ENABLE_EXPERIMENTAL, test "$enable_experimental" = yes)
157 AM_CONDITIONAL(DARWIN_GCC, test "$darwin_gcc" = yes)
159 if test "x${prefix}" = "xNONE"; then
160 AC_DEFINE_UNQUOTED(INSTALLPATH, "${ac_default_prefix}",[PREFIX])
162 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]
186 [libvdesnmp/Makefile])
192 echo "Configure results:"
194 if test x$add_cryptcab_support = "xyes" ; then
195 echo " vde_cryptcab : enabled"
197 echo " vde_cryptcab : disabled"
198 if test x$warn_cryptcab = "xyes" ; then
199 AC_MSG_WARN([VDE CryptCab support has been disabled because libcrypto is
200 not installed on your system, or because openssl/blowfish.h could not be
201 found. Please install them if you want CryptCab to be compiled and installed.])
204 if test x$warn_tuntap = "xyes" ; then
205 echo " tuntap support : disabled"
207 echo " tuntap support : enabled"
209 if test x$warn_pcap = "xyes" ; then
210 echo " pcap support : disabled"
211 AC_MSG_WARN([VDE packet dump plugin has been disabled because libpcap is
212 not installed on your system, or because it's too old.
213 Please install it if you want pdump to be compiled and installed.])
215 echo " pcap support : enabled"
217 if test x$enable_experimental = "xyes" ; then
218 echo " experimental features : enabled"
220 echo " experimental features : disabled"
223 echo "Type 'make' to compile $PACKAGE $VERSION"
224 echo "and then type 'make install' to install it into $prefix"