diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -595,6 +595,16 @@ for plat, func in [('bsd', 'setproctitle if re.search(plat, sys.platform) and hasfunction(new_compiler(), func): osutil_cflags.append('-DHAVE_%s' % func.upper()) +for plat, header in [ + ('bsd|darwin|linux', 'sys/mount.h'), + ('bsd|darwin|linux', 'sys/param.h'), + ('linux', 'linux/magic.h'), + ('linux', 'sys/vfs.h'), +]: + if re.search(plat, sys.platform) and hasheader(new_compiler(), header): + macro = header.replace('/', '_').replace('.', '_').upper() + osutil_cflags.append('-DHAVE_%s' % macro) + if sys.platform == 'darwin': osutil_ldflags += ['-framework', 'ApplicationServices']