setup.py
changeset 31622 2243ba216f66
parent 31596 ab51a2b18f87
child 32125 efcaf6ab86f4
--- a/setup.py	Fri Mar 24 16:20:10 2017 -0700
+++ b/setup.py	Fri Mar 24 14:59:19 2017 -0700
@@ -591,24 +591,21 @@
 osutil_ldflags = []
 
 # platform specific macros
-for plat, func in [('bsd', 'setproctitle'), ('bsd|darwin|linux', 'statfs')]:
+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 [
-    ('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)
-
 for plat, macro, code in [
     ('bsd|darwin', 'BSD_STATFS', '''
      #include <sys/param.h>
      #include <sys/mount.h>
      int main() { struct statfs s; return sizeof(s.f_fstypename); }
      '''),
+    ('linux', 'LINUX_STATFS', '''
+     #include <linux/magic.h>
+     #include <sys/vfs.h>
+     int main() { struct statfs s; return sizeof(s.f_type); }
+     '''),
 ]:
     if re.search(plat, sys.platform) and cancompile(new_compiler(), code):
         osutil_cflags.append('-DHAVE_%s' % macro)