summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2014-01-23 15:35:22 -0800
committerBen Pfaff <blp@nicira.com>2014-03-05 07:51:56 -0800
commit5020f5f099526ec224ba0b1703806b42ebdaee5a (patch)
tree74a54d881dc5758111e0ee94696940d0190094bd /acinclude.m4
parent2f51a7ebdaeb1067e3eef873c62f6c22989c9aad (diff)
downloadopenvswitch-5020f5f099526ec224ba0b1703806b42ebdaee5a.tar.gz
Makefile: Compile Linux-specific files based on __linux__ macro.
We want to conditionally compile several files based on whether we're building for a Linux host, so we need some Automake conditional for that. Previously this was based on whether Netlink is available and we're not on ESX (since ESX has Netlink but isn't Linux), but it's more straightforward to just test for Linux directly. CC: Luigi Rizzo <rizzo@iet.unipi.it> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m417
1 files changed, 16 insertions, 1 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 8ff58280e..830fd3f0d 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,6 +1,6 @@
# -*- 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.
@@ -579,3 +579,18 @@ AC_DEFUN([OVS_CHECK_PTHREAD_SET_NAME],
;;
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])])