comparison contrib/setup3k.py @ 15151:0d4f6e843b05

building: build inotify for sys.platform='linux*' If Python interpreter was built under Linux 3.x kernel, it reports sys.platform to be 'linux3' (it is fixed for Python 3, but not for 2.x). This cancels building inotify extension, which was built only for 'linux2' platform. Improved test checks if sys.platform begins with 'linux', and together with test for kernel version to be greater than 2.6 it seems to cover all known cases.
author Nikolaj Sjujskij <sterkrig@myopera.com>
date Tue, 20 Sep 2011 15:21:27 +0300
parents bcba68e81a81
children 8df4166b6f63
comparison
equal deleted inserted replaced
15150:91dc8878f888 15151:0d4f6e843b05
307 if sys.platform == 'win32' and sys.version_info < (2, 5, 0, 'final'): 307 if sys.platform == 'win32' and sys.version_info < (2, 5, 0, 'final'):
308 pymodules.append('mercurial.pure.osutil') 308 pymodules.append('mercurial.pure.osutil')
309 else: 309 else:
310 extmodules.append(Extension('mercurial.osutil', ['mercurial/osutil.c'])) 310 extmodules.append(Extension('mercurial.osutil', ['mercurial/osutil.c']))
311 311
312 if sys.platform == 'linux2' and os.uname()[2] > '2.6': 312 if sys.platform.startswith('linux') and os.uname()[2] > '2.6':
313 # The inotify extension is only usable with Linux 2.6 kernels. 313 # The inotify extension is only usable with Linux 2.6 kernels.
314 # You also need a reasonably recent C library. 314 # You also need a reasonably recent C library.
315 # In any case, if it fails to build the error will be skipped ('optional'). 315 # In any case, if it fails to build the error will be skipped ('optional').
316 cc = new_compiler() 316 cc = new_compiler()
317 if hasfunction(cc, 'inotify_add_watch'): 317 if hasfunction(cc, 'inotify_add_watch'):