[PATCH 3 of 6] setup: detect statfs

Jun Wu quark at fb.com
Mon Mar 20 20:04:36 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1490047878 25200
#      Mon Mar 20 15:11:18 2017 -0700
# Node ID 8a5bf6002f2c9f98fbbe68c216579a7803693d65
# Parent  3706485e7df8662529498360cc09584b185dfcc7
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 8a5bf6002f2c
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.

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -591,7 +591,7 @@ 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())
 


More information about the Mercurial-devel mailing list