changeset 31561:312e62640798

setup: detect statfs statfs is not defined by POSIX but is available in various systems to help decide filesystem type. Let's detect it and set the macro HAVE_STATFS.
author Jun Wu <quark@fb.com>
date Mon, 20 Mar 2017 15:11:18 -0700
parents 5a0460219649
children 3db113eef95f
files setup.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Mon Mar 20 15:31:21 2017 -0700
+++ b/setup.py	Mon Mar 20 15:11:18 2017 -0700
@@ -590,9 +590,9 @@
 osutil_cflags = []
 osutil_ldflags = []
 
-# platform specific macros: HAVE_SETPROCTITLE
-for plat, func in [(re.compile('freebsd'), 'setproctitle')]:
-    if plat.search(sys.platform) and hasfunction(new_compiler(), func):
+# platform specific macros
+for plat, func in [('bsd', 'setproctitle'), ('bsd|darwin|linux', 'statfs')]:
+    if re.search(plat, sys.platform) and hasfunction(new_compiler(), func):
         osutil_cflags.append('-DHAVE_%s' % func.upper())
 
 if sys.platform == 'darwin':