netdev-dpdk: fix mbuf leaks
[cascardo/ovs.git] / configure.ac
1 # Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
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, 2.5.90, bugs@openvswitch.org)
17 AC_CONFIG_SRCDIR([datapath/datapath.c])
18 AC_CONFIG_MACRO_DIR([m4])
19 AC_CONFIG_AUX_DIR([build-aux])
20 AC_CONFIG_HEADERS([config.h])
21 AC_CONFIG_TESTDIR([tests])
22 AM_INIT_AUTOMAKE([tar-pax])
23
24 AC_PROG_CC_C99
25 AM_PROG_CC_C_O
26 AC_PROG_CPP
27 AC_PROG_MKDIR_P
28 AC_PROG_FGREP
29 AC_PROG_EGREP
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 AM_MISSING_PROG([AUTOM4TE], [autom4te])
38
39 AC_USE_SYSTEM_EXTENSIONS
40 AC_C_BIGENDIAN
41 AC_SYS_LARGEFILE
42
43 LT_INIT([disable-shared])
44 m4_pattern_forbid([LT_INIT]) dnl Make autoconf fail if libtool is missing.
45
46 # The following explanation may help to understand the use of the
47 # version number fields: current, revision, and age.
48 #
49 # Consider that there are three possible kinds of reactions from
50 # users of your library to changes in a shared library:
51 #
52 # 1. Programs using the previous version may use the new version as drop-in
53 #    replacement, and programs using the new version can also work with the
54 #    previous one. In other words, no recompiling nor relinking is needed.
55 #    In short, there are no changes to any symbols, no symbols removed,
56 #    and no symbols added. In this case, bump revision only, don't touch
57 #    current nor age.
58 #
59 # 2. Programs using the previous version may use the new version as drop-in
60 #    replacement, but programs using the new version may use APIs not
61 #    present in the previous one. In other words, new symbols have been
62 #    added and a program linking against the new version may fail with
63 #    "unresolved symbols." If linking against the old version at runtime:
64 #    set revision to 0, bump current and age.
65 #
66 # 3. Programs may need to be changed, recompiled, relinked in order to use
67 #    the new version. This is the case when symbols have been modified or
68 #    deleted. Bump current, set revision and age to 0.
69
70 m4_define([libopenvswitch_lt_current],    [1])
71 m4_define([libopenvswitch_lt_revision],   [0])
72 m4_define([libopenvswitch_lt_age],        [0])
73
74 LT_CURRENT=libopenvswitch_lt_current
75 AC_SUBST([LT_CURRENT])
76 LT_REVISION=libopenvswitch_lt_revision
77 AC_SUBST([LT_REVISION])
78 LT_AGE=libopenvswitch_lt_age
79 AC_SUBST([LT_AGE])
80
81 AC_SEARCH_LIBS([pow], [m])
82 AC_SEARCH_LIBS([clock_gettime], [rt])
83 AC_SEARCH_LIBS([timer_create], [rt])
84 AC_SEARCH_LIBS([pthread_create], [pthread])
85 AC_FUNC_STRERROR_R
86
87 OVS_CHECK_ESX
88 OVS_CHECK_WIN64
89 OVS_CHECK_WIN32
90 OVS_CHECK_VISUAL_STUDIO_DDK
91 OVS_CHECK_COVERAGE
92 OVS_CHECK_NDEBUG
93 OVS_CHECK_NETLINK
94 OVS_CHECK_OPENSSL
95 OVS_CHECK_LIBCAPNG
96 OVS_CHECK_LOGDIR
97 OVS_CHECK_PYTHON
98 OVS_CHECK_PYTHON3
99 OVS_CHECK_FLAKE8
100 OVS_CHECK_DOT
101 OVS_CHECK_IF_PACKET
102 OVS_CHECK_IF_DL
103 OVS_CHECK_STRTOK_R
104 AC_CHECK_DECLS([sys_siglist], [], [], [[#include <signal.h>]])
105 AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec, struct stat.st_mtimensec],
106   [], [], [[#include <sys/stat.h>]])
107 AC_CHECK_MEMBERS([struct ifreq.ifr_flagshigh], [], [], [[#include <net/if.h>]])
108 AC_CHECK_FUNCS([mlockall strnlen getloadavg statvfs getmntent_r])
109 AC_CHECK_HEADERS([mntent.h sys/statvfs.h linux/types.h linux/if_ether.h stdatomic.h])
110 AC_CHECK_HEADERS([net/if_mib.h], [], [], [[#include <sys/types.h>
111 #include <net/if.h>]])
112
113 OVS_CHECK_PKIDIR
114 OVS_CHECK_RUNDIR
115 OVS_CHECK_DBDIR
116 OVS_CHECK_BACKTRACE
117 OVS_CHECK_PERF_EVENT
118 OVS_CHECK_VALGRIND
119 OVS_CHECK_SOCKET_LIBS
120 OVS_CHECK_XENSERVER_VERSION
121 OVS_CHECK_GROFF
122 OVS_CHECK_GNU_MAKE
123 OVS_CHECK_TLS
124 OVS_CHECK_ATOMIC_LIBS
125 OVS_CHECK_GCC4_ATOMICS
126 OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(1)
127 OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(2)
128 OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(4)
129 OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(8)
130 OVS_CHECK_POSIX_AIO
131 OVS_CHECK_PTHREAD_SET_NAME
132 OVS_CHECK_LINUX_HOST
133 AX_FUNC_POSIX_MEMALIGN
134
135 OVS_CHECK_INCLUDE_NEXT([stdio.h string.h])
136 AC_CONFIG_FILES([
137     lib/stdio.h
138     lib/string.h
139     ovsdb/libovsdb.sym
140     ofproto/libofproto.sym
141     lib/libsflow.sym
142     lib/libopenvswitch.sym
143     ovn/lib/libovn.sym
144     vtep/libvtep.sym])
145
146 OVS_ENABLE_OPTION([-Wall])
147 OVS_ENABLE_OPTION([-Wextra])
148 OVS_ENABLE_OPTION([-Wno-sign-compare])
149 OVS_ENABLE_OPTION([-Wpointer-arith])
150 OVS_ENABLE_OPTION([-Wformat-security])
151 OVS_ENABLE_OPTION([-Wswitch-enum])
152 OVS_ENABLE_OPTION([-Wunused-parameter])
153 OVS_ENABLE_OPTION([-Wbad-function-cast])
154 OVS_ENABLE_OPTION([-Wcast-align])
155 OVS_ENABLE_OPTION([-Wstrict-prototypes])
156 OVS_ENABLE_OPTION([-Wold-style-definition])
157 OVS_ENABLE_OPTION([-Wmissing-prototypes])
158 OVS_ENABLE_OPTION([-Wmissing-field-initializers])
159 OVS_ENABLE_OPTION([-Wthread-safety])
160 OVS_ENABLE_OPTION([-fno-strict-aliasing])
161 OVS_ENABLE_OPTION([-Qunused-arguments])
162 OVS_CONDITIONAL_CC_OPTION([-Wno-unused], [HAVE_WNO_UNUSED])
163 OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], [HAVE_WNO_UNUSED_PARAMETER])
164 OVS_ENABLE_WERROR
165 OVS_ENABLE_SPARSE
166
167 AC_ARG_VAR(KARCH, [Kernel Architecture String])
168 AC_SUBST(KARCH)
169 OVS_CHECK_LINUX
170 OVS_CHECK_DPDK
171 OVS_CHECK_PRAGMA_MESSAGE
172 AC_SUBST([OVS_CFLAGS])
173 AC_SUBST([OVS_LDFLAGS])
174
175 AC_CONFIG_FILES(Makefile)
176 AC_CONFIG_FILES(datapath/Makefile)
177 AC_CONFIG_FILES(datapath/linux/Kbuild)
178 AC_CONFIG_FILES(datapath/linux/Makefile)
179 AC_CONFIG_FILES(datapath/linux/Makefile.main)
180 AC_CONFIG_FILES(tests/atlocal)
181 AC_CONFIG_FILES(lib/libopenvswitch.pc)
182 AC_CONFIG_FILES(lib/libsflow.pc)
183 AC_CONFIG_FILES(ofproto/libofproto.pc)
184 AC_CONFIG_FILES(ovsdb/libovsdb.pc)
185 AC_CONFIG_FILES(include/openvswitch/version.h)
186
187 dnl This makes sure that include/openflow gets created in the build directory.
188 AC_CONFIG_COMMANDS([include/openflow/openflow.h.stamp])
189
190 AC_CONFIG_COMMANDS([utilities/bugtool/dummy], [:])
191 AC_CONFIG_COMMANDS([ovn/dummy], [:])
192 AC_CONFIG_COMMANDS([ovn/utilities/dummy], [:])
193
194 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
195
196 AC_OUTPUT