X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=acinclude.m4;h=8145340a6b37535f474443adf89eb54605f3db1d;hb=d76aabead8bb20614e56a7330dfb08f1c8b1b5d0;hp=30a4dc6d68d7e77d80ea18e1880f3535b8f4ef21;hpb=dc0d542d5254c1e6b749df4c34aeb549e5599df4;p=sliver-openvswitch.git diff --git a/acinclude.m4 b/acinclude.m4 index 30a4dc6d6..8145340a6 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -134,14 +134,16 @@ AC_DEFUN([OVS_CHECK_LINUX], [ AC_MSG_RESULT([$kversion]) if test "$version" -ge 3; then - : # Linux 3.x - elif test "$version" = 2 && test "$patchlevel" -ge 6; then - : # Linux 2.6.x + if test "$version" = 3 && test "$patchlevel" -le 10; then + : # Linux 3.x + else + AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 3.10.x is not supported]) + fi else - if test "$KBUILD" = "$KSRC"; then - AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version 2.6 or later is required]) + 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]) else - AC_ERROR([Linux kernel in build tree $KBUILD (source tree $KSRC) is version $kversion, but version 2.6 or later is required]) + : # Linux 2.6.x fi fi if (test ! -e "$KBUILD"/include/linux/version.h && \ @@ -271,6 +273,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/net/checksum.h], [csum_replace4]) OVS_GREP_IFELSE([$KSRC/include/net/checksum.h], [csum_unfold]) + OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [parallel_ops]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [NLA_NUL_STRING]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_get_be16]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be16]) @@ -527,3 +530,50 @@ AC_DEFUN([OVS_ENABLE_SPARSE], [if test $ovs_cv_gnu_make_if = yes; then CC='$(if $(C),REAL_CC="'"$CC"'" CHECK="$(SPARSE) -I $(top_srcdir)/include/sparse $(SPARSEFLAGS) $(SPARSE_EXTRA_INCLUDES) " cgcc $(CGCCFLAGS),'"$CC"')' fi])]) + +dnl OVS_PTHREAD_SET_NAME +dnl +dnl This checks for three known variants of pthreads functions for setting +dnl the name of the current thread: +dnl +dnl glibc: int pthread_setname_np(pthread_t, const char *name); +dnl NetBSD: int pthread_setname_np(pthread_t, const char *format, void *arg); +dnl FreeBSD: int pthread_set_name_np(pthread_t, const char *name); +dnl +dnl For glibc and FreeBSD, the arguments are just a thread and its name. For +dnl NetBSD, 'format' is a printf() format string and 'arg' is an argument to +dnl provide to it. +dnl +dnl This macro defines: +dnl +dnl glibc: HAVE_GLIBC_PTHREAD_SETNAME_NP +dnl NetBSD: HAVE_NETBSD_PTHREAD_SETNAME_NP +dnl FreeBSD: HAVE_PTHREAD_SET_NAME_NP +AC_DEFUN([OVS_CHECK_PTHREAD_SET_NAME], + [AC_CHECK_FUNCS([pthread_set_name_np]) + if test $ac_cv_func_pthread_set_name_np != yes; then + AC_CACHE_CHECK( + [for pthread_setname_np() variant], + [ovs_cv_pthread_setname_np], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include + ], [pthread_setname_np(pthread_self(), "name");])], + [ovs_cv_pthread_setname_np=glibc], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include +], [pthread_setname_np(pthread_self(), "%s", "name");])], + [ovs_cv_pthread_setname_np=netbsd], + [ovs_cv_pthread_setname_np=none])])]) + case $ovs_cv_pthread_setname_np in # ( + glibc) + AC_DEFINE( + [HAVE_GLIBC_PTHREAD_SETNAME_NP], [1], + [Define to 1 if pthread_setname_np() is available and takes 2 parameters (like glibc).]) + ;; # ( + netbsd) + AC_DEFINE( + [HAVE_NETBSD_PTHREAD_SETNAME_NP], [1], + [Define to 1 if pthread_setname_np() is available and takes 3 parameters (like NetBSD).]) + ;; + esac + fi])