2 AC_INIT(openflow, v0.8.1, info@openflowswitch.org)
3 AC_CONFIG_HEADERS([config.h])
10 AC_ARG_VAR([PERL], [path to Perl interpreter])
11 AC_PATH_PROG([PERL], perl, no)
12 if test "$PERL" = no; then
13 AC_MSG_ERROR([Perl interpreter not found in $PATH or $PERL.])
16 AC_USE_SYSTEM_EXTENSIONS
20 [AC_HELP_STRING([--enable-ndebug],
21 [Disable debugging features for max performance])],
22 [case "${enableval}" in # (
23 yes) ndebug=true ;; # (
24 no) ndebug=false ;; # (
25 *) AC_MSG_ERROR([bad value ${enableval} for --enable-ndebug]) ;;
28 AM_CONDITIONAL([NDEBUG], [test x$ndebug = xtrue])
32 [AC_HELP_STRING([--enable-hw-tables=MODULE...],
33 [Configure and build the specified externally supplied
34 hardware table support modules])])
35 case "${enable_hw_tables}" in # (
37 AC_MSG_ERROR([--enable-hw-tables has a required argument])
43 hw_tables=`echo "$enable_hw_tables" | sed 's/,/ /g'`
46 for d in $hw_tables; do
47 mk=datapath/hwtable_$d/Modules.mk
48 if test ! -e $srcdir/$mk; then
49 AC_MSG_ERROR([--enable-hw-tables=$d specified but $mk is missing])
51 HW_TABLES="$HW_TABLES \$(top_srcdir)/$mk"
55 AC_ARG_VAR(KARCH, [Kernel Architecture String])
58 CHECK_LINUX(l26, 2.6, 2.6, KSRC26, L26_ENABLED)
59 CHECK_LINUX(l24, 2.4, 2.4, KSRC24, L24_ENABLED)
61 AC_CHECK_HEADER([linux/netlink.h],
64 [#include <sys/socket.h>
65 #include <linux/types.h>])
66 AM_CONDITIONAL([HAVE_NETLINK], [test "$HAVE_NETLINK" = yes])
67 if test "$HAVE_NETLINK" = yes; then
68 AC_DEFINE([HAVE_NETLINK], [1],
69 [Define to 1 if Netlink protocol is available.])
72 AC_CHECK_HEADER([net/if_packet.h],
75 AM_CONDITIONAL([HAVE_IF_PACKET], [test "$HAVE_IF_PACKET" = yes])
76 if test "$HAVE_IF_PACKET" = yes; then
77 AC_DEFINE([HAVE_IF_PACKET], [1],
78 [Define to 1 if net/if_packet.h is available.])
83 [AC_HELP_STRING([--enable-ssl],
84 [Enable ssl support (requires libssl)])],
85 [case "${enableval}" in # (
88 *) AC_MSG_ERROR([bad value ${enableval} for --enable-ssl]) ;;
92 if test "$ssl" = true; then
93 dnl Make sure that pkg-config is installed.
94 m4_pattern_forbid([PKG_CHECK_MODULES])
95 PKG_CHECK_MODULES([SSL], [libssl],
98 AC_MSG_WARN([Cannot find libssl:
102 OpenFlow will not support SSL connections.])])
105 AM_CONDITIONAL([HAVE_OPENSSL], [test "$HAVE_OPENSSL" = yes])
106 if test "$HAVE_OPENSSL" = yes; then
107 AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if OpenSSL is installed.])
110 AC_CHECK_LIB([socket], [connect])
111 AC_SEARCH_LIBS([gethostbyname], [resolv], [RESOLVER_LIBS=-lresolv])
112 AC_CHECK_LIB([dl], [dladdr], [FAULT_LIBS=-ldl])
113 AC_SUBST([FAULT_LIBS])
115 CFLAGS="$CFLAGS -Wall -Wno-sign-compare"
117 AC_CONFIG_FILES([Makefile
126 datapath/tests/Makefile
128 datapath/linux-2.6/Kbuild
129 datapath/linux-2.6/Makefile
130 datapath/linux-2.6/Makefile.main
131 datapath/linux-2.4/Kbuild
132 datapath/linux-2.4/Makefile
133 datapath/linux-2.4/Makefile.main])