# -*- autoconf -*-
-# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
+# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
fi
AC_MSG_RESULT([$kversion])
- if test "$version" -ge 3; then
- if test "$version" = 3 && test "$patchlevel" -le 19; then
- : # Linux 3.x
+ if test "$version" -ge 4; then
+ if test "$version" = 4 && test "$patchlevel" -le 0; then
+ : # Linux 4.x
else
- AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 3.19.x is not supported (please refer to the FAQ for advice)])
+ AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.0.x is not supported (please refer to the FAQ for advice)])
fi
+ elif test "$version" = 3; then
+ : # Linux 3.x
else
if test "$version" -le 1 || test "$patchlevel" -le 5 || test "$sublevel" -le 31; then
AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version 2.6.32 or later is required])
CFLAGS="$ovs_save_CFLAGS"
LDFLAGS="$ovs_save_LDFLAGS"
OVS_LDFLAGS="$OVS_LDFLAGS -L$DPDK_LIB_DIR"
- OVS_CFLAGS="$OVS_CFLAGS -I$DPDK_INCLUDE"
+ OVS_CFLAGS="$OVS_CFLAGS -I$DPDK_INCLUDE -mssse3"
# DPDK pmd drivers are not linked unless --whole-archive is used.
#
DPDK_vswitchd_LDFLAGS=-Wl,--whole-archive,$DPDK_LIB,--no-whole-archive
AC_SUBST([DPDK_vswitchd_LDFLAGS])
AC_DEFINE([DPDK_NETDEV], [1], [System uses the DPDK module.])
+
+ OVS_GREP_IFELSE([$RTE_SDK/include/rte_config.h], [define RTE_LIBRTE_VHOST_USER 1],
+ [], [AC_DEFINE([VHOST_CUSE], [1], [DPDK vhost-cuse support enabled, vhost-user disabled.])])
else
RTE_SDK=
fi
echo '#define $1 1' >> datapath/linux/kcompat.h.new
])
-AC_DEFUN([OVS_CHECK_LOG2_H], [
- AC_MSG_CHECKING([for $KSRC/include/linux/log2.h])
- if test -e $KSRC/include/linux/log2.h; then
- AC_MSG_RESULT([yes])
- OVS_DEFINE([HAVE_LOG2_H])
- else
- AC_MSG_RESULT([no])
- fi
-])
-
dnl OVS_CHECK_LINUX_COMPAT
dnl
dnl Runs various Autoconf checks on the Linux 2.6 kernel source in
OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [can_checksum_protocol])
OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [netdev_features_t])
OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [pcpu_sw_netstats])
+ OVS_GREP_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hookfn.*nf_hook_ops],
+ [OVS_DEFINE([HAVE_NF_HOOKFN_ARG_OPS])])
OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32])
# quoting rules.
OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [[[^@]]proto_data_valid],
[OVS_DEFINE([HAVE_PROTO_DATA_VALID])])
+ OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [kfree_skb_list])
OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [rxhash])
OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [u16.*rxhash],
[OVS_DEFINE([HAVE_U16_RXHASH])])
OVS_GREP_IFELSE([$KSRC/include/uapi/linux/netdevice.h], [NET_NAME_UNKNOWN],
[OVS_DEFINE([HAVE_NET_NAME_UNKNOWN])])
- OVS_CHECK_LOG2_H
-
if cmp -s datapath/linux/kcompat.h.new \
datapath/linux/kcompat.h >/dev/null 2>&1; then
rm datapath/linux/kcompat.h.new
[AC_LANG_PROGRAM([#include <stdio.h>
#include <string.h>
],
- [[char string[] = ":::";
+ [[#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 8
+ /* Assume bug is present, because relatively minor
+ changes in compiler settings (e.g. optimization
+ level) can make it crop up. */
+ return 1;
+ #else
+ char string[] = ":::";
char *save_ptr = (char *) 0xc0ffee;
char *token1, *token2;
token1 = strtok_r(string, ":", &save_ptr);
freopen ("/dev/null", "w", stdout);
printf ("%s %s\n", token1, token2);
return 0;
+ #endif
]])],
[ovs_cv_strtok_r_bug=no],
[ovs_cv_strtok_r_bug=yes],
dnl clang's GCC-compatible compiler driver does not return a failure
dnl exit status even though it complains about options it does not
dnl understand.
+ dnl
+ dnl Also, check stderr as gcc exits with status 0 for options
+ dnl rejected at getopt level.
+ dnl % touch /tmp/a.c
+ dnl % gcc -g -c -Werror -Qunused-arguments /tmp/a.c; echo $?
+ dnl gcc: unrecognized option '-Qunused-arguments'
+ dnl 0
+ dnl %
CFLAGS="$CFLAGS $WERROR $1"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)], [ovs_cv_name[]=yes], [ovs_cv_name[]=no])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)], [if test -s conftest.err && grep "unrecognized option" conftest.err; then ovs_cv_name[]=no; else ovs_cv_name[]=yes; fi], [ovs_cv_name[]=no])
CFLAGS="$ovs_save_CFLAGS"])
if test $ovs_cv_name = yes; then
m4_if([$2], [], [:], [$2])