1 # Copyright (c) 2008 The Board of Trustees of The Leland Stanford
4 # We are making the OpenFlow specification and associated documentation
5 # (Software) available for public use and benefit with the expectation
6 # that others will use, modify and enhance the Software and contribute
7 # those enhancements back to the community. However, since we would
8 # like to make the Software available for broadest use, with as few
9 # restrictions as possible permission is hereby granted, free of
10 # charge, to any person obtaining a copy of this Software to deal in
11 # the Software under the copyrights without restriction, including
12 # without limitation the rights to use, copy, modify, merge, publish,
13 # distribute, sublicense, and/or sell copies of the Software, and to
14 # permit persons to whom the Software is furnished to do so, subject to
15 # the following conditions:
17 # The above copyright notice and this permission notice shall be
18 # included in all copies or substantial portions of the Software.
20 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
24 # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
25 # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29 # The name and trademarks of copyright holder(s) may NOT be used in
30 # advertising or publicity pertaining to the Software or any
31 # derivatives without specific, written prior permission.
34 AC_INIT(openflow, v0.8.1, info@openflowswitch.org)
35 AC_CONFIG_HEADERS([config.h])
42 AC_ARG_VAR([PERL], [path to Perl interpreter])
43 AC_PATH_PROG([PERL], perl, no)
44 if test "$PERL" = no; then
45 AC_MSG_ERROR([Perl interpreter not found in $PATH or $PERL.])
48 AC_USE_SYSTEM_EXTENSIONS
52 [AC_HELP_STRING([--enable-ndebug],
53 [Disable debugging features for max performance])],
54 [case "${enableval}" in # (
55 yes) ndebug=true ;; # (
56 no) ndebug=false ;; # (
57 *) AC_MSG_ERROR([bad value ${enableval} for --enable-ndebug]) ;;
60 AM_CONDITIONAL([NDEBUG], [test x$ndebug = xtrue])
64 [AC_HELP_STRING([--enable-hw-tables=MODULE...],
65 [Configure and build the specified externally supplied
66 hardware table support modules])])
67 case "${enable_hw_tables}" in # (
69 AC_MSG_ERROR([--enable-hw-tables has a required argument])
75 hw_tables=`echo "$enable_hw_tables" | sed 's/,/ /g'`
78 for d in $hw_tables; do
79 mk=datapath/hwtable_$d/Modules.mk
80 if test ! -e $srcdir/$mk; then
81 AC_MSG_ERROR([--enable-hw-tables=$d specified but $mk is missing])
83 HW_TABLES="$HW_TABLES \$(top_srcdir)/$mk"
87 AC_ARG_VAR(KARCH, [Kernel Architecture String])
90 CHECK_LINUX(l26, 2.6, 2.6, KSRC26, L26_ENABLED)
91 CHECK_LINUX(l24, 2.4, 2.4, KSRC24, L24_ENABLED)
93 AC_CHECK_HEADER([linux/netlink.h],
96 [#include <sys/socket.h>
97 #include <linux/types.h>])
98 AM_CONDITIONAL([HAVE_NETLINK], [test "$HAVE_NETLINK" = yes])
99 if test "$HAVE_NETLINK" = yes; then
100 AC_DEFINE([HAVE_NETLINK], [1],
101 [Define to 1 if Netlink protocol is available.])
104 AC_CHECK_HEADER([net/if_packet.h],
105 [HAVE_IF_PACKET=yes],
107 AM_CONDITIONAL([HAVE_IF_PACKET], [test "$HAVE_IF_PACKET" = yes])
108 if test "$HAVE_IF_PACKET" = yes; then
109 AC_DEFINE([HAVE_IF_PACKET], [1],
110 [Define to 1 if net/if_packet.h is available.])
115 [AC_HELP_STRING([--enable-ssl],
116 [Enable ssl support (requires libssl)])],
117 [case "${enableval}" in # (
120 *) AC_MSG_ERROR([bad value ${enableval} for --enable-ssl]) ;;
124 if test "$ssl" = true; then
125 dnl Make sure that pkg-config is installed.
126 m4_pattern_forbid([PKG_CHECK_MODULES])
127 PKG_CHECK_MODULES([SSL], [libssl],
130 AC_MSG_WARN([Cannot find libssl:
134 OpenFlow will not support SSL connections.])])
137 AM_CONDITIONAL([HAVE_OPENSSL], [test "$HAVE_OPENSSL" = yes])
138 if test "$HAVE_OPENSSL" = yes; then
139 AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if OpenSSL is installed.])
142 AC_CHECK_LIB([socket], [connect])
143 AC_SEARCH_LIBS([gethostbyname], [resolv], [RESOLVER_LIBS=-lresolv])
144 AC_CHECK_LIB([dl], [dladdr], [FAULT_LIBS=-ldl])
145 AC_SUBST([FAULT_LIBS])
147 CFLAGS="$CFLAGS -Wall -Wno-sign-compare"
149 AC_CONFIG_FILES([Makefile
158 datapath/tests/Makefile
160 datapath/linux-2.6/Kbuild
161 datapath/linux-2.6/Makefile
162 datapath/linux-2.6/Makefile.main
163 datapath/linux-2.4/Kbuild
164 datapath/linux-2.4/Makefile
165 datapath/linux-2.4/Makefile.main])