setup.py
changeset 19724 2b2a2e858fb7
parent 18905 012780620d4f
child 20622 352abbb0be88
equal deleted inserted replaced
19723:7999f4fa155a 19724:2b2a2e858fb7
   421             'hgext', 'hgext.convert', 'hgext.highlight', 'hgext.zeroconf',
   421             'hgext', 'hgext.convert', 'hgext.highlight', 'hgext.zeroconf',
   422             'hgext.largefiles']
   422             'hgext.largefiles']
   423 
   423 
   424 pymodules = []
   424 pymodules = []
   425 
   425 
       
   426 common_depends = ['mercurial/util.h']
       
   427 
   426 extmodules = [
   428 extmodules = [
   427     Extension('mercurial.base85', ['mercurial/base85.c']),
   429     Extension('mercurial.base85', ['mercurial/base85.c'],
   428     Extension('mercurial.bdiff', ['mercurial/bdiff.c']),
   430               depends=common_depends),
   429     Extension('mercurial.diffhelpers', ['mercurial/diffhelpers.c']),
   431     Extension('mercurial.bdiff', ['mercurial/bdiff.c'],
   430     Extension('mercurial.mpatch', ['mercurial/mpatch.c']),
   432               depends=common_depends),
       
   433     Extension('mercurial.diffhelpers', ['mercurial/diffhelpers.c'],
       
   434               depends=common_depends),
       
   435     Extension('mercurial.mpatch', ['mercurial/mpatch.c'],
       
   436               depends=common_depends),
   431     Extension('mercurial.parsers', ['mercurial/dirs.c',
   437     Extension('mercurial.parsers', ['mercurial/dirs.c',
   432                                     'mercurial/parsers.c',
   438                                     'mercurial/parsers.c',
   433                                     'mercurial/pathencode.c']),
   439                                     'mercurial/pathencode.c'],
       
   440               depends=common_depends),
   434     ]
   441     ]
   435 
   442 
   436 osutil_ldflags = []
   443 osutil_ldflags = []
   437 
   444 
   438 if sys.platform == 'darwin':
   445 if sys.platform == 'darwin':
   441 # disable osutil.c under windows + python 2.4 (issue1364)
   448 # disable osutil.c under windows + python 2.4 (issue1364)
   442 if sys.platform == 'win32' and sys.version_info < (2, 5, 0, 'final'):
   449 if sys.platform == 'win32' and sys.version_info < (2, 5, 0, 'final'):
   443     pymodules.append('mercurial.pure.osutil')
   450     pymodules.append('mercurial.pure.osutil')
   444 else:
   451 else:
   445     extmodules.append(Extension('mercurial.osutil', ['mercurial/osutil.c'],
   452     extmodules.append(Extension('mercurial.osutil', ['mercurial/osutil.c'],
   446                                 extra_link_args=osutil_ldflags))
   453                                 extra_link_args=osutil_ldflags,
       
   454                                 depends=common_depends))
   447 
   455 
   448 # the -mno-cygwin option has been deprecated for years
   456 # the -mno-cygwin option has been deprecated for years
   449 Mingw32CCompiler = cygwinccompiler.Mingw32CCompiler
   457 Mingw32CCompiler = cygwinccompiler.Mingw32CCompiler
   450 
   458 
   451 class HackedMingw32CCompiler(cygwinccompiler.Mingw32CCompiler):
   459 class HackedMingw32CCompiler(cygwinccompiler.Mingw32CCompiler):
   465     # In any case, if it fails to build the error will be skipped ('optional').
   473     # In any case, if it fails to build the error will be skipped ('optional').
   466     cc = new_compiler()
   474     cc = new_compiler()
   467     if hasfunction(cc, 'inotify_add_watch'):
   475     if hasfunction(cc, 'inotify_add_watch'):
   468         inotify = Extension('hgext.inotify.linux._inotify',
   476         inotify = Extension('hgext.inotify.linux._inotify',
   469                             ['hgext/inotify/linux/_inotify.c'],
   477                             ['hgext/inotify/linux/_inotify.c'],
   470                             ['mercurial'])
   478                             ['mercurial'],
       
   479                             depends=common_depends)
   471         inotify.optional = True
   480         inotify.optional = True
   472         extmodules.append(inotify)
   481         extmodules.append(inotify)
   473         packages.extend(['hgext.inotify', 'hgext.inotify.linux'])
   482         packages.extend(['hgext.inotify', 'hgext.inotify.linux'])
   474 
   483 
   475 packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo',
   484 packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo',