2 AC_INIT(openflow, v0.8.1, info@openflowswitch.org)
9 AC_ARG_VAR([PERL], [path to Perl interpreter])
10 AC_PATH_PROG([PERL], perl, no)
11 if test "$PERL" = no; then
12 AC_MSG_ERROR([Perl interpreter not found in $PATH or $PERL.])
15 AC_USE_SYSTEM_EXTENSIONS
21 [AC_HELP_STRING([--enable-ndebug],
22 [Disable debugging features for max performance])],
23 [case "${enableval}" in # (
24 yes) ndebug=true ;; # (
25 no) ndebug=false ;; # (
26 *) AC_MSG_ERROR([bad value ${enableval} for --enable-ndebug]) ;;
29 AM_CONDITIONAL([NDEBUG], [test x$ndebug = xtrue])
33 [AC_HELP_STRING([--enable-hw-tables=MODULE...],
34 [Configure and build the specified externally supplied
35 hardware table support modules])])
36 case "${enable_hw_tables}" in # (
38 AC_MSG_ERROR([--enable-hw-tables has a required argument])
44 hw_tables=`echo "$enable_hw_tables" | sed 's/,/ /g'`
47 for d in $hw_tables; do
48 mk=datapath/hwtable_$d/Modules.mk
49 if test ! -e $srcdir/$mk; then
50 AC_MSG_ERROR([--enable-hw-tables=$d specified but $mk is missing])
52 HW_TABLES="$HW_TABLES \$(top_srcdir)/$mk"
56 AC_ARG_VAR(KARCH, [Kernel Architecture String])
59 CHECK_LINUX(l26, 2.6, 2.6, KSRC26, L26_ENABLED)
60 CHECK_LINUX(l24, 2.4, 2.4, KSRC24, L24_ENABLED)
62 AC_CHECK_HEADER([linux/netlink.h],
65 [#include <sys/socket.h>
66 #include <linux/types.h>])
67 AM_CONDITIONAL([HAVE_NETLINK], [test "$HAVE_NETLINK" = yes])
68 if test "$HAVE_NETLINK" = yes; then
69 AC_DEFINE([HAVE_NETLINK], [1],
70 [Define to 1 if Netlink protocol is available.])
73 AC_CHECK_HEADER([net/if_packet.h],
76 AM_CONDITIONAL([HAVE_IF_PACKET], [test "$HAVE_IF_PACKET" = yes])
77 if test "$HAVE_IF_PACKET" = yes; then
78 AC_DEFINE([HAVE_IF_PACKET], [1],
79 [Define to 1 if net/if_packet.h is available.])
84 [AC_HELP_STRING([--enable-ssl],
85 [Enable ssl support (requires libssl)])],
86 [case "${enableval}" in # (
89 *) AC_MSG_ERROR([bad value ${enableval} for --enable-ssl]) ;;
93 if test "$ssl" = true; then
94 dnl Make sure that pkg-config is installed.
95 m4_pattern_forbid([PKG_CHECK_MODULES])
96 PKG_CHECK_MODULES([SSL], [libssl],
99 AC_MSG_WARN([Cannot find libssl:
103 OpenFlow will not support SSL connections.])])
106 AM_CONDITIONAL([HAVE_OPENSSL], [test "$HAVE_OPENSSL" = yes])
107 if test "$HAVE_OPENSSL" = yes; then
108 AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if OpenSSL is installed.])
111 AC_CHECK_LIB([socket], [connect])
112 AC_CHECK_LIB([resolv], [gethostbyname])
113 AC_CHECK_LIB([dl], [dladdr])
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])