1 # Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Nicira, Inc.
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:
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 AC_INIT(openvswitch, 2.8.0, 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])
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.])
38 AM_MISSING_PROG([AUTOM4TE], [autom4te])
40 AC_USE_SYSTEM_EXTENSIONS
44 LT_INIT([disable-shared])
45 m4_pattern_forbid([LT_INIT]) dnl Make autoconf fail if libtool is missing.
47 # The following explanation may help to understand the use of the
48 # version number fields: current, revision, and age.
50 # Consider that there are three possible kinds of reactions from
51 # users of your library to changes in a shared library:
53 # 1. Programs using the previous version may use the new version as drop-in
54 # replacement, and programs using the new version can also work with the
55 # previous one. In other words, no recompiling nor relinking is needed.
56 # In short, there are no changes to any symbols, no symbols removed,
57 # and no symbols added. In this case, bump revision only, don't touch
60 # 2. Programs using the previous version may use the new version as drop-in
61 # replacement, but programs using the new version may use APIs not
62 # present in the previous one. In other words, new symbols have been
63 # added and a program linking against the new version may fail with
64 # "unresolved symbols." If linking against the old version at runtime:
65 # set revision to 0, bump current and age.
67 # 3. Programs may need to be changed, recompiled, relinked in order to use
68 # the new version. This is the case when symbols have been modified or
69 # deleted. Bump current, set revision and age to 0.
71 m4_define([libopenvswitch_lt_current], [0])
72 m4_define([libopenvswitch_lt_revision], [0])
73 m4_define([libopenvswitch_lt_age], [0])
75 LT_CURRENT=libopenvswitch_lt_current
76 AC_SUBST([LT_CURRENT])
77 LT_REVISION=libopenvswitch_lt_revision
78 AC_SUBST([LT_REVISION])
79 LT_AGE=libopenvswitch_lt_age
82 AC_SEARCH_LIBS([pow], [m])
83 AC_SEARCH_LIBS([clock_gettime], [rt])
84 AC_SEARCH_LIBS([timer_create], [rt])
85 AC_SEARCH_LIBS([pthread_create], [pthread])
91 OVS_CHECK_VISUAL_STUDIO_DDK
106 AC_CHECK_DECLS([sys_siglist], [], [], [[#include <signal.h>]])
107 AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec, struct stat.st_mtimensec],
108 [], [], [[#include <sys/stat.h>]])
109 AC_CHECK_MEMBERS([struct ifreq.ifr_flagshigh], [], [], [[#include <net/if.h>]])
110 AC_CHECK_MEMBERS([struct mmsghdr.msg_len], [], [], [[#include <sys/socket.h>]])
111 AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], [], [],
112 [[#include <sys/socket.h>
113 #include <netinet/in.h>]])
114 AC_CHECK_FUNCS([mlockall strnlen getloadavg statvfs getmntent_r sendmmsg])
115 AC_CHECK_HEADERS([mntent.h sys/statvfs.h linux/types.h linux/if_ether.h stdatomic.h])
116 AC_CHECK_HEADERS([net/if_mib.h], [], [], [[#include <sys/types.h>
117 #include <net/if.h>]])
125 OVS_CHECK_SOCKET_LIBS
126 OVS_CHECK_XENSERVER_VERSION
129 OVS_CHECK_ATOMIC_LIBS
130 OVS_CHECK_GCC4_ATOMICS
131 OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(1)
132 OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(2)
133 OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(4)
134 OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(8)
136 OVS_CHECK_PTHREAD_SET_NAME
140 AX_FUNC_POSIX_MEMALIGN
142 OVS_CHECK_INCLUDE_NEXT([stdio.h string.h])
147 ofproto/libofproto.sym
149 lib/libopenvswitch.sym
153 OVS_ENABLE_OPTION([-Wall])
154 OVS_ENABLE_OPTION([-Wextra])
155 OVS_ENABLE_OPTION([-Wno-sign-compare])
156 OVS_ENABLE_OPTION([-Wpointer-arith])
157 OVS_ENABLE_OPTION([-Wformat -Wformat-security])
158 OVS_ENABLE_OPTION([-Wswitch-enum])
159 OVS_ENABLE_OPTION([-Wunused-parameter])
160 OVS_ENABLE_OPTION([-Wbad-function-cast])
161 OVS_ENABLE_OPTION([-Wcast-align])
162 OVS_ENABLE_OPTION([-Wstrict-prototypes])
163 OVS_ENABLE_OPTION([-Wold-style-definition])
164 OVS_ENABLE_OPTION([-Wmissing-prototypes])
165 OVS_ENABLE_OPTION([-Wmissing-field-initializers])
166 OVS_ENABLE_OPTION([-Wthread-safety])
167 OVS_ENABLE_OPTION([-fno-strict-aliasing])
168 OVS_ENABLE_OPTION([-Wswitch-bool])
169 OVS_ENABLE_OPTION([-Wlogical-not-parentheses])
170 OVS_ENABLE_OPTION([-Wsizeof-array-argument])
171 OVS_ENABLE_OPTION([-Wbool-compare])
172 OVS_ENABLE_OPTION([-Wshift-negative-value])
173 OVS_ENABLE_OPTION([-Wduplicated-cond])
174 OVS_ENABLE_OPTION([-Qunused-arguments])
175 OVS_CONDITIONAL_CC_OPTION([-Wno-unused], [HAVE_WNO_UNUSED])
176 OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], [HAVE_WNO_UNUSED_PARAMETER])
179 OVS_CTAGS_IDENTIFIERS
181 AC_ARG_VAR(KARCH, [Kernel Architecture String])
186 OVS_CHECK_PRAGMA_MESSAGE
187 AC_SUBST([OVS_CFLAGS])
188 AC_SUBST([OVS_LDFLAGS])
190 AC_CONFIG_FILES(Makefile)
191 AC_CONFIG_FILES(datapath/Makefile)
192 AC_CONFIG_FILES(datapath/linux/Kbuild)
193 AC_CONFIG_FILES(datapath/linux/Makefile)
194 AC_CONFIG_FILES(datapath/linux/Makefile.main)
195 AC_CONFIG_FILES(tests/atlocal)
196 AC_CONFIG_FILES(lib/libopenvswitch.pc)
197 AC_CONFIG_FILES(lib/libsflow.pc)
198 AC_CONFIG_FILES(ofproto/libofproto.pc)
199 AC_CONFIG_FILES(ovsdb/libovsdb.pc)
200 AC_CONFIG_FILES(include/openvswitch/version.h)
202 dnl This makes sure that include/openflow gets created in the build directory.
203 AC_CONFIG_COMMANDS([include/openflow/openflow.h.stamp])
205 AC_CONFIG_COMMANDS([utilities/bugtool/dummy], [:])
206 AC_CONFIG_COMMANDS([ovn/dummy], [:])
207 AC_CONFIG_COMMANDS([ovn/utilities/dummy], [:])
209 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])