equal
deleted
inserted
replaced
10 raise SystemExit, "Mercurial requires python 2.3 or later." |
10 raise SystemExit, "Mercurial requires python 2.3 or later." |
11 |
11 |
12 import os |
12 import os |
13 from distutils.core import setup, Extension |
13 from distutils.core import setup, Extension |
14 from distutils.command.install_data import install_data |
14 from distutils.command.install_data import install_data |
|
15 from distutils.ccompiler import new_compiler |
15 |
16 |
16 import mercurial.version |
17 import mercurial.version |
17 |
18 |
18 extra = {} |
19 extra = {} |
19 |
20 |
64 try: |
65 try: |
65 import posix |
66 import posix |
66 ext_modules.append(Extension('mercurial.osutil', ['mercurial/osutil.c'])) |
67 ext_modules.append(Extension('mercurial.osutil', ['mercurial/osutil.c'])) |
67 |
68 |
68 if sys.platform == 'linux2' and os.uname()[2] > '2.6': |
69 if sys.platform == 'linux2' and os.uname()[2] > '2.6': |
69 # the inotify extension is only usable with Linux 2.6 kernels |
70 # The inotify extension is only usable with Linux 2.6 kernels. |
70 ext_modules.append(Extension('hgext.inotify.linux._inotify', |
71 # You also need a reasonably recent C library. |
71 ['hgext/inotify/linux/_inotify.c'])) |
72 cc = new_compiler() |
72 packages.extend(['hgext.inotify', 'hgext.inotify.linux']) |
73 if cc.has_function('inotify_add_watch'): |
|
74 ext_modules.append(Extension('hgext.inotify.linux._inotify', |
|
75 ['hgext/inotify/linux/_inotify.c'])) |
|
76 packages.extend(['hgext.inotify', 'hgext.inotify.linux']) |
73 except ImportError: |
77 except ImportError: |
74 pass |
78 pass |
75 |
79 |
76 setup(name='mercurial', |
80 setup(name='mercurial', |
77 version=mercurial.version.get_version(), |
81 version=mercurial.version.get_version(), |