Merge branch 'master' of nicira.dyndns.org:/srv/git/openflow
[sliver-openvswitch.git] / configure.ac
1 AC_PREREQ(2.59)
2 AC_INIT(openflow, v0.1.9, 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 PKG_CHECK_MODULES([SSL], [libssl], 
38   [HAVE_OPENSSL=yes],
39   [HAVE_OPENSSL=no
40    AC_MSG_WARN([Cannot find libssl:
41
42 $SSL_PKG_ERRORS
43
44 OpenFlow will not support SSL connections.])])
45 AM_CONDITIONAL([HAVE_OPENSSL], [test "$HAVE_OPENSSL" = yes])
46 if test "$HAVE_OPENSSL" = yes; then
47    AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if OpenSSL is installed.])
48 fi
49
50 AC_CHECK_LIB([socket], [connect])
51 AC_CHECK_LIB([resolv], [gethostbyname])
52 AC_CHECK_LIB([dl], [dladdr])
53
54 CFLAGS="$CFLAGS -Wall -Wno-sign-compare"
55
56 AC_CONFIG_FILES([Makefile 
57 man/Makefile
58 man/man8/Makefile
59 datapath/Makefile 
60 lib/Makefile
61 include/Makefile
62 controller/Makefile
63 utilities/Makefile
64 secchan/Makefile
65 datapath/tests/Makefile
66 third-party/Makefile
67 datapath/linux-2.6/Makefile
68 datapath/linux-2.4/Makefile])
69
70 AC_OUTPUT