datapath: Tolerate backporting of rtnl_link_stats64 (as in RHEL 6).
Red Hat Enterprise Linux 6 has a 2.6.32 kernel but it backports the
rtnl_link_stats64 structure that was introduced in 2.6.35, so we need to
check whether it was defined instead of just guessing based on the kernel
version number.
Build-tested only, on 2.6.32-71.14.1.el6 (RHEL 6),
linux-2.6.18-128.1.6.el5.xs5.5.0.496.101 (XenServer 5.5.0),
2.6.18-128.1.6.el5.xs5.5.0.505.1024xen (XenServer 5.5.0 update 1),
and upstream 2.6.18, 2.6.26, 2.6.29, 2.6.33, 2.6.34, 2.6.36, all for i386,
plus 2.6.36 for x86-64.
My machine's userspace headers have <linux/if_link.h> but not
rtnl_link_stats64. Jesse Gross tested the case where <linux/if_link.h>
has rtnl_link_stats64, on Ubuntu 10.10.
Reported-by: Geoff White <gwhite@nicira.com>
Tested-by: Jesse Gross <jesse@nicira.com>
2011-02-04 12:35:49 -08:00
|
|
|
# Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks
|
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
|
|
|
|
2010-02-26 12:19:58 -08:00
|
|
|
AC_PREREQ(2.64)
|
2011-04-05 22:17:03 -07:00
|
|
|
AC_INIT(openvswitch, 1.1.0, ovs-bugs@openvswitch.org)
|
2009-07-08 13:19:16 -07:00
|
|
|
NX_BUILDNR
|
|
|
|
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])
|
2009-07-08 13:19:16 -07:00
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
|
|
|
|
AC_PROG_CC
|
|
|
|
AM_PROG_CC_C_O
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
AC_PROG_MKDIR_P
|
2010-07-21 15:38:23 -07:00
|
|
|
AC_PROG_FGREP
|
2009-07-08 13:19:16 -07:00
|
|
|
|
|
|
|
AC_ARG_VAR([PERL], [path to Perl interpreter])
|
|
|
|
AC_PATH_PROG([PERL], perl, no)
|
|
|
|
if test "$PERL" = no; then
|
|
|
|
AC_MSG_ERROR([Perl interpreter not found in $PATH or $PERL.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
AC_C_BIGENDIAN
|
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
|
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])
|
2009-11-04 14:55:53 -08:00
|
|
|
|
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
|
|
|
|
OVS_CHECK_LOGDIR
|
datapath: Tolerate backporting of rtnl_link_stats64 (as in RHEL 6).
Red Hat Enterprise Linux 6 has a 2.6.32 kernel but it backports the
rtnl_link_stats64 structure that was introduced in 2.6.35, so we need to
check whether it was defined instead of just guessing based on the kernel
version number.
Build-tested only, on 2.6.32-71.14.1.el6 (RHEL 6),
linux-2.6.18-128.1.6.el5.xs5.5.0.496.101 (XenServer 5.5.0),
2.6.18-128.1.6.el5.xs5.5.0.505.1024xen (XenServer 5.5.0 update 1),
and upstream 2.6.18, 2.6.26, 2.6.29, 2.6.33, 2.6.34, 2.6.36, all for i386,
plus 2.6.36 for x86-64.
My machine's userspace headers have <linux/if_link.h> but not
rtnl_link_stats64. Jesse Gross tested the case where <linux/if_link.h>
has rtnl_link_stats64, on Ubuntu 10.10.
Reported-by: Geoff White <gwhite@nicira.com>
Tested-by: Jesse Gross <jesse@nicira.com>
2011-02-04 12:35:49 -08:00
|
|
|
OVS_CHECK_RTNL_LINK_STATS64
|
2009-09-14 10:05:13 -07:00
|
|
|
OVS_CHECK_PYTHON
|
2010-05-11 11:46:52 -07:00
|
|
|
OVS_CHECK_PYUIC4
|
|
|
|
OVS_CHECK_OVSDBMONITOR
|
2010-12-06 09:56:38 -08:00
|
|
|
OVS_CHECK_DOT
|
2009-07-08 13:19:16 -07:00
|
|
|
OVS_CHECK_IF_PACKET
|
2009-06-10 14:16:40 -07:00
|
|
|
OVS_CHECK_STRTOK_R
|
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>]])
|
2011-02-22 10:36:13 -08:00
|
|
|
AC_CHECK_FUNCS([mlockall strnlen strsignal getloadavg statvfs setmntent])
|
2010-09-22 16:45:30 -07:00
|
|
|
AC_CHECK_HEADERS([mntent.h sys/statvfs.h])
|
2009-07-08 13:19:16 -07:00
|
|
|
|
2009-07-29 16:48:45 -07:00
|
|
|
OVS_CHECK_PKIDIR
|
|
|
|
OVS_CHECK_RUNDIR
|
|
|
|
OVS_CHECK_MALLOC_HOOKS
|
|
|
|
OVS_CHECK_VALGRIND
|
|
|
|
OVS_CHECK_SOCKET_LIBS
|
2010-07-16 10:53:14 -07:00
|
|
|
OVS_CHECK_LINKER_SECTIONS
|
2011-02-22 14:47:19 -08:00
|
|
|
OVS_CHECK_XENSERVER_VERSION
|
2009-07-08 13:19:16 -07:00
|
|
|
|
2009-07-29 16:48:45 -07:00
|
|
|
OVS_ENABLE_OPTION([-Wall])
|
|
|
|
OVS_ENABLE_OPTION([-Wno-sign-compare])
|
|
|
|
OVS_ENABLE_OPTION([-Wpointer-arith])
|
|
|
|
OVS_ENABLE_OPTION([-Wdeclaration-after-statement])
|
|
|
|
OVS_ENABLE_OPTION([-Wformat-security])
|
|
|
|
OVS_ENABLE_OPTION([-Wswitch-enum])
|
|
|
|
OVS_ENABLE_OPTION([-Wunused-parameter])
|
|
|
|
OVS_ENABLE_OPTION([-Wstrict-aliasing])
|
|
|
|
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])
|
|
|
|
OVS_ENABLE_OPTION([-Wno-override-init])
|
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
|
2009-07-08 13:19:16 -07:00
|
|
|
|
|
|
|
AC_ARG_VAR(KARCH, [Kernel Architecture String])
|
|
|
|
AC_SUBST(KARCH)
|
datapath: Fix build with kernel header layout recently adopted by Debian.
Recent Debian kernel-header packages divide kernel headers into two
directories: the "common" headers that are not architecture-specific,
which go in a directory named like
/usr/src/kernel-headers-2.6.31-1-common,
and architecture-specific headers in a directory named, e.g.
/usr/src/kernel-headers-2.6.31-1-686.
OVS needs to look at the ones in the "common" directory as part of its
configuration process, but the build directory provided on --with-l26 is
the architecture-specific directory. We also need the
architecture-specific directory, since it is the one that we use as part
of the "make", so we can't simply make the user specify the common
directory on --with-l26. Furthermore, there is no easy-to-see link
between the two directories, except as part of the text in a Makefile,
which is not the easiest language to parse.
This commit attempts to kluge around the problem by using the Debian
directory naming. If the build directory does not contain the headers,
then we replace the last component of its name by "-common" and check
for the headers there. This is not ideal, but it does solve the actual
problem at hand.
Tested with Debian's linux-headers-2.6.31-1-686 and with a few older
sets of headers that do not use this scheme.
2009-11-18 11:05:00 -08:00
|
|
|
OVS_CHECK_LINUX26
|
2009-07-08 13:19:16 -07:00
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile
|
|
|
|
datapath/Makefile
|
|
|
|
datapath/linux-2.6/Kbuild
|
|
|
|
datapath/linux-2.6/Makefile
|
2009-07-27 16:40:11 -07:00
|
|
|
datapath/linux-2.6/Makefile.main
|
|
|
|
tests/atlocal])
|
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])
|
|
|
|
|
2010-05-11 11:46:52 -07:00
|
|
|
AC_CONFIG_COMMANDS([ovsdb/ovsdbmonitor/dummy], [:])
|
|
|
|
|
2009-07-08 13:19:16 -07:00
|
|
|
AC_OUTPUT
|