Add check for -latomic
[sliver-openvswitch.git] / m4 / openvswitch.m4
index bcdb942..55c48ec 100644 (file)
@@ -46,22 +46,6 @@ AC_DEFUN([OVS_CHECK_NDEBUG],
      [ndebug=false])
    AM_CONDITIONAL([NDEBUG], [test x$ndebug = xtrue])])
 
-dnl Checks for --enable-cache-time and defines CACHE_TIME if it is specified.
-AC_DEFUN([OVS_CHECK_CACHE_TIME],
-  [AC_ARG_ENABLE(
-     [cache-time],
-     [AC_HELP_STRING([--enable-cache-time],
-                     [Override time caching default (for testing only)])],
-     [case "${enableval}" in
-        (yes) cache_time=1;;
-        (no)  cache_time=0;;
-        (*) AC_MSG_ERROR([bad value ${enableval} for --enable-cache-time]) ;;
-      esac
-      AC_DEFINE_UNQUOTED([CACHE_TIME], [$cache_time],
-          [Define to 1 to enable time caching, to 0 to disable time caching, or
-           leave undefined to use the default (as one should
-           ordinarily do).])])])
-
 dnl Checks for ESX.
 AC_DEFUN([OVS_CHECK_ESX],
   [AC_CHECK_HEADER([vmware.h],
@@ -72,6 +56,16 @@ AC_DEFUN([OVS_CHECK_ESX],
       AC_DEFINE([ESX], [1], [Define to 1 if building on ESX.])
    fi])
 
+dnl Checks for WINDOWS.
+AC_DEFUN([OVS_CHECK_WIN32],
+  [AC_CHECK_HEADER([windows.h],
+                   [WIN32=yes],
+                   [WIN32=no])
+   AM_CONDITIONAL([WIN32], [test "$WIN32" = yes])
+   if test "$WIN32" = yes; then
+      AC_DEFINE([WIN32], [1], [Define to 1 if building on WIN32.])
+   fi])
+
 dnl Checks for Netlink support.
 AC_DEFUN([OVS_CHECK_NETLINK],
   [AC_CHECK_HEADER([linux/netlink.h],
@@ -211,7 +205,7 @@ AC_DEFUN([OVS_CHECK_PYTHON],
           for dir in $PATH; do
             IFS=$ovs_save_IFS
             test -z "$dir" && dir=.
-            if test -x $dir/$binary && $dir/$binary -c 'import sys
+            if test -x "$dir"/"$binary" && "$dir"/"$binary" -c 'import sys
 if sys.hexversion >= 0x02040000 and sys.hexversion < 0x03000000:
     sys.exit(0)
 else:
@@ -302,6 +296,18 @@ AC_DEFUN([OVS_CHECK_OVSDBMONITOR],
    AC_MSG_RESULT([$BUILD_OVSDBMONITOR])
    AM_CONDITIONAL([BUILD_OVSDBMONITOR], [test $BUILD_OVSDBMONITOR = yes])])
 
+dnl Checks for missing python modules at build time
+AC_DEFUN([OVS_CHECK_PYTHON_COMPAT],
+  [OVS_CHECK_PYTHON_MODULE([uuid])
+   if test $ovs_cv_py_uuid = yes; then
+     INCLUDE_PYTHON_COMPAT=no
+   else
+     INCLUDE_PYTHON_COMPAT=yes
+   fi
+   AC_MSG_CHECKING([whether to add python/compat to PYTHONPATH])
+   AC_MSG_RESULT([$INCLUDE_PYTHON_COMPAT])
+   AM_CONDITIONAL([INCLUDE_PYTHON_COMPAT], [test $INCLUDE_PYTHON_COMPAT = yes])])
+
 # OVS_LINK2_IFELSE(SOURCE1, SOURCE2, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
 # -------------------------------------------------------------
 # Based on AC_LINK_IFELSE, but tries to link both SOURCE1 and SOURCE2
@@ -426,6 +432,12 @@ static thread_local int var;], [return var;])],
      fi
    fi])
 
+dnl OVS_CHECK_ATOMIC_LIBS
+dnl
+dnl Check to see if -latomic is need for GCC atomic built-ins.
+AC_DEFUN([OVS_CHECK_ATOMIC_LIBS],
+   [AC_SEARCH_LIBS([__atomic_load_8], [atomic])])
+
 dnl OVS_CHECK_GCC4_ATOMICS
 dnl
 dnl Checks whether the compiler and linker support GCC 4.0+ atomic built-ins.