# -*- autoconf -*-
-# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
;;
esac
fi])
+
+dnl OVS_CHECK_LINUX_HOST.
+dnl
+dnl Checks whether we're building for a Linux host, based on the presence of
+dnl the __linux__ preprocessor symbol, and sets up an Automake conditional
+dnl LINUX based on the result.
+AC_DEFUN([OVS_CHECK_LINUX_HOST],
+ [AC_CACHE_CHECK(
+ [whether __linux__ is defined],
+ [ovs_cv_linux],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([enum { LINUX = __linux__};], [])],
+ [ovs_cv_linux=true],
+ [ovs_cv_linux=false])])
+ AM_CONDITIONAL([LINUX], [$ovs_cv_linux])])
OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(8)
OVS_CHECK_POSIX_AIO
OVS_CHECK_PTHREAD_SET_NAME
+OVS_CHECK_LINUX_HOST
OVS_CHECK_INCLUDE_NEXT([stdio.h string.h])
AC_CONFIG_FILES([lib/stdio.h lib/string.h])
AC_CONFIG_COMMANDS([utilities/bugtool/dummy], [:])
-AM_CONDITIONAL([LINUX_DATAPATH], [test "$HAVE_NETLINK" = yes && test "$ESX" = no])
-if test "$HAVE_NETLINK" = yes && test "$ESX" = no; then
- AC_DEFINE([LINUX_DATAPATH], [1], [System uses the linux datapath module.])
-fi
-
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AC_OUTPUT
utilities_ovs_vsctl_SOURCES = utilities/ovs-vsctl.c
utilities_ovs_vsctl_LDADD = lib/libopenvswitch.la
-if LINUX_DATAPATH
+if LINUX
sbin_PROGRAMS += utilities/ovs-vlan-bug-workaround
utilities_ovs_vlan_bug_workaround_SOURCES = utilities/ovs-vlan-bug-workaround.c
utilities_ovs_vlan_bug_workaround_LDADD = lib/libopenvswitch.la