Add-on hardware tables initial implementation.
[sliver-openvswitch.git] / configure.ac
1 AC_PREREQ(2.59)
2 AC_INIT(openflow, v0.8.1, info@openflowswitch.org)
3 AM_INIT_AUTOMAKE
4
5 AC_PROG_CC
6 AC_PROG_CPP
7 AC_PROG_LD
8
9 AC_USE_SYSTEM_EXTENSIONS
10
11 AC_PROG_LIBTOOL
12
13 AC_ARG_ENABLE(
14   [ndebug],
15   [AC_HELP_STRING([--enable-ndebug], 
16                   [Disable debugging features for max performance])],
17   [case "${enableval}" in # (
18      yes) ndebug=true ;; # (
19      no)  ndebug=false ;; # (
20      *) AC_MSG_ERROR([bad value ${enableval} for --enable-ndebug]) ;;
21    esac],
22   [ndebug=false])
23 AM_CONDITIONAL([NDEBUG], [test x$ndebug = xtrue])
24
25 AC_ARG_ENABLE(
26   [hw-tables],
27   [AC_HELP_STRING([--enable-hw-tables=MODULE...],
28                   [Configure and build the specified externally supplied 
29                    hardware table support modules])])
30 case "${enable_hw_tables}" in # (
31   yes) 
32     AC_MSG_ERROR([--enable-hw-tables has a required argument])
33     ;; # (
34   ''|no) 
35     hw_tables=
36     ;; # (
37   *) 
38     hw_tables=`echo "$enable_hw_tables" | sed 's/,/ /g'`
39     ;;
40 esac
41 for d in $hw_tables; do
42     mk=datapath/hwtable-$d/Modules.mk
43     if test ! -e $srcdir/$mk; then
44        AC_MSG_ERROR([--enable-hw-tables=$d specified but $mk is missing])
45     fi
46     HW_TABLES="$HW_TABLES \$(top_srcdir)/$mk"
47 done
48 AC_SUBST(HW_TABLES)
49
50 CHECK_LINUX(l26, 2.6, 2.6, KSRC26, L26_ENABLED)
51 CHECK_LINUX(l24, 2.4, 2.4, KSRC24, L24_ENABLED)
52
53 AC_CHECK_HEADER([linux/netlink.h],
54                 [HAVE_NETLINK=yes],
55                 [HAVE_NETLINK=no],
56                 [#include <sys/socket.h>
57 #include <linux/types.h>])
58 AM_CONDITIONAL([HAVE_NETLINK], [test "$HAVE_NETLINK" = yes])
59 if test "$HAVE_NETLINK" = yes; then
60    AC_DEFINE([HAVE_NETLINK], [1],
61              [Define to 1 if Netlink protocol is available.])
62 fi
63
64 AC_CHECK_HEADER([net/if_packet.h],
65                 [HAVE_IF_PACKET=yes],
66                 [HAVE_IF_PACKET=no])
67 AM_CONDITIONAL([HAVE_IF_PACKET], [test "$HAVE_IF_PACKET" = yes])
68 if test "$HAVE_IF_PACKET" = yes; then
69    AC_DEFINE([HAVE_IF_PACKET], [1],
70              [Define to 1 if net/if_packet.h is available.])
71 fi
72
73 AC_ARG_ENABLE(
74   [ssl],
75   [AC_HELP_STRING([--enable-ssl], 
76                   [Enable ssl support (requires libssl)])],
77   [case "${enableval}" in # (
78      yes) ssl=true ;;  # (
79      no)  ssl=false ;; # (
80      *) AC_MSG_ERROR([bad value ${enableval} for --enable-ssl]) ;;
81    esac],
82   [ssl=false])
83
84 if test "$ssl" = true; then
85 PKG_CHECK_MODULES([SSL], [libssl], 
86   [HAVE_OPENSSL=yes],
87   [HAVE_OPENSSL=no
88    AC_MSG_WARN([Cannot find libssl:
89
90 $SSL_PKG_ERRORS
91
92 OpenFlow will not support SSL connections.])])
93
94 fi
95 AM_CONDITIONAL([HAVE_OPENSSL], [test "$HAVE_OPENSSL" = yes])
96 if test "$HAVE_OPENSSL" = yes; then
97    AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if OpenSSL is installed.])
98 fi
99
100 AC_CHECK_LIB([socket], [connect])
101 AC_CHECK_LIB([resolv], [gethostbyname])
102 AC_CHECK_LIB([dl], [dladdr])
103
104 CFLAGS="$CFLAGS -Wall -Wno-sign-compare"
105
106 AC_CONFIG_FILES([Makefile 
107 man/Makefile
108 man/man8/Makefile
109 datapath/Makefile 
110 lib/Makefile
111 include/Makefile
112 controller/Makefile
113 utilities/Makefile
114 secchan/Makefile
115 switch/Makefile
116 tests/Makefile
117 datapath/tests/Makefile
118 third-party/Makefile
119 datapath/linux-2.6/Kbuild
120 datapath/linux-2.6/Makefile
121 datapath/linux-2.6/Makefile.main
122 datapath/linux-2.4/Makefile])
123
124 AC_OUTPUT