# HG changeset patch # User Jun Wu # Date 2017-03-20 22:11:18 # Node ID 312e6264079824a7b2a2d6ad05ac2d88e2fb3228 # Parent 5a046021964996c49b87e3499af2c45b26fa3788 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 @@ -590,9 +590,9 @@ common_depends = ['mercurial/bitmanipula 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':