vdeq cleanup. unused sockets were left in /tmp.
[vde.git] / vde-2 / configure.ac
blobb3989261f9aba24f646cae078450e0e6bb7786b2
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.59)
5 AC_INIT(vde, [2.0.2], renzo@cs.unibo.it)
6 AM_INIT_AUTOMAKE
7 AC_CONFIG_SRCDIR([vde.h])
8 AC_CONFIG_HEADER([config.h])
10 # Checks for programs.
11 AC_PROG_CXX
12 AC_PROG_CC
13 AC_PROG_INSTALL
14 AC_PROG_LN_S
15 AC_PROG_LIBTOOL
17 # Checks for libraries.
18 AC_CHECK_LIB([dl], [dlopen])
20 # Checks for header files.
21 AC_HEADER_STDC
22 AC_HEADER_SYS_WAIT
23 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])
25 # Checks for typedefs, structures, and compiler characteristics.
26 AC_C_CONST
27 AC_C_INLINE
28 AC_C_BIGENDIAN
29 AC_C_PROTOTYPES
30 AC_TYPE_MODE_T
31 AC_TYPE_PID_T
32 AC_TYPE_SIZE_T
33 AC_HEADER_TIME
35 # Checks for library functions.
36 AC_FUNC_CHOWN
37 AC_FUNC_FORK
38 AC_PROG_GCC_TRADITIONAL
39 AC_FUNC_MALLOC
40 AC_FUNC_MEMCMP
41 AC_FUNC_REALLOC
42 AC_FUNC_SELECT_ARGTYPES
43 AC_TYPE_SIGNAL
44 AC_FUNC_VPRINTF
45 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])
47 # All other nice checks I have to make for recostructing missing parts of
48 # slirp's config.h file
49 AC_CHECK_SIZEOF(char)
50 AC_CHECK_SIZEOF(short)
51 AC_CHECK_SIZEOF(int)
52 AC_CHECK_SIZEOF(char *)
54 # Define VDE_LINUX or VDE_DARWIN
55 case "$build_os" in
56         linux*)
57                 AC_DEFINE([VDE_LINUX], 1, [If defined, this is a Linux system])
58                 ;;
59         darwin*)
60                 AC_DEFINE([VDE_DARWIN], 1, [If defined, this is a Darwin system])
61                 ;;
62         *)
63                 AC_MSG_ERROR([Unsupported architecture: $build_os. At the moment, only
64 Linux and Darwin are supported. Contributions are appreciated! :-)])
65                 ;;
66 esac
68 # Check of tuntap device
69 AC_ARG_ENABLE([tuntap],
70     AS_HELP_STRING([--disable-tuntap],
71       [Disable tuntap compilation]),
72     [if test $enableval != "no" ; then add_tuntap_support=yes ; else add_tuntap_support=no ; fi],
73     [add_tuntap_support=yes])
75 # Check for tuntap support for Linux and OSX
76 if test "$add_tuntap_support" = yes ; then
77         case "$build_os" in
78                 linux*)
79                         AC_CHECK_HEADER([linux/if_tun.h],
80                                 [AC_DEFINE([TUNTAP], 1, [If defined, tuntap support is compiled in])],
81                                 [AC_MSG_ERROR([Tuntap support seem to be not enabled on your kernel])])
82                         can_make_libvdetap=yes
83                         ;;
84                 darwin*)
85                         # I don't use AC_CHECK_FILES because I need test -e and not test -r
86                         for i in /dev/tap0 /Library/Extensions/tap.kext /System/Library/Extensions/tap.kext ; do
87                                 AC_MSG_CHECKING([for $i])
88                                 if test -e "$i" ; then
89                                         AC_MSG_RESULT([yes])
90                                         definename="`echo "$i" | tr "a-z*" "A-ZP" | tr -c "0-9A-Z" "_"`"
91                                         AC_DEFINE_UNQUOTED([HAVE_$definename])
92                                         eval HAVE_$definename=yes
93                                 else
94                                         AC_MSG_RESULT([no])
95                                 fi
96                         done
97                         
98                         if test "$HAVE__DEV_TAP0_" ; then
99                                 AC_DEFINE([TUNTAP], 1, [If defined, tuntap support is compiled in])
100                                 if ! test "$HAVE__LIBRARY_EXTENSIONS_TAP_KEXT_" -o "$HAVE__SYSTEM_LIBRARY_EXTENSIONS_TAP_KEXT_" ; then
101                                         AC_MSG_WARN([/dev/tap0 exists, but the kext cannot be found. Let's hope your
102 configuration does work...])
103                                 fi
104                                 AC_MSG_CHECKING([for broken poll() support in Tiger])
105                                 if expr "$build_os" : "darwin8\..*" > /dev/null; then
106                                         AC_MSG_RESULT([yes, emulating with select()])
107                                         AC_DEFINE([HAVE_BROKEN_POLL], 1, [If defined, use poll2select])
108                                         have_broken_poll=yes
109                                 else
110                                         AC_MSG_RESULT([no])
111                                 fi
112                         else
113                                 AC_MSG_ERROR([You do not have tuntap support. You can get it here:
114 http://www-user.rhrk.uni-kl.de/~nissler/tuntap/])
115                         fi
116                         ;;
117         esac
120 AM_CONDITIONAL(WANT_TUNTAP, test "$add_tuntap_support" = yes)
121 AM_CONDITIONAL(CAN_MAKE_LIBVDETAP, test "$can_make_libvdetap" = yes)
122 AM_CONDITIONAL(HAVE_BROKEN_POLL, test "$have_broken_poll" = yes)
124 AC_CONFIG_FILES([Makefile]
125                 [doc/Makefile]
126                 [qemu/Makefile]
127                 [slirpvde/Makefile]
128                 [vdetaplib/Makefile]
129                 [bochs/Makefile]
130                 [uml/Makefile])
131 AC_OUTPUT