Move manpages from man directory to next to their programs.
[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 AC_ARG_VAR(KARCH, [Kernel Architecture String])
51 AC_SUBST(KARCH)
52
53 CHECK_LINUX(l26, 2.6, 2.6, KSRC26, L26_ENABLED)
54 CHECK_LINUX(l24, 2.4, 2.4, KSRC24, L24_ENABLED)
55
56 AC_CHECK_HEADER([linux/netlink.h],
57                 [HAVE_NETLINK=yes],
58                 [HAVE_NETLINK=no],
59                 [#include <sys/socket.h>
60 #include <linux/types.h>])
61 AM_CONDITIONAL([HAVE_NETLINK], [test "$HAVE_NETLINK" = yes])
62 if test "$HAVE_NETLINK" = yes; then
63    AC_DEFINE([HAVE_NETLINK], [1],
64              [Define to 1 if Netlink protocol is available.])
65 fi
66
67 AC_CHECK_HEADER([net/if_packet.h],
68                 [HAVE_IF_PACKET=yes],
69                 [HAVE_IF_PACKET=no])
70 AM_CONDITIONAL([HAVE_IF_PACKET], [test "$HAVE_IF_PACKET" = yes])
71 if test "$HAVE_IF_PACKET" = yes; then
72    AC_DEFINE([HAVE_IF_PACKET], [1],
73              [Define to 1 if net/if_packet.h is available.])
74 fi
75
76 AC_ARG_ENABLE(
77   [ssl],
78   [AC_HELP_STRING([--enable-ssl], 
79                   [Enable ssl support (requires libssl)])],
80   [case "${enableval}" in # (
81      yes) ssl=true ;;  # (
82      no)  ssl=false ;; # (
83      *) AC_MSG_ERROR([bad value ${enableval} for --enable-ssl]) ;;
84    esac],
85   [ssl=false])
86
87 if test "$ssl" = true; then
88 dnl Make sure that pkg-config is installed.
89 m4_pattern_forbid([PKG_CHECK_MODULES])
90 PKG_CHECK_MODULES([SSL], [libssl], 
91   [HAVE_OPENSSL=yes],
92   [HAVE_OPENSSL=no
93    AC_MSG_WARN([Cannot find libssl:
94
95 $SSL_PKG_ERRORS
96
97 OpenFlow will not support SSL connections.])])
98
99 fi
100 AM_CONDITIONAL([HAVE_OPENSSL], [test "$HAVE_OPENSSL" = yes])
101 if test "$HAVE_OPENSSL" = yes; then
102    AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if OpenSSL is installed.])
103 fi
104
105 AC_CHECK_LIB([socket], [connect])
106 AC_CHECK_LIB([resolv], [gethostbyname])
107 AC_CHECK_LIB([dl], [dladdr])
108
109 CFLAGS="$CFLAGS -Wall -Wno-sign-compare"
110
111 AC_CONFIG_FILES([Makefile 
112 datapath/Makefile 
113 lib/Makefile
114 include/Makefile
115 controller/Makefile
116 utilities/Makefile
117 secchan/Makefile
118 switch/Makefile
119 tests/Makefile
120 datapath/tests/Makefile
121 third-party/Makefile
122 datapath/linux-2.6/Kbuild
123 datapath/linux-2.6/Makefile
124 datapath/linux-2.6/Makefile.main
125 datapath/linux-2.4/Kbuild
126 datapath/linux-2.4/Makefile
127 datapath/linux-2.4/Makefile.main])
128
129 AC_OUTPUT