2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([vde2],[2.3.1],[info@v2.cs.unibo.it])
6 AC_CONFIG_MACRO_DIR([m4])
7 AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects])
8 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
9 AC_CONFIG_SRCDIR([include/vde.h])
10 AC_CONFIG_HEADER([include/config.h])
11 AC_CONFIG_LIBOBJ_DIR(src/common)
13 # Checks for programs.
21 AC_DEFINE_UNQUOTED(MODULES_EXT, "$shrext_cmds", [Extension of shared objects])
23 # Checks for libraries.
24 AC_CHECK_LIB([dl], [dlopen])
25 AC_CHECK_LIB([crypto], [EVP_EncryptInit],
26 [add_cryptcab_support=yes],
27 [add_cryptcab_support=no ; warn_cryptcab=yes])
28 AC_CHECK_LIB([pcap], [pcap_open_dead],
30 [add_pcap=no ; warn_pcap=yes])
32 # Checks for header files.
35 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stddef.h stdint.h \
36 stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/socket.h \
37 sys/time.h syslog.h termio.h termios.h unistd.h sys/filio.h sys/bitypes.h \
38 sys/wait.h sys/select.h sys/signal.h sys/stropts.h termios.h sys/type32.h])
40 AC_CHECK_HEADERS([syslimits.h sys/syslimits.h])
42 AC_CHECK_HEADERS([openssl/blowfish.h], [],
43 [add_cryptcab_support=no ; warn_cryptcab=yes])
45 # Checks for typedefs, structures, and compiler characteristics.
55 # Checks for library functions.
58 AC_PROG_GCC_TRADITIONAL
62 AC_FUNC_SELECT_ARGTYPES
64 AC_CHECK_FUNCS([atexit dup2 gethostbyname gethostname gettimeofday inet_ntoa \
65 memmove memset putenv select setenv socket strchr strdup strerror strstr \
66 uname inet_aton sprintf readv random srandom index bcmp drand48 memmove \
67 gethostid revoke fchmod getopt_long_only funopen])
68 AC_REPLACE_FUNCS([open_memstream strndup])
71 AC_MSG_CHECKING([for poll sanity])
72 if expr "$build_os" : "darwin*" > /dev/null; then
73 AC_MSG_RESULT([present but broken, emulating with select])
75 AC_DEFINE([poll], [vde_poll],
76 [Define to vde_poll if the replacement function should be used.])
78 AC_DEFINE([HAVE_POLL], 1, [Define to 1 if your system has a working poll() function.])
84 # All other nice checks I have to make for recostructing missing parts of
85 # slirp's config.h file
87 AC_CHECK_SIZEOF(short)
89 AC_CHECK_SIZEOF(char *)
91 # Define VDE_LINUX or VDE_DARWIN
94 AC_DEFINE([VDE_LINUX], 1, [If defined, this is a Linux system])
97 AC_DEFINE([VDE_DARWIN], 1, [If defined, this is a Darwin system])
101 AC_DEFINE([VDE_FREEBSD], 1, [If defined, this is a FreeBSD system])
104 AC_MSG_ERROR([Unsupported OS: $build_os. At the moment, only Linux, Darwin
105 and FreeBSD are supported. Contributions are appreciated! :-)])
109 # Enable profiling options
110 AC_ARG_ENABLE([profile],
111 AS_HELP_STRING([--enable-profile],
112 [Compile with debugging/profiling options]),
113 [if test $enableval = "yes"; then enable_profile=yes; fi])
115 # Enable experimental features
116 AC_ARG_ENABLE([experimental],
117 AS_HELP_STRING([--enable-experimental],
118 [Enable experimental features (async notifies, plugin support, packet counter)]),
119 [if test $enableval = "yes"; then enable_experimental=yes; fi])
121 # Disable vde_cryptcab? (depends on ssl, maybe unwanted)
122 AC_ARG_ENABLE([cryptcab],
123 AS_HELP_STRING([--disable-cryptcab],
124 [Disable libcrypto-dependend vde_cryptcab compilation]),
125 [if test $enableval = "no" ; then add_cryptcab_support=no ; warn_cryptcab=no ; fi])
127 # Check of tuntap device
128 AC_ARG_ENABLE([tuntap],
129 AS_HELP_STRING([--disable-tuntap], [Disable tuntap compilation]), [:],
132 AC_CHECK_HEADER([linux/if_tun.h],
133 [AC_DEFINE([HAVE_TUNTAP], 1, [If defined, tuntap support is compiled in])],
135 can_make_libvdetap=yes
136 can_make_vdetunctl=yes
139 # I don't use AC_CHECK_FILES because I need test -e and not test -r
140 for i in /dev/tap0 /Library/Extensions/tap.kext ; do
141 AC_MSG_CHECKING([for $i])
142 if test -e "$i" ; then
144 definename="`echo "$i" | tr "a-z*" "A-ZP" | tr -c "0-9A-Z" "_"`"
145 AC_DEFINE_UNQUOTED([HAVE_$definename])
146 eval HAVE_$definename=yes
153 if test "$HAVE__DEV_TAP0_" ; then
154 AC_DEFINE([HAVE_TUNTAP], 1, [If defined, tuntap support is compiled in])
155 if ! test "$HAVE__LIBRARY_EXTENSIONS_TAP_KEXT_" || "$HAVE__SYSTEM_LIBRARY_EXTENSIONS_TAP_KEXT_" ; then
156 AC_MSG_WARN([/dev/tap0 exists, but the kext cannot be found. Let's hope your
157 configuration does work...])
161 AC_MSG_WARN([You do not have tuntap support. You can get it here:
162 http://tuntaposx.sourceforge.net/])
166 AC_CHECK_HEADER([net/if_tun.h],
167 [AC_DEFINE([HAVE_TUNTAP], 1, [If defined, tuntap support is compiled in])],
172 # Disable pcap support (pdump)? (depends on libpcap, maybe unwanted)
173 AC_ARG_ENABLE([pcap],
174 AS_HELP_STRING([--disable-pcap],
175 [Disable pcap support (pdump plugin)]),
176 [if test $enableval = "no" ; then add_pcap=no ; warn_pcap=no ; fi])
178 AC_ARG_ENABLE([kernel-switch],
179 AS_HELP_STRING([--enable-kernel-switch],
180 [Compile support for in-kernel switch. ]),
181 [if test $enableval = "yes"; then
182 enable_kernel_switch=yes
183 AC_DEFINE([USE_IPN], 1, [If defined, enable support for IPN socket])
187 AC_ARG_ENABLE([python],
188 AS_HELP_STRING([--disable-python], [Disable python bindings]),
189 [enable_python=$enableval],
193 if test x"$enable_python" = x"yes"; then
195 AM_PATH_PYTHON([2.5])
196 AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
197 if test x"$PYTHON_CONFIG" = x""; then
198 AC_PATH_PROG(PYTHON_CONFIG, python-config)
200 if test x"$PYTHON_CONFIG" = x""; then
204 PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
205 PYTHON_LIBS=`$PYTHON_CONFIG --libs`
206 PYTHON_INCLUDES="$PYTHON_CFLAGS"
208 AC_SUBST(PYTHON_CFLAGS)
209 AC_SUBST(PYTHON_INCLUDES)
210 AC_SUBST(PYTHON_LIBS)
214 AM_CONDITIONAL(ENABLE_CRYPTCAB, test "$add_cryptcab_support" = yes)
215 AM_CONDITIONAL(ENABLE_PYTHON, test "$enable_python" = yes)
216 AM_CONDITIONAL(ENABLE_PCAP, test "$add_pcap" = yes)
217 AM_CONDITIONAL(CAN_MAKE_LIBVDETAP, test "$can_make_libvdetap" = yes)
218 AM_CONDITIONAL(CAN_MAKE_VDETUNCTL, test "$can_make_vdetunctl" = yes)
219 AM_CONDITIONAL(ENABLE_EXPERIMENTAL, test "$enable_experimental" = yes)
220 AM_CONDITIONAL(ENABLE_PROFILE, test "$enable_profile" = yes)
221 AM_CONDITIONAL(DARWIN_GCC, test "$darwin_gcc" = yes)
222 AM_CONDITIONAL(ENABLE_KERNEL_SWITCH, test "$enable_kernel_switch" = yes)
225 CFLAGS="-Wall -O2 $CFLAGS"
239 [src/lib/python/Makefile]
240 [src/vde_switch/Makefile]
241 [src/kvde_switch/Makefile]
242 [src/vde_over_ns/Makefile]
243 [src/common/Makefile]
244 [src/vdetaplib/Makefile]
245 [src/vde_l3/Makefile]
246 [src/vde_cryptcab/Makefile]
247 [src/slirpvde/Makefile]
248 [src/vde_switch/plugins/Makefile]
255 AS_ECHO "Configure results:"
257 if test x$add_cryptcab_support = "xyes" ; then
258 AS_ECHO " + VDE CryptCab............ enabled"
260 AS_ECHO " - VDE CryptCab............ disabled"
263 if test x$enable_python = "xyes" ; then
264 AS_ECHO " + Python Libraries........ enabled"
266 AS_ECHO " - Python Libraries........ disabled"
269 if test x$warn_tuntap = "xyes" ; then
270 AS_ECHO " - TAP support............. disabled"
272 AS_ECHO " + TAP support............. enabled"
275 if test x$add_pcap = "xyes" ; then
276 AS_ECHO " + pcap support............ enabled"
278 AS_ECHO " - pcap support............ disabled"
281 if test x$enable_experimental = "xyes" ; then
282 AS_ECHO " + Experimental features... enabled"
284 AS_ECHO " - Experimental features... disabled"
287 if test x$enable_profile = "xyes" ; then
288 AS_ECHO " + Profiling options....... enabled"
290 AS_ECHO " - Profiling options....... disabled"
293 if test x$enable_kernel_switch = "xyes" ; then
294 AS_ECHO " + Kernel switch........... enabled"
296 AS_ECHO " - Kernel switch........... disabled"
301 if ! test x$add_cryptcab_support = "xyes" ; then
302 if test x$warn_cryptcab = "xyes" ; then
303 AC_MSG_WARN([VDE CryptCab support has been disabled because libcrypto is
304 not installed on your system, or because openssl/blowfish.h could not be found.
305 Please install them if you want CryptCab to be compiled and installed.])
310 if ! test x$enable_python = "xyes" ; then
311 AC_MSG_WARN([Python libraries support has been disabled because python is
312 not installed on your system, or because it could not be found. Please install
313 it if you want Python libraries to be compiled and installed.])
317 if ! test x$add_pcap = "xyes" ; then
318 if test x$warn_pcap = "xyes" ; then
319 AC_MSG_WARN([VDE vde_pcapplug and packet dump plugin have been disabled
320 because libpcap is not installed on your system, or because it is too old.
321 Please install it if you want vde_pcapplug and pdump to be compiled and
328 AS_ECHO "Type 'make' to compile $PACKAGE $VERSION,"
329 AS_ECHO "or type 'make V=1' for verbose compiling"
330 AS_ECHO "and then type 'make install' to install it into $prefix"