492c7bcfe076e5bdb535efe9924b6163c7976563
[openvswitch] / configure.ac
1 # Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at:
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 AC_PREREQ(2.64)
16 AC_INIT(openvswitch, 1.2.90, ovs-bugs@openvswitch.org)
17 NX_BUILDNR
18 AC_CONFIG_SRCDIR([datapath/datapath.c])
19 AC_CONFIG_MACRO_DIR([m4])
20 AC_CONFIG_AUX_DIR([build-aux])
21 AC_CONFIG_HEADERS([config.h])
22 AC_CONFIG_TESTDIR([tests])
23 AM_INIT_AUTOMAKE
24
25 AC_PROG_CC
26 AM_PROG_CC_C_O
27 AC_PROG_CPP
28 AC_PROG_RANLIB
29 AC_PROG_MKDIR_P
30 AC_PROG_FGREP
31
32 AC_ARG_VAR([PERL], [path to Perl interpreter])
33 AC_PATH_PROG([PERL], perl, no)
34 if test "$PERL" = no; then
35    AC_MSG_ERROR([Perl interpreter not found in $PATH or $PERL.])
36 fi
37
38 AC_USE_SYSTEM_EXTENSIONS
39 AC_C_BIGENDIAN
40 AC_SYS_LARGEFILE
41
42 AC_SEARCH_LIBS([pow], [m])
43 AC_SEARCH_LIBS([clock_gettime], [rt])
44
45 OVS_CHECK_COVERAGE
46 OVS_CHECK_NDEBUG
47 OVS_CHECK_NETLINK
48 OVS_CHECK_OPENSSL
49 OVS_CHECK_LOGDIR
50 OVS_CHECK_RTNL_LINK_STATS64
51 OVS_CHECK_PYTHON
52 OVS_CHECK_PYUIC4
53 OVS_CHECK_OVSDBMONITOR
54 OVS_CHECK_DOT
55 OVS_CHECK_IF_PACKET
56 OVS_CHECK_STRTOK_R
57 AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec, struct stat.st_mtimensec],
58   [], [], [[#include <sys/stat.h>]])
59 AC_CHECK_FUNCS([mlockall strnlen strsignal getloadavg statvfs setmntent])
60 AC_CHECK_HEADERS([mntent.h sys/statvfs.h])
61
62 OVS_CHECK_PKIDIR
63 OVS_CHECK_RUNDIR
64 OVS_CHECK_BACKTRACE
65 OVS_CHECK_MALLOC_HOOKS
66 OVS_CHECK_VALGRIND
67 OVS_CHECK_SOCKET_LIBS
68 OVS_CHECK_LINKER_SECTIONS
69 OVS_CHECK_XENSERVER_VERSION
70
71 OVS_ENABLE_OPTION([-Wall])
72 OVS_ENABLE_OPTION([-Wno-sign-compare])
73 OVS_ENABLE_OPTION([-Wpointer-arith])
74 OVS_ENABLE_OPTION([-Wdeclaration-after-statement])
75 OVS_ENABLE_OPTION([-Wformat-security])
76 OVS_ENABLE_OPTION([-Wswitch-enum])
77 OVS_ENABLE_OPTION([-Wunused-parameter])
78 OVS_ENABLE_OPTION([-Wstrict-aliasing])
79 OVS_ENABLE_OPTION([-Wbad-function-cast])
80 OVS_ENABLE_OPTION([-Wcast-align])
81 OVS_ENABLE_OPTION([-Wstrict-prototypes])
82 OVS_ENABLE_OPTION([-Wold-style-definition])
83 OVS_ENABLE_OPTION([-Wmissing-prototypes])
84 OVS_ENABLE_OPTION([-Wmissing-field-initializers])
85 OVS_ENABLE_OPTION([-Wno-override-init])
86 OVS_CONDITIONAL_CC_OPTION([-Wno-unused], [HAVE_WNO_UNUSED])
87 OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], [HAVE_WNO_UNUSED_PARAMETER])
88 OVS_ENABLE_WERROR
89 OVS_ENABLE_SPARSE
90
91 AC_ARG_VAR(KARCH, [Kernel Architecture String])
92 AC_SUBST(KARCH)
93 OVS_CHECK_LINUX
94
95 AC_CONFIG_FILES([Makefile 
96 datapath/Makefile 
97 datapath/linux/Kbuild
98 datapath/linux/Makefile
99 datapath/linux/Makefile.main
100 tests/atlocal])
101
102 dnl This makes sure that include/openflow gets created in the build directory.
103 AC_CONFIG_COMMANDS([include/openflow/openflow.h.stamp])
104
105 AC_CONFIG_COMMANDS([ovsdb/ovsdbmonitor/dummy], [:])
106 AC_CONFIG_COMMANDS([utilities/bugtool/dummy], [:])
107
108 AC_OUTPUT