Add support for code coverage analysis with gcov and lcov.
[sliver-openvswitch.git] / configure.ac
1 # Copyright (c) 2008, 2009 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.63)
16 AC_INIT(openvswitch, 0.90.3, 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
31 AC_ARG_VAR([PERL], [path to Perl interpreter])
32 AC_PATH_PROG([PERL], perl, no)
33 if test "$PERL" = no; then
34    AC_MSG_ERROR([Perl interpreter not found in $PATH or $PERL.])
35 fi
36
37 AC_USE_SYSTEM_EXTENSIONS
38 AC_C_BIGENDIAN
39 AC_SYS_LARGEFILE
40
41 OVS_CHECK_USERSPACE
42 OVS_CHECK_COVERAGE
43 OVS_CHECK_NDEBUG
44 OVS_CHECK_NETLINK
45 OVS_CHECK_OPENSSL
46 OVS_CHECK_LOGDIR
47 OVS_CHECK_CURSES
48 OVS_CHECK_LINUX_VT_H
49 OVS_CHECK_PCRE
50 OVS_CHECK_IF_PACKET
51 OVS_CHECK_STRTOK_R
52
53 if $build_userspace; then
54     OVS_CHECK_PKIDIR
55     OVS_CHECK_RUNDIR
56     OVS_CHECK_MALLOC_HOOKS
57     OVS_CHECK_VALGRIND
58     OVS_CHECK_TTY_LOCK_DIR
59     OVS_CHECK_SOCKET_LIBS
60     OVS_CHECK_FAULT_LIBS
61
62     AC_CHECK_FUNCS([strsignal])
63
64     OVS_ENABLE_OPTION([-Wall])
65     OVS_ENABLE_OPTION([-Wno-sign-compare])
66     OVS_ENABLE_OPTION([-Wpointer-arith])
67     OVS_ENABLE_OPTION([-Wdeclaration-after-statement])
68     OVS_ENABLE_OPTION([-Wformat-security])
69     OVS_ENABLE_OPTION([-Wswitch-enum])
70     OVS_ENABLE_OPTION([-Wunused-parameter])
71     OVS_ENABLE_OPTION([-Wstrict-aliasing])
72     OVS_ENABLE_OPTION([-Wbad-function-cast])
73     OVS_ENABLE_OPTION([-Wcast-align])
74     OVS_ENABLE_OPTION([-Wstrict-prototypes])
75     OVS_ENABLE_OPTION([-Wold-style-definition])
76     OVS_ENABLE_OPTION([-Wmissing-prototypes])
77     OVS_ENABLE_OPTION([-Wmissing-field-initializers])
78     OVS_ENABLE_OPTION([-Wno-override-init])
79 fi
80
81 AC_ARG_VAR(KARCH, [Kernel Architecture String])
82 AC_SUBST(KARCH)
83 OVS_CHECK_LINUX(l26, 2.6, KSRC26, L26_ENABLED)
84
85 AC_CONFIG_FILES([Makefile 
86 datapath/Makefile 
87 datapath/linux-2.6/Kbuild
88 datapath/linux-2.6/Makefile
89 datapath/linux-2.6/Makefile.main
90 tests/atlocal])
91
92 AC_OUTPUT