Increase version to 0.2.0.
[sliver-openvswitch.git] / configure.ac
1 AC_PREREQ(2.59)
2 AC_INIT(openflow, v0.2.0, info@openflowswitch.org)
3 AM_INIT_AUTOMAKE
4
5 AC_PROG_CC
6 AC_PROG_CPP
7
8 AC_USE_SYSTEM_EXTENSIONS
9
10 AC_PROG_LIBTOOL
11
12 AC_ARG_ENABLE(
13   [ndebug],
14   [AC_HELP_STRING([--enable-ndebug], 
15                   [Disable debugging features for max performance])],
16   [case "${enableval}" in # (
17      yes) ndebug=true ;; # (
18      no)  ndebug=false ;; # (
19      *) AC_MSG_ERROR([bad value ${enableval} for --enable-ndebug]) ;;
20    esac],
21   [ndebug=false])
22 AM_CONDITIONAL([NDEBUG], [test x$ndebug = xtrue])
23
24 CHECK_LINUX(l26, 2.6, 2.6, KSRC26, L26_ENABLED)
25 CHECK_LINUX(l24, 2.4, 2.4, KSRC24, L24_ENABLED)
26
27 AC_CHECK_HEADER([linux/netlink.h],
28                 [HAVE_NETLINK=yes],
29                 [HAVE_NETLINK=no],
30                 [#include <sys/socket.h>])
31 AM_CONDITIONAL([HAVE_NETLINK], [test "$HAVE_NETLINK" = yes])
32 if test "$HAVE_NETLINK" = yes; then
33    AC_DEFINE([HAVE_NETLINK], [1],
34              [Define to 1 if Netlink protocol is available.])
35 fi
36
37 AC_CHECK_HEADER([net/if_packet.h],
38                 [HAVE_IF_PACKET=yes],
39                 [HAVE_IF_PACKET=no])
40 AM_CONDITIONAL([HAVE_IF_PACKET], [test "$HAVE_IF_PACKET" = yes])
41 if test "$HAVE_IF_PACKET" = yes; then
42    AC_DEFINE([HAVE_IF_PACKET], [1],
43              [Define to 1 if net/if_packet.h is available.])
44 fi
45
46 AC_ARG_ENABLE(
47   [ssl],
48   [AC_HELP_STRING([--enable-ssl], 
49                   [Enable ssl support (requires libssl)])],
50   [case "${enableval}" in # (
51      yes) ssl=true ;;  # (
52      no)  ssl=false ;; # (
53      *) AC_MSG_ERROR([bad value ${enableval} for --enable-ssl]) ;;
54    esac],
55   [ssl=false])
56
57 if test "$ssl" = true; then
58 PKG_CHECK_MODULES([SSL], [libssl], 
59   [HAVE_OPENSSL=yes],
60   [HAVE_OPENSSL=no
61    AC_MSG_WARN([Cannot find libssl:
62
63 $SSL_PKG_ERRORS
64
65 OpenFlow will not support SSL connections.])])
66
67 fi
68 AM_CONDITIONAL([HAVE_OPENSSL], [test "$HAVE_OPENSSL" = yes])
69 if test "$HAVE_OPENSSL" = yes; then
70    AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if OpenSSL is installed.])
71 fi
72
73 AC_CHECK_LIB([socket], [connect])
74 AC_CHECK_LIB([resolv], [gethostbyname])
75 AC_CHECK_LIB([dl], [dladdr])
76
77 CFLAGS="$CFLAGS -Wall -Wno-sign-compare"
78
79 AC_CONFIG_FILES([Makefile 
80 man/Makefile
81 man/man8/Makefile
82 datapath/Makefile 
83 lib/Makefile
84 include/Makefile
85 controller/Makefile
86 utilities/Makefile
87 secchan/Makefile
88 switch/Makefile
89 datapath/tests/Makefile
90 third-party/Makefile
91 datapath/linux-2.6/Makefile
92 datapath/linux-2.4/Makefile])
93
94 AC_OUTPUT