Signed-off-by: Dave Tucker <d...@dtucker.co.uk> --- acinclude.m4 | 29 +++++++++++++++++++++-------- configure.ac | 1 + 2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/acinclude.m4 b/acinclude.m4 index 10ede83..130ed3b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -27,7 +27,7 @@ AC_DEFUN([OVS_ENABLE_WERROR], dnl OVS_CHECK_LINUX dnl -dnl Configure linux kernel source tree +dnl Configure linux kernel source tree AC_DEFUN([OVS_CHECK_LINUX], [ AC_ARG_WITH([linux], [AC_HELP_STRING([--with-linux=/path/to/linux], @@ -235,15 +235,15 @@ AC_DEFUN([OVS_GREP_IFELSE], [ grep '$2' $1 >/dev/null 2>&1 status=$? case $status in - 0) + 0) AC_MSG_RESULT([yes]) m4_if([$3], [], [OVS_DEFINE([HAVE_]m4_toupper([$2]))], [$3]) ;; - 1) + 1) AC_MSG_RESULT([no]) $4 ;; - *) + *) AC_MSG_ERROR([grep exited with status $status]) ;; esac @@ -308,7 +308,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ [OVS_GREP_IFELSE([$KSRC/include/linux/rtnetlink.h], [rcu_read_lock_held])]) OVS_GREP_IFELSE([$KSRC/include/linux/rtnetlink.h], [lockdep_rtnl_is_held]) - + # Check for the proto_data_valid member in struct sk_buff. The [^@] # is necessary because some versions of this header remove the # member but retain the kerneldoc comment that describes it (which @@ -321,7 +321,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ [OVS_DEFINE([HAVE_U16_RXHASH])]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_dst(], [OVS_DEFINE([HAVE_SKB_DST_ACCESSOR_FUNCS])]) - OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], + OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_copy_from_linear_data_offset]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_reset_tail_pointer]) @@ -417,14 +417,27 @@ AC_DEFUN([OVS_CHECK_IF_PACKET], [Define to 1 if net/if_packet.h is available.]) fi]) +dnl Checks for OSX via the presense of MacTypes.h. +AC_DEFUN([OVS_CHECK_OSX], + [AC_CHECK_HEADER([MacTypes.h], + [OSX=yes], + [OSX=no]) + AM_CONDITIONAL([OSX], [test "$OSX" = yes]) + if test "$OSX" = yes; then + AC_DEFINE([OSX], [1], + [Define to 1 if building on Mac OSX.]) + fi]) + dnl Checks for net/if_dl.h. dnl dnl (We use this as a proxy for checking whether we're building on FreeBSD dnl or NetBSD.) +dnl Uses HAVE_MAC_TYPES to exclude Mac OSX AC_DEFUN([OVS_CHECK_IF_DL], [AC_CHECK_HEADER([net/if_dl.h], [HAVE_IF_DL=yes], [HAVE_IF_DL=no]) + AM_CONDITIONAL([OSX], [HAVE_IF_DL=no]) AM_CONDITIONAL([HAVE_IF_DL], [test "$HAVE_IF_DL" = yes]) if test "$HAVE_IF_DL" = yes; then AC_DEFINE([HAVE_IF_DL], [1], @@ -475,7 +488,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([_OVS_CHECK_CC_OPTION], [dnl m4_define([ovs_cv_name], [ovs_cv_[]m4_translit([$1], [-=], [__])])dnl - AC_CACHE_CHECK([whether $CC accepts $1], [ovs_cv_name], + AC_CACHE_CHECK([whether $CC accepts $1], [ovs_cv_name], [ovs_save_CFLAGS="$CFLAGS" dnl Include -Werror in the compiler options, because without -Werror dnl clang's GCC-compatible compiler driver does not return a failure @@ -510,7 +523,7 @@ dnl OVS_ENABLE_OPTION([OPTION]) dnl Check whether the given C compiler OPTION is accepted. dnl If so, add it to WARNING_FLAGS. dnl Example: OVS_ENABLE_OPTION([-Wdeclaration-after-statement]) -AC_DEFUN([OVS_ENABLE_OPTION], +AC_DEFUN([OVS_ENABLE_OPTION], [OVS_CHECK_CC_OPTION([$1], [WARNING_FLAGS="$WARNING_FLAGS $1"]) AC_SUBST([WARNING_FLAGS])]) diff --git a/configure.ac b/configure.ac index d2d02ca..c8c4d34 100644 --- a/configure.ac +++ b/configure.ac @@ -86,6 +86,7 @@ AC_FUNC_STRERROR_R OVS_CHECK_ESX OVS_CHECK_WIN32 +OVS_CHECK_OSX OVS_CHECK_VISUAL_STUDIO_DDK OVS_CHECK_COVERAGE OVS_CHECK_NDEBUG -- 1.9.3 (Apple Git-50) _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev