2017-03-07 20:48:08 -08:00
|
|
|
# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Nicira, Inc.
|
2009-07-08 13:19:16 -07:00
|
|
|
#
|
2009-06-15 15:11:30 -07:00
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at:
|
2009-07-08 13:19:16 -07:00
|
|
|
#
|
2009-06-15 15:11:30 -07:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
2009-07-08 13:19:16 -07:00
|
|
|
|
2014-06-27 09:31:57 +02:00
|
|
|
AC_PREREQ(2.63)
|
2020-01-21 12:45:00 -08:00
|
|
|
AC_INIT(openvswitch, 2.13.90, bugs@openvswitch.org)
|
2009-07-08 13:19:16 -07:00
|
|
|
AC_CONFIG_SRCDIR([datapath/datapath.c])
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
2009-07-27 16:40:11 -07:00
|
|
|
AC_CONFIG_TESTDIR([tests])
|
2015-01-15 09:20:22 +00:00
|
|
|
AM_INIT_AUTOMAKE([tar-pax])
|
2009-07-08 13:19:16 -07:00
|
|
|
|
2014-05-29 16:12:24 +00:00
|
|
|
AC_PROG_CC_C99
|
2009-07-08 13:19:16 -07:00
|
|
|
AM_PROG_CC_C_O
|
2017-07-31 13:31:43 -07:00
|
|
|
AC_PROG_CXX
|
2009-07-08 13:19:16 -07:00
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_MKDIR_P
|
2010-07-21 15:38:23 -07:00
|
|
|
AC_PROG_FGREP
|
2012-11-07 10:16:27 -08:00
|
|
|
AC_PROG_EGREP
|
2017-07-14 08:36:39 +02:00
|
|
|
PKG_PROG_PKG_CONFIG
|
2009-07-08 13:19:16 -07:00
|
|
|
|
2012-10-04 15:55:43 -07:00
|
|
|
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
2012-10-03 15:58:54 -07:00
|
|
|
|
2009-07-08 13:19:16 -07:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
AC_C_BIGENDIAN
|
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
|
2013-12-13 18:54:28 +01:00
|
|
|
LT_INIT([disable-shared])
|
2013-12-31 14:20:01 -08:00
|
|
|
m4_pattern_forbid([LT_INIT]) dnl Make autoconf fail if libtool is missing.
|
|
|
|
|
2014-11-07 19:02:09 -08:00
|
|
|
# The following explanation may help to understand the use of the
|
|
|
|
# version number fields: current, revision, and age.
|
|
|
|
#
|
|
|
|
# Consider that there are three possible kinds of reactions from
|
|
|
|
# users of your library to changes in a shared library:
|
|
|
|
#
|
|
|
|
# 1. Programs using the previous version may use the new version as drop-in
|
|
|
|
# replacement, and programs using the new version can also work with the
|
|
|
|
# previous one. In other words, no recompiling nor relinking is needed.
|
|
|
|
# In short, there are no changes to any symbols, no symbols removed,
|
|
|
|
# and no symbols added. In this case, bump revision only, don't touch
|
|
|
|
# current nor age.
|
|
|
|
#
|
|
|
|
# 2. Programs using the previous version may use the new version as drop-in
|
|
|
|
# replacement, but programs using the new version may use APIs not
|
|
|
|
# present in the previous one. In other words, new symbols have been
|
|
|
|
# added and a program linking against the new version may fail with
|
2015-04-17 16:03:14 +09:00
|
|
|
# "unresolved symbols." If linking against the old version at runtime:
|
2014-11-07 19:02:09 -08:00
|
|
|
# set revision to 0, bump current and age.
|
|
|
|
#
|
|
|
|
# 3. Programs may need to be changed, recompiled, relinked in order to use
|
|
|
|
# the new version. This is the case when symbols have been modified or
|
|
|
|
# deleted. Bump current, set revision and age to 0.
|
|
|
|
|
2017-04-21 13:33:55 -07:00
|
|
|
m4_define([libopenvswitch_lt_current], [0])
|
2014-11-07 19:02:09 -08:00
|
|
|
m4_define([libopenvswitch_lt_revision], [0])
|
|
|
|
m4_define([libopenvswitch_lt_age], [0])
|
|
|
|
|
|
|
|
LT_CURRENT=libopenvswitch_lt_current
|
|
|
|
AC_SUBST([LT_CURRENT])
|
|
|
|
LT_REVISION=libopenvswitch_lt_revision
|
|
|
|
AC_SUBST([LT_REVISION])
|
|
|
|
LT_AGE=libopenvswitch_lt_age
|
|
|
|
AC_SUBST([LT_AGE])
|
|
|
|
|
2009-11-04 14:55:53 -08:00
|
|
|
AC_SEARCH_LIBS([pow], [m])
|
2010-06-08 17:18:48 -07:00
|
|
|
AC_SEARCH_LIBS([clock_gettime], [rt])
|
2011-11-01 13:25:49 +01:00
|
|
|
AC_SEARCH_LIBS([timer_create], [rt])
|
2018-11-15 08:25:52 -08:00
|
|
|
AC_SEARCH_LIBS([pthread_rwlock_tryrdlock], [pthread])
|
2018-12-10 20:05:20 +03:00
|
|
|
AC_SEARCH_LIBS([pthread_rwlockattr_destroy], [pthread])
|
2019-07-17 13:23:33 -07:00
|
|
|
AC_SEARCH_LIBS([pthread_spin_lock], [pthread])
|
|
|
|
AC_CHECK_FUNCS([pthread_spin_lock])
|
2013-06-19 15:44:54 -07:00
|
|
|
AC_FUNC_STRERROR_R
|
2009-11-04 14:55:53 -08:00
|
|
|
|
2015-09-23 17:30:32 +00:00
|
|
|
OVS_CHECK_WIN64
|
2013-11-16 11:42:46 -08:00
|
|
|
OVS_CHECK_WIN32
|
2014-08-28 13:49:24 +00:00
|
|
|
OVS_CHECK_VISUAL_STUDIO_DDK
|
2009-07-27 16:42:51 -07:00
|
|
|
OVS_CHECK_COVERAGE
|
2009-07-08 13:19:16 -07:00
|
|
|
OVS_CHECK_NDEBUG
|
|
|
|
OVS_CHECK_NETLINK
|
|
|
|
OVS_CHECK_OPENSSL
|
2015-09-10 18:44:27 -07:00
|
|
|
OVS_CHECK_LIBCAPNG
|
2009-07-08 13:19:16 -07:00
|
|
|
OVS_CHECK_LOGDIR
|
2015-12-17 19:58:33 -05:00
|
|
|
OVS_CHECK_PYTHON3
|
2015-12-21 20:24:34 -05:00
|
|
|
OVS_CHECK_FLAKE8
|
2017-01-02 11:47:40 +00:00
|
|
|
OVS_CHECK_SPHINX
|
2010-12-06 09:56:38 -08:00
|
|
|
OVS_CHECK_DOT
|
2012-06-29 21:11:24 +00:00
|
|
|
OVS_CHECK_IF_DL
|
2009-06-10 14:16:40 -07:00
|
|
|
OVS_CHECK_STRTOK_R
|
2019-07-18 13:11:14 -07:00
|
|
|
OVS_CHECK_LINUX_AF_XDP
|
2013-04-04 23:29:59 -05:00
|
|
|
AC_CHECK_DECLS([sys_siglist], [], [], [[#include <signal.h>]])
|
2010-03-24 13:15:41 -07:00
|
|
|
AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec, struct stat.st_mtimensec],
|
|
|
|
[], [], [[#include <sys/stat.h>]])
|
2013-05-21 17:49:54 +09:00
|
|
|
AC_CHECK_MEMBERS([struct ifreq.ifr_flagshigh], [], [], [[#include <net/if.h>]])
|
2017-07-12 17:38:33 -07:00
|
|
|
AC_CHECK_MEMBERS([struct mmsghdr.msg_len], [], [], [[#include <sys/socket.h>]])
|
2017-07-14 14:33:46 -07:00
|
|
|
AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], [], [],
|
|
|
|
[[#include <sys/socket.h>
|
2017-11-06 14:42:32 -08:00
|
|
|
#include <sys/types.h>
|
2017-07-14 14:33:46 -07:00
|
|
|
#include <netinet/in.h>]])
|
2017-10-28 16:38:30 +01:00
|
|
|
AC_CHECK_FUNCS([mlockall strnlen getloadavg statvfs getmntent_r sendmmsg clock_gettime])
|
2018-03-29 23:05:26 -03:00
|
|
|
AC_CHECK_HEADERS([mntent.h sys/statvfs.h linux/types.h linux/if_ether.h])
|
2018-09-25 17:46:24 -03:00
|
|
|
AC_CHECK_HEADERS([linux/net_namespace.h stdatomic.h bits/floatn-common.h])
|
2013-05-23 10:00:57 -04:00
|
|
|
AC_CHECK_HEADERS([net/if_mib.h], [], [], [[#include <sys/types.h>
|
|
|
|
#include <net/if.h>]])
|
2009-07-08 13:19:16 -07:00
|
|
|
|
2009-07-29 16:48:45 -07:00
|
|
|
OVS_CHECK_PKIDIR
|
|
|
|
OVS_CHECK_RUNDIR
|
2012-07-27 15:52:21 -07:00
|
|
|
OVS_CHECK_DBDIR
|
2011-05-13 11:55:22 -07:00
|
|
|
OVS_CHECK_BACKTRACE
|
2015-04-16 12:52:09 -07:00
|
|
|
OVS_CHECK_PERF_EVENT
|
2009-07-29 16:48:45 -07:00
|
|
|
OVS_CHECK_VALGRIND
|
|
|
|
OVS_CHECK_SOCKET_LIBS
|
2011-02-22 14:47:19 -08:00
|
|
|
OVS_CHECK_XENSERVER_VERSION
|
2011-08-24 10:45:32 -07:00
|
|
|
OVS_CHECK_GROFF
|
2013-06-25 13:50:26 -07:00
|
|
|
OVS_CHECK_TLS
|
2013-12-05 17:29:05 +00:00
|
|
|
OVS_CHECK_ATOMIC_LIBS
|
2013-07-15 14:13:53 -07:00
|
|
|
OVS_CHECK_GCC4_ATOMICS
|
2013-06-28 15:54:40 -07:00
|
|
|
OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(1)
|
|
|
|
OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(2)
|
|
|
|
OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(4)
|
|
|
|
OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(8)
|
2013-07-10 11:40:28 -07:00
|
|
|
OVS_CHECK_POSIX_AIO
|
2013-08-01 09:35:56 -07:00
|
|
|
OVS_CHECK_PTHREAD_SET_NAME
|
2014-01-23 15:35:22 -08:00
|
|
|
OVS_CHECK_LINUX_HOST
|
2017-01-16 14:06:27 -05:00
|
|
|
OVS_LIBTOOL_VERSIONS
|
2017-07-31 13:31:43 -07:00
|
|
|
OVS_CHECK_CXX
|
2014-05-02 17:07:29 +09:00
|
|
|
AX_FUNC_POSIX_MEMALIGN
|
2018-06-26 14:06:21 -07:00
|
|
|
OVS_CHECK_UNBOUND
|
fatal-signal: Catch SIGSEGV and print backtrace.
The patch catches the SIGSEGV signal and prints the backtrace
using libunwind at the monitor daemon. This makes debugging easier
when there is no debug symbol package or gdb installed on production
systems.
The patch works when the ovs-vswitchd compiles even without debug symbol
(no -g option), because the object files still have function symbols.
For example:
|daemon_unix(monitor)|WARN|SIGSEGV detected, backtrace:
|daemon_unix(monitor)|WARN|0x0000000000482752 <fatal_signal_handler+0x52>
|daemon_unix(monitor)|WARN|0x00007fb4900734b0 <killpg+0x40>
|daemon_unix(monitor)|WARN|0x00007fb49013974d <__poll+0x2d>
|daemon_unix(monitor)|WARN|0x000000000052b348 <time_poll+0x108>
|daemon_unix(monitor)|WARN|0x00000000005153ec <poll_block+0x8c>
|daemon_unix(monitor)|WARN|0x000000000058630a <clean_thread_main+0x1aa>
|daemon_unix(monitor)|WARN|0x00000000004ffd1d <ovsthread_wrapper+0x7d>
|daemon_unix(monitor)|WARN|0x00007fb490b3b6ba <start_thread+0xca>
|daemon_unix(monitor)|WARN|0x00007fb49014541d <clone+0x6d>
|daemon_unix(monitor)|ERR|1 crashes: pid 122849 died, killed \
(Segmentation fault), core dumped, restarting
However, if the object files' symbols are stripped, then we can only
get init function plus offset value. This is still useful when trying
to see if two bugs have the same root cause, Example:
|daemon_unix(monitor)|WARN|SIGSEGV detected, backtrace:
|daemon_unix(monitor)|WARN|0x0000000000482752 <_init+0x7d68a>
|daemon_unix(monitor)|WARN|0x00007f5f7c8cf4b0 <killpg+0x40>
|daemon_unix(monitor)|WARN|0x00007f5f7c99574d <__poll+0x2d>
|daemon_unix(monitor)|WARN|0x000000000052b348 <_init+0x126280>
|daemon_unix(monitor)|WARN|0x00000000005153ec <_init+0x110324>
|daemon_unix(monitor)|WARN|0x0000000000407439 <_init+0x2371>
|daemon_unix(monitor)|WARN|0x00007f5f7c8ba830 <__libc_start_main+0xf0>
|daemon_unix(monitor)|WARN|0x0000000000408329 <_init+0x3261>
|daemon_unix(monitor)|ERR|1 crashes: pid 106155 died, killed \
(Segmentation fault), core dumped, restarting
Most C library functions are not async-signal-safe, meaning that
it is not safe to call them from a signal handler, for example
printf() or fflush(). To be async-signal-safe, the handler only
collects the stack info using libunwind, which is signal-safe, and
issues 'write' to the pipe, where the monitor thread reads and
prints to ovs-vswitchd.log.
Tested-at: https://travis-ci.org/williamtu/ovs-travis/builds/590503433
Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-09-27 10:22:55 -07:00
|
|
|
OVS_CHECK_UNWIND
|
2009-07-08 13:19:16 -07:00
|
|
|
|
2013-12-24 09:18:42 -08:00
|
|
|
OVS_CHECK_INCLUDE_NEXT([stdio.h string.h])
|
2014-11-07 19:02:09 -08:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
lib/stdio.h
|
|
|
|
lib/string.h
|
|
|
|
ovsdb/libovsdb.sym
|
|
|
|
ofproto/libofproto.sym
|
|
|
|
lib/libsflow.sym
|
2015-03-09 13:52:08 +00:00
|
|
|
lib/libopenvswitch.sym
|
|
|
|
vtep/libvtep.sym])
|
2013-12-13 09:54:55 -08:00
|
|
|
|
2009-07-29 16:48:45 -07:00
|
|
|
OVS_ENABLE_OPTION([-Wall])
|
2013-07-22 13:38:25 -07:00
|
|
|
OVS_ENABLE_OPTION([-Wextra])
|
2009-07-29 16:48:45 -07:00
|
|
|
OVS_ENABLE_OPTION([-Wno-sign-compare])
|
|
|
|
OVS_ENABLE_OPTION([-Wpointer-arith])
|
2016-12-05 14:28:59 -08:00
|
|
|
OVS_ENABLE_OPTION([-Wformat -Wformat-security])
|
2009-07-29 16:48:45 -07:00
|
|
|
OVS_ENABLE_OPTION([-Wswitch-enum])
|
|
|
|
OVS_ENABLE_OPTION([-Wunused-parameter])
|
|
|
|
OVS_ENABLE_OPTION([-Wbad-function-cast])
|
|
|
|
OVS_ENABLE_OPTION([-Wcast-align])
|
|
|
|
OVS_ENABLE_OPTION([-Wstrict-prototypes])
|
|
|
|
OVS_ENABLE_OPTION([-Wold-style-definition])
|
|
|
|
OVS_ENABLE_OPTION([-Wmissing-prototypes])
|
|
|
|
OVS_ENABLE_OPTION([-Wmissing-field-initializers])
|
2013-07-30 15:31:48 -07:00
|
|
|
OVS_ENABLE_OPTION([-Wthread-safety])
|
2014-09-30 17:03:07 -07:00
|
|
|
OVS_ENABLE_OPTION([-fno-strict-aliasing])
|
2016-12-05 14:29:24 -08:00
|
|
|
OVS_ENABLE_OPTION([-Wswitch-bool])
|
|
|
|
OVS_ENABLE_OPTION([-Wlogical-not-parentheses])
|
|
|
|
OVS_ENABLE_OPTION([-Wsizeof-array-argument])
|
|
|
|
OVS_ENABLE_OPTION([-Wbool-compare])
|
2016-12-05 14:38:08 -08:00
|
|
|
OVS_ENABLE_OPTION([-Wshift-negative-value])
|
|
|
|
OVS_ENABLE_OPTION([-Wduplicated-cond])
|
2015-04-17 17:14:38 +09:00
|
|
|
OVS_ENABLE_OPTION([-Qunused-arguments])
|
2018-02-27 14:14:12 -08:00
|
|
|
OVS_ENABLE_OPTION([-Wshadow])
|
2018-06-14 14:49:23 -07:00
|
|
|
OVS_ENABLE_OPTION([-Wmultistatement-macros])
|
|
|
|
OVS_ENABLE_OPTION([-Wcast-align=strict])
|
2018-07-09 14:37:55 -07:00
|
|
|
OVS_ENABLE_OPTION([-Wno-null-pointer-arithmetic])
|
2018-08-15 10:38:09 -07:00
|
|
|
OVS_ENABLE_OPTION([-Warray-bounds-pointer-arithmetic])
|
2009-11-20 09:45:26 -08:00
|
|
|
OVS_CONDITIONAL_CC_OPTION([-Wno-unused], [HAVE_WNO_UNUSED])
|
2010-07-30 14:47:29 -07:00
|
|
|
OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], [HAVE_WNO_UNUSED_PARAMETER])
|
2011-04-12 11:43:11 -07:00
|
|
|
OVS_ENABLE_WERROR
|
2011-05-06 13:00:49 -07:00
|
|
|
OVS_ENABLE_SPARSE
|
2017-06-26 21:55:50 -03:00
|
|
|
OVS_CTAGS_IDENTIFIERS
|
2020-07-13 13:42:10 +01:00
|
|
|
OVS_CHECK_DPCLS_AUTOVALIDATOR
|
2009-07-08 13:19:16 -07:00
|
|
|
|
|
|
|
AC_ARG_VAR(KARCH, [Kernel Architecture String])
|
|
|
|
AC_SUBST(KARCH)
|
2011-06-22 09:26:31 -07:00
|
|
|
OVS_CHECK_LINUX
|
2019-11-04 18:34:49 +02:00
|
|
|
OVS_CHECK_LINUX_NETLINK
|
2017-05-28 14:59:45 +03:00
|
|
|
OVS_CHECK_LINUX_TC
|
2019-05-21 14:16:30 -04:00
|
|
|
OVS_CHECK_LINUX_SCTP_CT
|
2020-07-07 15:59:49 -07:00
|
|
|
OVS_CHECK_LINUX_VIRTIO_TYPES
|
2014-03-24 19:23:08 -07:00
|
|
|
OVS_CHECK_DPDK
|
2014-08-29 16:08:11 -07:00
|
|
|
OVS_CHECK_PRAGMA_MESSAGE
|
2014-09-11 21:34:21 +02:00
|
|
|
AC_SUBST([OVS_CFLAGS])
|
|
|
|
AC_SUBST([OVS_LDFLAGS])
|
2009-07-08 13:19:16 -07:00
|
|
|
|
2013-11-15 15:32:09 -08:00
|
|
|
AC_CONFIG_FILES(Makefile)
|
|
|
|
AC_CONFIG_FILES(datapath/Makefile)
|
|
|
|
AC_CONFIG_FILES(datapath/linux/Kbuild)
|
|
|
|
AC_CONFIG_FILES(datapath/linux/Makefile)
|
|
|
|
AC_CONFIG_FILES(datapath/linux/Makefile.main)
|
|
|
|
AC_CONFIG_FILES(tests/atlocal)
|
2014-11-13 12:28:41 +01:00
|
|
|
AC_CONFIG_FILES(lib/libopenvswitch.pc)
|
2014-11-13 12:28:44 +01:00
|
|
|
AC_CONFIG_FILES(lib/libsflow.pc)
|
2014-11-13 12:28:42 +01:00
|
|
|
AC_CONFIG_FILES(ofproto/libofproto.pc)
|
2014-11-13 12:28:43 +01:00
|
|
|
AC_CONFIG_FILES(ovsdb/libovsdb.pc)
|
2014-11-24 12:49:00 +01:00
|
|
|
AC_CONFIG_FILES(include/openvswitch/version.h)
|
2009-07-08 13:19:16 -07:00
|
|
|
|
2010-01-25 10:49:31 -08:00
|
|
|
dnl This makes sure that include/openflow gets created in the build directory.
|
|
|
|
AC_CONFIG_COMMANDS([include/openflow/openflow.h.stamp])
|
|
|
|
|
2011-07-06 10:43:03 -07:00
|
|
|
AC_CONFIG_COMMANDS([utilities/bugtool/dummy], [:])
|
2018-11-10 16:29:07 +01:00
|
|
|
AC_CONFIG_COMMANDS([ipsec/dummy], [:])
|
2010-05-11 11:46:52 -07:00
|
|
|
|
2014-01-21 16:22:08 -08:00
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
|
|
|
|
|
2009-07-08 13:19:16 -07:00
|
|
|
AC_OUTPUT
|