setup.py
changeset 31622 2243ba216f66
parent 31596 ab51a2b18f87
child 32125 efcaf6ab86f4
equal deleted inserted replaced
31621:b26975483841 31622:2243ba216f66
   589 
   589 
   590 osutil_cflags = []
   590 osutil_cflags = []
   591 osutil_ldflags = []
   591 osutil_ldflags = []
   592 
   592 
   593 # platform specific macros
   593 # platform specific macros
   594 for plat, func in [('bsd', 'setproctitle'), ('bsd|darwin|linux', 'statfs')]:
   594 for plat, func in [('bsd', 'setproctitle')]:
   595     if re.search(plat, sys.platform) and hasfunction(new_compiler(), func):
   595     if re.search(plat, sys.platform) and hasfunction(new_compiler(), func):
   596         osutil_cflags.append('-DHAVE_%s' % func.upper())
   596         osutil_cflags.append('-DHAVE_%s' % func.upper())
   597 
       
   598 for plat, header in [
       
   599     ('linux', 'linux/magic.h'),
       
   600     ('linux', 'sys/vfs.h'),
       
   601 ]:
       
   602     if re.search(plat, sys.platform) and hasheader(new_compiler(), header):
       
   603         macro = header.replace('/', '_').replace('.', '_').upper()
       
   604         osutil_cflags.append('-DHAVE_%s' % macro)
       
   605 
   597 
   606 for plat, macro, code in [
   598 for plat, macro, code in [
   607     ('bsd|darwin', 'BSD_STATFS', '''
   599     ('bsd|darwin', 'BSD_STATFS', '''
   608      #include <sys/param.h>
   600      #include <sys/param.h>
   609      #include <sys/mount.h>
   601      #include <sys/mount.h>
   610      int main() { struct statfs s; return sizeof(s.f_fstypename); }
   602      int main() { struct statfs s; return sizeof(s.f_fstypename); }
       
   603      '''),
       
   604     ('linux', 'LINUX_STATFS', '''
       
   605      #include <linux/magic.h>
       
   606      #include <sys/vfs.h>
       
   607      int main() { struct statfs s; return sizeof(s.f_type); }
   611      '''),
   608      '''),
   612 ]:
   609 ]:
   613     if re.search(plat, sys.platform) and cancompile(new_compiler(), code):
   610     if re.search(plat, sys.platform) and cancompile(new_compiler(), code):
   614         osutil_cflags.append('-DHAVE_%s' % macro)
   611         osutil_cflags.append('-DHAVE_%s' % macro)
   615 
   612