Mercurial > cpython-lru_cache-weakref
annotate setup.py @ 24477:b38754f1cb61 legacy-trunk
Fix for
[ 589427 ] standard include paths on command line
| author | Michael W. Hudson <mwh@python.net> |
|---|---|
| date | Fri, 02 Aug 2002 13:55:50 +0000 |
| parents | e9e6111beec1 |
| children | 0cf4e0539cc1 |
| rev | line source |
|---|---|
|
16287
4b72888c9e2f
Remove unused import of 'string'
Andrew M. Kuchling <amk@amk.ca>
parents:
16283
diff
changeset
|
1 # Autodetecting setup.py script for building the Python extensions |
|
4b72888c9e2f
Remove unused import of 'string'
Andrew M. Kuchling <amk@amk.ca>
parents:
16283
diff
changeset
|
2 # |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
3 |
|
16287
4b72888c9e2f
Remove unused import of 'string'
Andrew M. Kuchling <amk@amk.ca>
parents:
16283
diff
changeset
|
4 __version__ = "$Revision$" |
|
4b72888c9e2f
Remove unused import of 'string'
Andrew M. Kuchling <amk@amk.ca>
parents:
16283
diff
changeset
|
5 |
| 21788 | 6 import sys, os, getopt, imp |
| 15940 | 7 from distutils import sysconfig |
|
16750
90e90c92198b
Patch #103899: Don't compile modules configured in Setup. This seems much
Andrew M. Kuchling <amk@amk.ca>
parents:
16749
diff
changeset
|
8 from distutils import text_file |
|
16282
ea4a2f3b266e
Fixed setup.py to allow:
Marc-André Lemburg <mal@egenix.com>
parents:
16225
diff
changeset
|
9 from distutils.errors import * |
| 15940 | 10 from distutils.core import Extension, setup |
| 11 from distutils.command.build_ext import build_ext | |
|
17886
0af824c88203
Fix bug #232619: fix misleading warning on installing to lib-dynload
Andrew M. Kuchling <amk@amk.ca>
parents:
17531
diff
changeset
|
12 from distutils.command.install import install |
| 15940 | 13 |
| 14 # This global variable is used to hold the list of modules to be disabled. | |
| 15 disabled_module_list = [] | |
| 16 | |
|
21742
9d5adff87f30
Apply a variant of patch
Michael W. Hudson <mwh@python.net>
parents:
21610
diff
changeset
|
17 def add_dir_to_list(dirlist, dir): |
|
9d5adff87f30
Apply a variant of patch
Michael W. Hudson <mwh@python.net>
parents:
21610
diff
changeset
|
18 """Add the directory 'dir' to the list 'dirlist' (at the front) if |
|
9d5adff87f30
Apply a variant of patch
Michael W. Hudson <mwh@python.net>
parents:
21610
diff
changeset
|
19 1) 'dir' is not already in 'dirlist' |
|
9d5adff87f30
Apply a variant of patch
Michael W. Hudson <mwh@python.net>
parents:
21610
diff
changeset
|
20 2) 'dir' actually exists, and is a directory.""" |
|
24008
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
21 if dir is not None and os.path.isdir(dir) and dir not in dirlist: |
|
21742
9d5adff87f30
Apply a variant of patch
Michael W. Hudson <mwh@python.net>
parents:
21610
diff
changeset
|
22 dirlist.insert(0, dir) |
|
9d5adff87f30
Apply a variant of patch
Michael W. Hudson <mwh@python.net>
parents:
21610
diff
changeset
|
23 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
24 def find_file(filename, std_dirs, paths): |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
25 """Searches for the directory where a given file is located, |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
26 and returns a possibly-empty list of additional directories, or None |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
27 if the file couldn't be found at all. |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
28 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
29 'filename' is the name of a file, such as readline.h or libcrypto.a. |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
30 'std_dirs' is the list of standard system directories; if the |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
31 file is found in one of them, no additional directives are needed. |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
32 'paths' is a list of additional locations to check; if the file is |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
33 found in one of them, the resulting list will contain the directory. |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
34 """ |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
35 |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
36 # Check the standard locations |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
37 for dir in std_dirs: |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
38 f = os.path.join(dir, filename) |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
39 if os.path.exists(f): return [] |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
40 |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
41 # Check the additional directories |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
42 for dir in paths: |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
43 f = os.path.join(dir, filename) |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
44 if os.path.exists(f): |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
45 return [dir] |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
46 |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
47 # Not found anywhere |
| 15940 | 48 return None |
| 49 | |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
50 def find_library_file(compiler, libname, std_dirs, paths): |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
51 filename = compiler.library_filename(libname, lib_type='shared') |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
52 result = find_file(filename, std_dirs, paths) |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
53 if result is not None: return result |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
54 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
55 filename = compiler.library_filename(libname, lib_type='static') |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
56 result = find_file(filename, std_dirs, paths) |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
57 return result |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
58 |
| 15940 | 59 def module_enabled(extlist, modname): |
| 60 """Returns whether the module 'modname' is present in the list | |
| 61 of extensions 'extlist'.""" | |
| 62 extlist = [ext for ext in extlist if ext.name == modname] | |
| 63 return len(extlist) | |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
64 |
|
19007
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
65 def find_module_file(module, dirlist): |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
66 """Find a module in a set of possible folders. If it is not found |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
67 return the unadorned filename""" |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
68 list = find_file(module, [], dirlist) |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
69 if not list: |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
70 return module |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
71 if len(list) > 1: |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
72 self.announce("WARNING: multiple copies of %s found"%module) |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
73 return os.path.join(list[0], module) |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
74 |
| 15940 | 75 class PyBuildExt(build_ext): |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
76 |
| 15940 | 77 def build_extensions(self): |
| 78 | |
| 79 # Detect which modules should be compiled | |
| 80 self.detect_modules() | |
| 81 | |
| 82 # Remove modules that are present on the disabled list | |
| 83 self.extensions = [ext for ext in self.extensions | |
| 84 if ext.name not in disabled_module_list] | |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
85 |
| 15940 | 86 # Fix up the autodetected modules, prefixing all the source files |
| 87 # with Modules/ and adding Python's include directory to the path. | |
| 88 (srcdir,) = sysconfig.get_config_vars('srcdir') | |
| 89 | |
|
16225
e56dd2dd9960
Patch from Andrew to properly set module source directory.
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents:
16201
diff
changeset
|
90 # Figure out the location of the source code for extension modules |
|
e56dd2dd9960
Patch from Andrew to properly set module source directory.
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents:
16201
diff
changeset
|
91 moddir = os.path.join(os.getcwd(), srcdir, 'Modules') |
| 15940 | 92 moddir = os.path.normpath(moddir) |
| 93 srcdir, tail = os.path.split(moddir) | |
| 94 srcdir = os.path.normpath(srcdir) | |
| 95 moddir = os.path.normpath(moddir) | |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
96 |
|
19007
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
97 moddirlist = [moddir] |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
98 incdirlist = ['./Include'] |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
99 |
|
19007
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
100 # Platform-dependent module source and include directories |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
101 platform = self.get_platform() |
|
24008
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
102 if platform in ('darwin', 'mac'): |
|
19007
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
103 # Mac OS X also includes some mac-specific modules |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
104 macmoddir = os.path.join(os.getcwd(), srcdir, 'Mac/Modules') |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
105 moddirlist.append(macmoddir) |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
106 incdirlist.append('./Mac/Include') |
| 15940 | 107 |
|
23825
9f0009ca97b9
Munge depends files to have absolute paths.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
23816
diff
changeset
|
108 alldirlist = moddirlist + incdirlist |
|
9f0009ca97b9
Munge depends files to have absolute paths.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
23816
diff
changeset
|
109 |
|
16860
cd4085cee309
Fix for bug #405007: prefix subdir to scripts in order to build in
Andrew M. Kuchling <amk@amk.ca>
parents:
16844
diff
changeset
|
110 # Fix up the paths for scripts, too |
|
cd4085cee309
Fix for bug #405007: prefix subdir to scripts in order to build in
Andrew M. Kuchling <amk@amk.ca>
parents:
16844
diff
changeset
|
111 self.distribution.scripts = [os.path.join(srcdir, filename) |
|
cd4085cee309
Fix for bug #405007: prefix subdir to scripts in order to build in
Andrew M. Kuchling <amk@amk.ca>
parents:
16844
diff
changeset
|
112 for filename in self.distribution.scripts] |
|
cd4085cee309
Fix for bug #405007: prefix subdir to scripts in order to build in
Andrew M. Kuchling <amk@amk.ca>
parents:
16844
diff
changeset
|
113 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
114 for ext in self.extensions[:]: |
|
19007
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
115 ext.sources = [ find_module_file(filename, moddirlist) |
| 15940 | 116 for filename in ext.sources ] |
|
23825
9f0009ca97b9
Munge depends files to have absolute paths.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
23816
diff
changeset
|
117 if ext.depends is not None: |
|
9f0009ca97b9
Munge depends files to have absolute paths.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
23816
diff
changeset
|
118 ext.depends = [find_module_file(filename, alldirlist) |
|
9f0009ca97b9
Munge depends files to have absolute paths.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
23816
diff
changeset
|
119 for filename in ext.depends] |
|
19007
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
120 ext.include_dirs.append( '.' ) # to get config.h |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
121 for incdir in incdirlist: |
|
cefdcd60a8b2
Replace moddir and incdir by
Jack Jansen <jack.jansen@cwi.nl>
parents:
18845
diff
changeset
|
122 ext.include_dirs.append( os.path.join(srcdir, incdir) ) |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
123 |
|
16038
b6863ba88989
GvR pointed out the correct way to check for statically built modules;
Andrew M. Kuchling <amk@amk.ca>
parents:
16013
diff
changeset
|
124 # If a module has already been built statically, |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
125 # don't build it here |
|
16038
b6863ba88989
GvR pointed out the correct way to check for statically built modules;
Andrew M. Kuchling <amk@amk.ca>
parents:
16013
diff
changeset
|
126 if ext.name in sys.builtin_module_names: |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
127 self.extensions.remove(ext) |
|
15998
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
128 |
|
24008
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
129 if platform != 'mac': |
|
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
130 # Parse Modules/Setup to figure out which modules are turned |
|
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
131 # on in the file. |
|
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
132 input = text_file.TextFile('Modules/Setup', join_lines=1) |
|
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
133 remove_modules = [] |
|
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
134 while 1: |
|
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
135 line = input.readline() |
|
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
136 if not line: break |
|
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
137 line = line.split() |
|
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
138 remove_modules.append( line[0] ) |
|
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
139 input.close() |
|
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
140 |
|
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
141 for ext in self.extensions[:]: |
|
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
142 if ext.name in remove_modules: |
|
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
143 self.extensions.remove(ext) |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
144 |
|
15998
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
145 # When you run "make CC=altcc" or something similar, you really want |
|
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
146 # those environment variables passed into the setup.py phase. Here's |
|
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
147 # a small set of useful ones. |
|
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
148 compiler = os.environ.get('CC') |
|
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
149 linker_so = os.environ.get('LDSHARED') |
|
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
150 args = {} |
|
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
151 # unfortunately, distutils doesn't let us provide separate C and C++ |
|
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
152 # compilers |
|
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
153 if compiler is not None: |
|
19122
6729bf30d3ae
Get OPT from the environment to build the CCSHARED command.
Martin v. Löwis <martin@v.loewis.de>
parents:
19049
diff
changeset
|
154 (ccshared,opt) = sysconfig.get_config_vars('CCSHARED','OPT') |
|
6729bf30d3ae
Get OPT from the environment to build the CCSHARED command.
Martin v. Löwis <martin@v.loewis.de>
parents:
19049
diff
changeset
|
155 args['compiler_so'] = compiler + ' ' + opt + ' ' + ccshared |
|
15998
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
156 if linker_so is not None: |
|
20313
ea1910d2c781
Do not add -shared to linker_so. Any necessary options should already be
Martin v. Löwis <martin@v.loewis.de>
parents:
20234
diff
changeset
|
157 args['linker_so'] = linker_so |
|
15998
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
158 self.compiler.set_executables(**args) |
|
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
159 |
| 15940 | 160 build_ext.build_extensions(self) |
| 161 | |
|
16282
ea4a2f3b266e
Fixed setup.py to allow:
Marc-André Lemburg <mal@egenix.com>
parents:
16225
diff
changeset
|
162 def build_extension(self, ext): |
|
ea4a2f3b266e
Fixed setup.py to allow:
Marc-André Lemburg <mal@egenix.com>
parents:
16225
diff
changeset
|
163 |
|
ea4a2f3b266e
Fixed setup.py to allow:
Marc-André Lemburg <mal@egenix.com>
parents:
16225
diff
changeset
|
164 try: |
|
ea4a2f3b266e
Fixed setup.py to allow:
Marc-André Lemburg <mal@egenix.com>
parents:
16225
diff
changeset
|
165 build_ext.build_extension(self, ext) |
|
ea4a2f3b266e
Fixed setup.py to allow:
Marc-André Lemburg <mal@egenix.com>
parents:
16225
diff
changeset
|
166 except (CCompilerError, DistutilsError), why: |
|
ea4a2f3b266e
Fixed setup.py to allow:
Marc-André Lemburg <mal@egenix.com>
parents:
16225
diff
changeset
|
167 self.announce('WARNING: building of extension "%s" failed: %s' % |
|
ea4a2f3b266e
Fixed setup.py to allow:
Marc-André Lemburg <mal@egenix.com>
parents:
16225
diff
changeset
|
168 (ext.name, sys.exc_info()[1])) |
|
17890
a1ddc4080cc5
Patch #411055 from MvL: import each extension after building it, and
Andrew M. Kuchling <amk@amk.ca>
parents:
17889
diff
changeset
|
169 return |
|
20815
57ab65c2f170
The import check in setup.py fails on Mac OS X for Carbon-based modules
Jack Jansen <jack.jansen@cwi.nl>
parents:
20789
diff
changeset
|
170 # Workaround for Mac OS X: The Carbon-based modules cannot be |
|
57ab65c2f170
The import check in setup.py fails on Mac OS X for Carbon-based modules
Jack Jansen <jack.jansen@cwi.nl>
parents:
20789
diff
changeset
|
171 # reliably imported into a command-line Python |
|
57ab65c2f170
The import check in setup.py fails on Mac OS X for Carbon-based modules
Jack Jansen <jack.jansen@cwi.nl>
parents:
20789
diff
changeset
|
172 if 'Carbon' in ext.extra_link_args: |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
173 self.announce( |
|
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
174 'WARNING: skipping import check for Carbon-based "%s"' % |
|
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
175 ext.name) |
|
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
176 return |
|
23513
35f01bf34d60
Patch #491107: Cygwin setup.py import workaround patch
Jason Tishler <jason@tishler.net>
parents:
22805
diff
changeset
|
177 # Workaround for Cygwin: Cygwin currently has fork issues when many |
|
35f01bf34d60
Patch #491107: Cygwin setup.py import workaround patch
Jason Tishler <jason@tishler.net>
parents:
22805
diff
changeset
|
178 # modules have been imported |
|
35f01bf34d60
Patch #491107: Cygwin setup.py import workaround patch
Jason Tishler <jason@tishler.net>
parents:
22805
diff
changeset
|
179 if self.get_platform() == 'cygwin': |
|
35f01bf34d60
Patch #491107: Cygwin setup.py import workaround patch
Jason Tishler <jason@tishler.net>
parents:
22805
diff
changeset
|
180 self.announce('WARNING: skipping import check for Cygwin-based "%s"' |
|
35f01bf34d60
Patch #491107: Cygwin setup.py import workaround patch
Jason Tishler <jason@tishler.net>
parents:
22805
diff
changeset
|
181 % ext.name) |
|
35f01bf34d60
Patch #491107: Cygwin setup.py import workaround patch
Jason Tishler <jason@tishler.net>
parents:
22805
diff
changeset
|
182 return |
| 21788 | 183 ext_filename = os.path.join( |
| 184 self.build_lib, | |
| 185 self.get_ext_filename(self.get_ext_fullname(ext.name))) | |
|
17890
a1ddc4080cc5
Patch #411055 from MvL: import each extension after building it, and
Andrew M. Kuchling <amk@amk.ca>
parents:
17889
diff
changeset
|
186 try: |
| 21788 | 187 imp.load_dynamic(ext.name, ext_filename) |
|
21959
3957d155f8c5
Break SSL support out of _socket module and place it into a new
Marc-André Lemburg <mal@egenix.com>
parents:
21942
diff
changeset
|
188 except ImportError, why: |
|
16282
ea4a2f3b266e
Fixed setup.py to allow:
Marc-André Lemburg <mal@egenix.com>
parents:
16225
diff
changeset
|
189 |
|
21959
3957d155f8c5
Break SSL support out of _socket module and place it into a new
Marc-André Lemburg <mal@egenix.com>
parents:
21942
diff
changeset
|
190 if 1: |
|
22104
cd0ce470c153
Changes to what we do to modules that don't import, as
Michael W. Hudson <mwh@python.net>
parents:
21959
diff
changeset
|
191 self.announce('*** WARNING: renaming "%s" since importing it' |
|
21959
3957d155f8c5
Break SSL support out of _socket module and place it into a new
Marc-André Lemburg <mal@egenix.com>
parents:
21942
diff
changeset
|
192 ' failed: %s' % (ext.name, why)) |
|
3957d155f8c5
Break SSL support out of _socket module and place it into a new
Marc-André Lemburg <mal@egenix.com>
parents:
21942
diff
changeset
|
193 assert not self.inplace |
|
22104
cd0ce470c153
Changes to what we do to modules that don't import, as
Michael W. Hudson <mwh@python.net>
parents:
21959
diff
changeset
|
194 basename, tail = os.path.splitext(ext_filename) |
|
cd0ce470c153
Changes to what we do to modules that don't import, as
Michael W. Hudson <mwh@python.net>
parents:
21959
diff
changeset
|
195 newname = basename + "_failed" + tail |
|
cd0ce470c153
Changes to what we do to modules that don't import, as
Michael W. Hudson <mwh@python.net>
parents:
21959
diff
changeset
|
196 if os.path.exists(newname): os.remove(newname) |
|
cd0ce470c153
Changes to what we do to modules that don't import, as
Michael W. Hudson <mwh@python.net>
parents:
21959
diff
changeset
|
197 os.rename(ext_filename, newname) |
|
21959
3957d155f8c5
Break SSL support out of _socket module and place it into a new
Marc-André Lemburg <mal@egenix.com>
parents:
21942
diff
changeset
|
198 |
|
3957d155f8c5
Break SSL support out of _socket module and place it into a new
Marc-André Lemburg <mal@egenix.com>
parents:
21942
diff
changeset
|
199 # XXX -- This relies on a Vile HACK in |
|
3957d155f8c5
Break SSL support out of _socket module and place it into a new
Marc-André Lemburg <mal@egenix.com>
parents:
21942
diff
changeset
|
200 # distutils.command.build_ext.build_extension(). The |
|
3957d155f8c5
Break SSL support out of _socket module and place it into a new
Marc-André Lemburg <mal@egenix.com>
parents:
21942
diff
changeset
|
201 # _built_objects attribute is stored there strictly for |
|
3957d155f8c5
Break SSL support out of _socket module and place it into a new
Marc-André Lemburg <mal@egenix.com>
parents:
21942
diff
changeset
|
202 # use here. |
|
22545
142fd3e1073d
Fix SF # 532618 517704, install problems when building modules fail.
Neal Norwitz <nnorwitz@gmail.com>
parents:
22159
diff
changeset
|
203 # If there is a failure, _built_objects may not be there, |
|
142fd3e1073d
Fix SF # 532618 517704, install problems when building modules fail.
Neal Norwitz <nnorwitz@gmail.com>
parents:
22159
diff
changeset
|
204 # so catch the AttributeError and move on. |
|
142fd3e1073d
Fix SF # 532618 517704, install problems when building modules fail.
Neal Norwitz <nnorwitz@gmail.com>
parents:
22159
diff
changeset
|
205 try: |
|
142fd3e1073d
Fix SF # 532618 517704, install problems when building modules fail.
Neal Norwitz <nnorwitz@gmail.com>
parents:
22159
diff
changeset
|
206 for filename in self._built_objects: |
|
142fd3e1073d
Fix SF # 532618 517704, install problems when building modules fail.
Neal Norwitz <nnorwitz@gmail.com>
parents:
22159
diff
changeset
|
207 os.remove(filename) |
|
142fd3e1073d
Fix SF # 532618 517704, install problems when building modules fail.
Neal Norwitz <nnorwitz@gmail.com>
parents:
22159
diff
changeset
|
208 except AttributeError: |
|
142fd3e1073d
Fix SF # 532618 517704, install problems when building modules fail.
Neal Norwitz <nnorwitz@gmail.com>
parents:
22159
diff
changeset
|
209 self.announce('unable to remove files (ignored)') |
|
21959
3957d155f8c5
Break SSL support out of _socket module and place it into a new
Marc-André Lemburg <mal@egenix.com>
parents:
21942
diff
changeset
|
210 else: |
|
3957d155f8c5
Break SSL support out of _socket module and place it into a new
Marc-André Lemburg <mal@egenix.com>
parents:
21942
diff
changeset
|
211 self.announce('*** WARNING: importing extension "%s" ' |
|
3957d155f8c5
Break SSL support out of _socket module and place it into a new
Marc-André Lemburg <mal@egenix.com>
parents:
21942
diff
changeset
|
212 'failed: %s' % (ext.name, why)) |
|
21277
f702ff390e4d
Visious hackery to solve a build-control problem related to our use of
Fred Drake <fdrake@acm.org>
parents:
21274
diff
changeset
|
213 |
|
16192
4fe69a9f8b30
Modified version of part of patch #102409 for Cygwin:
Andrew M. Kuchling <amk@amk.ca>
parents:
16176
diff
changeset
|
214 def get_platform (self): |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
215 # Get value of sys.platform |
|
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
216 platform = sys.platform |
|
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
217 if platform[:6] =='cygwin': |
|
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
218 platform = 'cygwin' |
|
16471
ab02bc6a5ab2
BeOS doesn't have a libm.a, either; noted by Donn Cave
Andrew M. Kuchling <amk@amk.ca>
parents:
16468
diff
changeset
|
219 elif platform[:4] =='beos': |
|
ab02bc6a5ab2
BeOS doesn't have a libm.a, either; noted by Donn Cave
Andrew M. Kuchling <amk@amk.ca>
parents:
16468
diff
changeset
|
220 platform = 'beos' |
|
21233
803ccbe3ee7c
As of OS X 10.1.1 the version numbering scheme has changed. Convert all "darwin*" to "darwin" and use that for testing.
Jack Jansen <jack.jansen@cwi.nl>
parents:
21039
diff
changeset
|
221 elif platform[:6] == 'darwin': |
|
803ccbe3ee7c
As of OS X 10.1.1 the version numbering scheme has changed. Convert all "darwin*" to "darwin" and use that for testing.
Jack Jansen <jack.jansen@cwi.nl>
parents:
21039
diff
changeset
|
222 platform = 'darwin' |
|
23777
bec1b942e0bc
Patch #488073: AtheOS port.
Martin v. Löwis <martin@v.loewis.de>
parents:
23659
diff
changeset
|
223 elif platform[:6] == 'atheos': |
|
bec1b942e0bc
Patch #488073: AtheOS port.
Martin v. Löwis <martin@v.loewis.de>
parents:
23659
diff
changeset
|
224 platform = 'atheos' |
|
16192
4fe69a9f8b30
Modified version of part of patch #102409 for Cygwin:
Andrew M. Kuchling <amk@amk.ca>
parents:
16176
diff
changeset
|
225 |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
226 return platform |
|
16192
4fe69a9f8b30
Modified version of part of patch #102409 for Cygwin:
Andrew M. Kuchling <amk@amk.ca>
parents:
16176
diff
changeset
|
227 |
| 15940 | 228 def detect_modules(self): |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
229 # Ensure that /usr/local is always used |
|
21742
9d5adff87f30
Apply a variant of patch
Michael W. Hudson <mwh@python.net>
parents:
21610
diff
changeset
|
230 add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') |
|
9d5adff87f30
Apply a variant of patch
Michael W. Hudson <mwh@python.net>
parents:
21610
diff
changeset
|
231 add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') |
|
9d5adff87f30
Apply a variant of patch
Michael W. Hudson <mwh@python.net>
parents:
21610
diff
changeset
|
232 |
| 24477 | 233 if os.path.normpath(sys.prefix) != '/usr': |
| 234 add_dir_to_list(self.compiler.library_dirs, | |
| 235 sysconfig.get_config_var("LIBDIR")) | |
| 236 add_dir_to_list(self.compiler.include_dirs, | |
| 237 sysconfig.get_config_var("INCLUDEDIR")) | |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
238 |
|
19343
7257e87e0720
Patch #445762: Support --disable-unicode
Martin v. Löwis <martin@v.loewis.de>
parents:
19319
diff
changeset
|
239 try: |
|
7257e87e0720
Patch #445762: Support --disable-unicode
Martin v. Löwis <martin@v.loewis.de>
parents:
19319
diff
changeset
|
240 have_unicode = unicode |
|
7257e87e0720
Patch #445762: Support --disable-unicode
Martin v. Löwis <martin@v.loewis.de>
parents:
19319
diff
changeset
|
241 except NameError: |
|
7257e87e0720
Patch #445762: Support --disable-unicode
Martin v. Löwis <martin@v.loewis.de>
parents:
19319
diff
changeset
|
242 have_unicode = 0 |
|
7257e87e0720
Patch #445762: Support --disable-unicode
Martin v. Löwis <martin@v.loewis.de>
parents:
19319
diff
changeset
|
243 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
244 # lib_dirs and inc_dirs are used to search for files; |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
245 # if a file is found in one of those directories, it can |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
246 # be assumed that no additional -I,-L directives are needed. |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
247 lib_dirs = self.compiler.library_dirs + ['/lib', '/usr/lib'] |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
248 inc_dirs = self.compiler.include_dirs + ['/usr/include'] |
| 15940 | 249 exts = [] |
| 250 | |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
251 platform = self.get_platform() |
|
21942
9d44e752d617
Compute expat -I directives from srcdir. Fixes #517214.
Martin v. Löwis <martin@v.loewis.de>
parents:
21939
diff
changeset
|
252 (srcdir,) = sysconfig.get_config_vars('srcdir') |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
253 |
|
23777
bec1b942e0bc
Patch #488073: AtheOS port.
Martin v. Löwis <martin@v.loewis.de>
parents:
23659
diff
changeset
|
254 # Check for AtheOS which has libraries in non-standard locations |
|
bec1b942e0bc
Patch #488073: AtheOS port.
Martin v. Löwis <martin@v.loewis.de>
parents:
23659
diff
changeset
|
255 if platform == 'atheos': |
|
bec1b942e0bc
Patch #488073: AtheOS port.
Martin v. Löwis <martin@v.loewis.de>
parents:
23659
diff
changeset
|
256 lib_dirs += ['/system/libs', '/atheos/autolnk/lib'] |
|
bec1b942e0bc
Patch #488073: AtheOS port.
Martin v. Löwis <martin@v.loewis.de>
parents:
23659
diff
changeset
|
257 lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) |
|
bec1b942e0bc
Patch #488073: AtheOS port.
Martin v. Löwis <martin@v.loewis.de>
parents:
23659
diff
changeset
|
258 inc_dirs += ['/system/include', '/atheos/autolnk/include'] |
|
bec1b942e0bc
Patch #488073: AtheOS port.
Martin v. Löwis <martin@v.loewis.de>
parents:
23659
diff
changeset
|
259 inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) |
|
bec1b942e0bc
Patch #488073: AtheOS port.
Martin v. Löwis <martin@v.loewis.de>
parents:
23659
diff
changeset
|
260 |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
261 # Check for MacOS X, which doesn't need libm.a at all |
|
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
262 math_libs = ['m'] |
|
24008
44f7fc307673
Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23970
diff
changeset
|
263 if platform in ['darwin', 'beos', 'mac']: |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
264 math_libs = [] |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
265 |
| 15940 | 266 # XXX Omitted modules: gl, pure, dl, SGI-specific modules |
| 267 | |
| 268 # | |
| 269 # The following modules are all pretty straightforward, and compile | |
| 270 # on pretty much any POSIXish platform. | |
| 271 # | |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
272 |
| 15940 | 273 # Some modules that are normally always on: |
| 274 exts.append( Extension('regex', ['regexmodule.c', 'regexpr.c']) ) | |
| 275 exts.append( Extension('pcre', ['pcremodule.c', 'pypcre.c']) ) | |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
276 |
| 20397 | 277 exts.append( Extension('_hotshot', ['_hotshot.c']) ) |
|
16384
c898ceba2261
Add entries for the weakref module to the build control.
Fred Drake <fdrake@acm.org>
parents:
16287
diff
changeset
|
278 exts.append( Extension('_weakref', ['_weakref.c']) ) |
| 15951 | 279 exts.append( Extension('xreadlines', ['xreadlinesmodule.c']) ) |
| 15940 | 280 |
| 281 # array objects | |
| 282 exts.append( Extension('array', ['arraymodule.c']) ) | |
| 283 # complex math library functions | |
|
16176
2dcbc1dfca9c
Fix for MacOS X/Darwin: it doesn't need -lm, ever. (Noted by Steven Majewski)
Andrew M. Kuchling <amk@amk.ca>
parents:
16100
diff
changeset
|
284 exts.append( Extension('cmath', ['cmathmodule.c'], |
|
2dcbc1dfca9c
Fix for MacOS X/Darwin: it doesn't need -lm, ever. (Noted by Steven Majewski)
Andrew M. Kuchling <amk@amk.ca>
parents:
16100
diff
changeset
|
285 libraries=math_libs) ) |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
286 |
| 15940 | 287 # math library functions, e.g. sin() |
|
16176
2dcbc1dfca9c
Fix for MacOS X/Darwin: it doesn't need -lm, ever. (Noted by Steven Majewski)
Andrew M. Kuchling <amk@amk.ca>
parents:
16100
diff
changeset
|
288 exts.append( Extension('math', ['mathmodule.c'], |
|
2dcbc1dfca9c
Fix for MacOS X/Darwin: it doesn't need -lm, ever. (Noted by Steven Majewski)
Andrew M. Kuchling <amk@amk.ca>
parents:
16100
diff
changeset
|
289 libraries=math_libs) ) |
| 15940 | 290 # fast string operations implemented in C |
| 291 exts.append( Extension('strop', ['stropmodule.c']) ) | |
| 292 # time operations and variables | |
|
16176
2dcbc1dfca9c
Fix for MacOS X/Darwin: it doesn't need -lm, ever. (Noted by Steven Majewski)
Andrew M. Kuchling <amk@amk.ca>
parents:
16100
diff
changeset
|
293 exts.append( Extension('time', ['timemodule.c'], |
|
2dcbc1dfca9c
Fix for MacOS X/Darwin: it doesn't need -lm, ever. (Noted by Steven Majewski)
Andrew M. Kuchling <amk@amk.ca>
parents:
16100
diff
changeset
|
294 libraries=math_libs) ) |
| 15940 | 295 # operator.add() and similar goodies |
| 296 exts.append( Extension('operator', ['operator.c']) ) | |
| 297 # access to the builtin codecs and codec registry | |
| 298 exts.append( Extension('_codecs', ['_codecsmodule.c']) ) | |
|
16416
7d39d9dcf2d6
Whitespace correction...
Marc-André Lemburg <mal@egenix.com>
parents:
16415
diff
changeset
|
299 # Python C API test module |
|
16447
ac52d3727867
Renamed _testXXX to _testcapiXXX. Jack is my hero -- good call!
Tim Peters <tim.peters@gmail.com>
parents:
16422
diff
changeset
|
300 exts.append( Extension('_testcapi', ['_testcapimodule.c']) ) |
| 15940 | 301 # static Unicode character database |
|
19343
7257e87e0720
Patch #445762: Support --disable-unicode
Martin v. Löwis <martin@v.loewis.de>
parents:
19319
diff
changeset
|
302 if have_unicode: |
|
7257e87e0720
Patch #445762: Support --disable-unicode
Martin v. Löwis <martin@v.loewis.de>
parents:
19319
diff
changeset
|
303 exts.append( Extension('unicodedata', ['unicodedata.c']) ) |
| 15940 | 304 # access to ISO C locale support |
| 305 exts.append( Extension('_locale', ['_localemodule.c']) ) | |
| 306 | |
| 307 # Modules with some UNIX dependencies -- on by default: | |
| 308 # (If you have a really backward UNIX, select and socket may not be | |
| 309 # supported...) | |
| 310 | |
| 311 # fcntl(2) and ioctl(2) | |
| 312 exts.append( Extension('fcntl', ['fcntlmodule.c']) ) | |
|
24032
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
313 if platform not in ['mac']: |
|
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
314 # pwd(3) |
|
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
315 exts.append( Extension('pwd', ['pwdmodule.c']) ) |
|
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
316 # grp(3) |
|
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
317 exts.append( Extension('grp', ['grpmodule.c']) ) |
| 15940 | 318 # posix (UNIX) errno values |
| 319 exts.append( Extension('errno', ['errnomodule.c']) ) | |
| 320 # select(2); not on ancient System V | |
| 321 exts.append( Extension('select', ['selectmodule.c']) ) | |
| 322 | |
| 323 # The md5 module implements the RSA Data Security, Inc. MD5 | |
| 21274 | 324 # Message-Digest Algorithm, described in RFC 1321. The |
| 325 # necessary files md5c.c and md5.h are included here. | |
| 15940 | 326 exts.append( Extension('md5', ['md5module.c', 'md5c.c']) ) |
| 327 | |
| 328 # The sha module implements the SHA checksum algorithm. | |
| 329 # (NIST's Secure Hash Algorithm.) | |
| 330 exts.append( Extension('sha', ['shamodule.c']) ) | |
| 331 | |
| 332 # Helper module for various ascii-encoders | |
| 333 exts.append( Extension('binascii', ['binascii.c']) ) | |
| 334 | |
| 335 # Fred Drake's interface to the Python parser | |
| 336 exts.append( Extension('parser', ['parsermodule.c']) ) | |
| 337 | |
|
22805
f1af8ad11000
Removed old Digital Creations copyright/license notices (with
Guido van Rossum <guido@python.org>
parents:
22545
diff
changeset
|
338 # cStringIO and cPickle |
| 15940 | 339 exts.append( Extension('cStringIO', ['cStringIO.c']) ) |
| 340 exts.append( Extension('cPickle', ['cPickle.c']) ) | |
| 341 | |
| 342 # Memory-mapped files (also works on Win32). | |
|
24032
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
343 if platform not in ['atheos', 'mac']: |
|
23777
bec1b942e0bc
Patch #488073: AtheOS port.
Martin v. Löwis <martin@v.loewis.de>
parents:
23659
diff
changeset
|
344 exts.append( Extension('mmap', ['mmapmodule.c']) ) |
| 15940 | 345 |
| 346 # Lance Ellinghaus's modules: | |
| 347 # enigma-inspired encryption | |
| 348 exts.append( Extension('rotor', ['rotormodule.c']) ) | |
|
24032
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
349 if platform not in ['mac']: |
|
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
350 # syslog daemon interface |
|
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
351 exts.append( Extension('syslog', ['syslogmodule.c']) ) |
| 15940 | 352 |
| 353 # George Neville-Neil's timing module: | |
| 354 exts.append( Extension('timing', ['timingmodule.c']) ) | |
| 355 | |
| 356 # | |
|
15998
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
357 # Here ends the simple stuff. From here on, modules need certain |
|
f390f43ac4b6
Patch from Barry: gets rid of two unused imports,
Andrew M. Kuchling <amk@amk.ca>
parents:
15996
diff
changeset
|
358 # libraries, are platform-specific, or present other surprises. |
| 15940 | 359 # |
| 360 | |
| 361 # Multimedia modules | |
| 362 # These don't work for 64-bit platforms!!! | |
| 363 # These represent audio samples or images as strings: | |
| 364 | |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
365 # Disabled on 64-bit platforms |
| 15940 | 366 if sys.maxint != 9223372036854775807L: |
| 367 # Operations on audio samples | |
| 368 exts.append( Extension('audioop', ['audioop.c']) ) | |
| 369 # Operations on images | |
| 370 exts.append( Extension('imageop', ['imageop.c']) ) | |
| 371 # Read SGI RGB image files (but coded portably) | |
| 372 exts.append( Extension('rgbimg', ['rgbimgmodule.c']) ) | |
| 373 | |
| 374 # readline | |
|
16283
65c6a2998b1b
Be extra careful with linking against libtermcap. This is now only done
Marc-André Lemburg <mal@egenix.com>
parents:
16282
diff
changeset
|
375 if self.compiler.find_library_file(lib_dirs, 'readline'): |
|
65c6a2998b1b
Be extra careful with linking against libtermcap. This is now only done
Marc-André Lemburg <mal@egenix.com>
parents:
16282
diff
changeset
|
376 readline_libs = ['readline'] |
|
19319
d370a58fb7fd
Link readline module with ncurses in preference to termcap. [Bug ##441580]
Andrew M. Kuchling <amk@amk.ca>
parents:
19269
diff
changeset
|
377 if self.compiler.find_library_file(lib_dirs, |
|
d370a58fb7fd
Link readline module with ncurses in preference to termcap. [Bug ##441580]
Andrew M. Kuchling <amk@amk.ca>
parents:
19269
diff
changeset
|
378 'ncurses'): |
|
d370a58fb7fd
Link readline module with ncurses in preference to termcap. [Bug ##441580]
Andrew M. Kuchling <amk@amk.ca>
parents:
19269
diff
changeset
|
379 readline_libs.append('ncurses') |
|
d370a58fb7fd
Link readline module with ncurses in preference to termcap. [Bug ##441580]
Andrew M. Kuchling <amk@amk.ca>
parents:
19269
diff
changeset
|
380 elif self.compiler.find_library_file(lib_dirs + |
|
16283
65c6a2998b1b
Be extra careful with linking against libtermcap. This is now only done
Marc-André Lemburg <mal@egenix.com>
parents:
16282
diff
changeset
|
381 ['/usr/lib/termcap'], |
|
65c6a2998b1b
Be extra careful with linking against libtermcap. This is now only done
Marc-André Lemburg <mal@egenix.com>
parents:
16282
diff
changeset
|
382 'termcap'): |
|
65c6a2998b1b
Be extra careful with linking against libtermcap. This is now only done
Marc-André Lemburg <mal@egenix.com>
parents:
16282
diff
changeset
|
383 readline_libs.append('termcap') |
| 15940 | 384 exts.append( Extension('readline', ['readline.c'], |
|
16282
ea4a2f3b266e
Fixed setup.py to allow:
Marc-André Lemburg <mal@egenix.com>
parents:
16225
diff
changeset
|
385 library_dirs=['/usr/lib/termcap'], |
|
16283
65c6a2998b1b
Be extra careful with linking against libtermcap. This is now only done
Marc-André Lemburg <mal@egenix.com>
parents:
16282
diff
changeset
|
386 libraries=readline_libs) ) |
|
24032
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
387 if platform not in ['mac']: |
|
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
388 # crypt module. |
|
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
389 |
|
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
390 if self.compiler.find_library_file(lib_dirs, 'crypt'): |
|
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
391 libs = ['crypt'] |
|
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
392 else: |
|
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
393 libs = [] |
|
c10c09192c12
More fixes for building MacPython extension modules. It now actually succeeds
Jack Jansen <jack.jansen@cwi.nl>
parents:
24008
diff
changeset
|
394 exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) ) |
| 15940 | 395 |
| 396 # socket(2) | |
|
23811
e3e019bc4e1e
Add dependencies on socketmodule.h.
Guido van Rossum <guido@python.org>
parents:
23777
diff
changeset
|
397 exts.append( Extension('_socket', ['socketmodule.c'], |
|
23825
9f0009ca97b9
Munge depends files to have absolute paths.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
23816
diff
changeset
|
398 depends = ['socketmodule.h']) ) |
|
21959
3957d155f8c5
Break SSL support out of _socket module and place it into a new
Marc-André Lemburg <mal@egenix.com>
parents:
21942
diff
changeset
|
399 # Detect SSL support for the socket module (via _ssl) |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
400 ssl_incs = find_file('openssl/ssl.h', inc_dirs, |
|
16038
b6863ba88989
GvR pointed out the correct way to check for statically built modules;
Andrew M. Kuchling <amk@amk.ca>
parents:
16013
diff
changeset
|
401 ['/usr/local/ssl/include', |
|
b6863ba88989
GvR pointed out the correct way to check for statically built modules;
Andrew M. Kuchling <amk@amk.ca>
parents:
16013
diff
changeset
|
402 '/usr/contrib/ssl/include/' |
|
b6863ba88989
GvR pointed out the correct way to check for statically built modules;
Andrew M. Kuchling <amk@amk.ca>
parents:
16013
diff
changeset
|
403 ] |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
404 ) |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
405 ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, |
|
16038
b6863ba88989
GvR pointed out the correct way to check for statically built modules;
Andrew M. Kuchling <amk@amk.ca>
parents:
16013
diff
changeset
|
406 ['/usr/local/ssl/lib', |
|
b6863ba88989
GvR pointed out the correct way to check for statically built modules;
Andrew M. Kuchling <amk@amk.ca>
parents:
16013
diff
changeset
|
407 '/usr/contrib/ssl/lib/' |
|
b6863ba88989
GvR pointed out the correct way to check for statically built modules;
Andrew M. Kuchling <amk@amk.ca>
parents:
16013
diff
changeset
|
408 ] ) |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
409 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
410 if (ssl_incs is not None and |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
411 ssl_libs is not None): |
|
21959
3957d155f8c5
Break SSL support out of _socket module and place it into a new
Marc-André Lemburg <mal@egenix.com>
parents:
21942
diff
changeset
|
412 exts.append( Extension('_ssl', ['_ssl.c'], |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
413 include_dirs = ssl_incs, |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
414 library_dirs = ssl_libs, |
|
23811
e3e019bc4e1e
Add dependencies on socketmodule.h.
Guido van Rossum <guido@python.org>
parents:
23777
diff
changeset
|
415 libraries = ['ssl', 'crypto'], |
|
23825
9f0009ca97b9
Munge depends files to have absolute paths.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
23816
diff
changeset
|
416 depends = ['socketmodule.h']), ) |
| 15940 | 417 |
| 418 # Modules that provide persistent dictionary-like semantics. You will | |
| 419 # probably want to arrange for at least one of them to be available on | |
| 420 # your machine, though none are defined by default because of library | |
| 421 # dependencies. The Python module anydbm.py provides an | |
| 422 # implementation independent wrapper for these; dumbdbm.py provides | |
| 423 # similar functionality (but slower of course) implemented in Python. | |
| 424 | |
|
23867
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
425 # Berkeley DB interface. |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
426 # |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
427 # This requires the Berkeley DB code, see |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
428 # ftp://ftp.cs.berkeley.edu/pub/4bsd/db.1.85.tar.gz |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
429 # |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
430 # (See http://pybsddb.sourceforge.net/ for an interface to |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
431 # Berkeley DB 3.x.) |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
432 |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
433 # when sorted in reverse order, keys for this dict must appear in the |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
434 # order you wish to search - e.g., search for db3 before db2, db2 |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
435 # before db1 |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
436 db_try_this = { |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
437 'db4': {'libs': ('db-4.3', 'db-4.2', 'db-4.1', 'db-4.0'), |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
438 'libdirs': ('/usr/local/BerkeleyDB.4.3/lib', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
439 '/usr/local/BerkeleyDB.4.2/lib', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
440 '/usr/local/BerkeleyDB.4.1/lib', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
441 '/usr/local/BerkeleyDB.4.0/lib', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
442 '/usr/lib', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
443 '/opt/sfw', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
444 '/sw/lib', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
445 '/lib', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
446 ), |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
447 'incdirs': ('/usr/local/BerkeleyDB.4.3/include', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
448 '/usr/local/BerkeleyDB.4.2/include', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
449 '/usr/local/BerkeleyDB.4.1/include', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
450 '/usr/local/BerkeleyDB.4.0/include', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
451 '/usr/include/db3', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
452 '/opt/sfw/include/db3', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
453 '/sw/include/db3', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
454 '/usr/local/include/db3', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
455 ), |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
456 'incs': ('db_185.h',)}, |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
457 'db3': {'libs': ('db-3.3', 'db-3.2', 'db-3.1', 'db-3.0'), |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
458 'libdirs': ('/usr/local/BerkeleyDB.3.3/lib', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
459 '/usr/local/BerkeleyDB.3.2/lib', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
460 '/usr/local/BerkeleyDB.3.1/lib', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
461 '/usr/local/BerkeleyDB.3.0/lib', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
462 '/usr/lib', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
463 '/opt/sfw', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
464 '/sw/lib', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
465 '/lib', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
466 ), |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
467 'incdirs': ('/usr/local/BerkeleyDB.3.3/include', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
468 '/usr/local/BerkeleyDB.3.2/include', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
469 '/usr/local/BerkeleyDB.3.1/include', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
470 '/usr/local/BerkeleyDB.3.0/include', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
471 '/usr/include/db3', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
472 '/opt/sfw/include/db3', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
473 '/sw/include/db3', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
474 '/usr/local/include/db3', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
475 ), |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
476 'incs': ('db_185.h',)}, |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
477 'db2': {'libs': ('db2',), |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
478 'libdirs': ('/usr/lib', '/sw/lib', '/lib'), |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
479 'incdirs': ('/usr/include/db2', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
480 '/usr/local/include/db2', '/sw/include/db2'), |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
481 'incs': ('db_185.h',)}, |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
482 # if you are willing to risk hash db file corruption you can |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
483 # uncomment the lines below for db1. Note that this will affect |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
484 # not only the bsddb module, but the dbhash and anydbm modules |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
485 # as well. you have been warned!!! |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
486 ##'db1': {'libs': ('db1', 'db'), |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
487 ## 'libdirs': ('/usr/lib', '/sw/lib', '/lib'), |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
488 ## 'incdirs': ('/usr/include/db1', '/usr/local/include/db1', |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
489 ## '/usr/include', '/usr/local/include'), |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
490 ## 'incs': ('db.h',)}, |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
491 } |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
492 |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
493 # override this list to affect the library version search order |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
494 # for example, if you want to force version 2 to be used: |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
495 # db_search_order = ["db2"] |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
496 db_search_order = db_try_this.keys() |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
497 db_search_order.sort() |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
498 db_search_order.reverse() |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
499 |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
500 find_lib_file = self.compiler.find_library_file |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
501 class found(Exception): pass |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
502 try: |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
503 for dbkey in db_search_order: |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
504 dbd = db_try_this[dbkey] |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
505 for dblib in dbd['libs']: |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
506 for dbinc in dbd['incs']: |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
507 db_incs = find_file(dbinc, [], dbd['incdirs']) |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
508 dblib_dir = find_lib_file(dbd['libdirs'], dblib) |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
509 if db_incs and dblib_dir: |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
510 dblib_dir = os.path.dirname(dblib_dir) |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
511 dblibs = [dblib] |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
512 raise found |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
513 except found: |
|
24143
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
514 dblibs = [dblib] |
|
23970
a72997f7db4c
In the Extension() call, add runtime_library_dirs so that a useful
Barry Warsaw <barry@python.org>
parents:
23957
diff
changeset
|
515 # A default source build puts Berkeley DB in something like |
|
a72997f7db4c
In the Extension() call, add runtime_library_dirs so that a useful
Barry Warsaw <barry@python.org>
parents:
23957
diff
changeset
|
516 # /usr/local/Berkeley.3.3 and the lib dir under that isn't |
|
a72997f7db4c
In the Extension() call, add runtime_library_dirs so that a useful
Barry Warsaw <barry@python.org>
parents:
23957
diff
changeset
|
517 # normally on ld.so's search path, unless the sysadmin has hacked |
|
a72997f7db4c
In the Extension() call, add runtime_library_dirs so that a useful
Barry Warsaw <barry@python.org>
parents:
23957
diff
changeset
|
518 # /etc/ld.so.conf. We add the directory to runtime_library_dirs |
|
a72997f7db4c
In the Extension() call, add runtime_library_dirs so that a useful
Barry Warsaw <barry@python.org>
parents:
23957
diff
changeset
|
519 # so the proper -R/--rpath flags get passed to the linker. This |
|
a72997f7db4c
In the Extension() call, add runtime_library_dirs so that a useful
Barry Warsaw <barry@python.org>
parents:
23957
diff
changeset
|
520 # is usually correct and most trouble free, but may cause problems |
|
a72997f7db4c
In the Extension() call, add runtime_library_dirs so that a useful
Barry Warsaw <barry@python.org>
parents:
23957
diff
changeset
|
521 # in some unusual system configurations (e.g. the directory is on |
|
a72997f7db4c
In the Extension() call, add runtime_library_dirs so that a useful
Barry Warsaw <barry@python.org>
parents:
23957
diff
changeset
|
522 # an NFS server that goes away). |
|
23867
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
523 if dbinc == 'db_185.h': |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
524 exts.append(Extension('bsddb', ['bsddbmodule.c'], |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
525 library_dirs=[dblib_dir], |
|
23970
a72997f7db4c
In the Extension() call, add runtime_library_dirs so that a useful
Barry Warsaw <barry@python.org>
parents:
23957
diff
changeset
|
526 runtime_library_dirs=[dblib_dir], |
|
23867
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
527 include_dirs=db_incs, |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
528 define_macros=[('HAVE_DB_185_H',1)], |
|
24143
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
529 libraries=dblibs)) |
|
23867
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
530 else: |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
531 exts.append(Extension('bsddb', ['bsddbmodule.c'], |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
532 library_dirs=[dblib_dir], |
|
23970
a72997f7db4c
In the Extension() call, add runtime_library_dirs so that a useful
Barry Warsaw <barry@python.org>
parents:
23957
diff
changeset
|
533 runtime_library_dirs=[dblib_dir], |
|
23867
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
534 include_dirs=db_incs, |
|
24143
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
535 libraries=dblibs)) |
|
23867
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
536 else: |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
537 db_incs = None |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
538 dblibs = [] |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
539 dblib_dir = None |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
540 |
| 15940 | 541 # The standard Unix dbm module: |
|
24143
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
542 if platform not in ['cygwin']: |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
543 if (self.compiler.find_library_file(lib_dirs, 'ndbm') |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
544 and find_file("ndbm.h", inc_dirs, []) is not None): |
|
16192
4fe69a9f8b30
Modified version of part of patch #102409 for Cygwin:
Andrew M. Kuchling <amk@amk.ca>
parents:
16176
diff
changeset
|
545 exts.append( Extension('dbm', ['dbmmodule.c'], |
|
24143
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
546 define_macros=[('HAVE_NDBM_H',None)], |
|
16192
4fe69a9f8b30
Modified version of part of patch #102409 for Cygwin:
Andrew M. Kuchling <amk@amk.ca>
parents:
16176
diff
changeset
|
547 libraries = ['ndbm'] ) ) |
|
24143
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
548 elif (platform in ['darwin'] |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
549 and find_file("ndbm.h", inc_dirs, []) is not None): |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
550 # Darwin has ndbm in libc |
|
20593
25d764d88149
- Build dbm module using libdb1 if it's available. This fixes SF bug "[
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents:
20498
diff
changeset
|
551 exts.append( Extension('dbm', ['dbmmodule.c'], |
|
24143
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
552 define_macros=[('HAVE_NDBM_H',None)]) ) |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
553 elif (self.compiler.find_library_file(lib_dirs, 'gdbm') |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
554 and find_file("gdbm/ndbm.h", inc_dirs, []) is not None): |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
555 exts.append( Extension('dbm', ['dbmmodule.c'], |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
556 define_macros=[('HAVE_GDBM_NDBM_H',None)], |
|
23867
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
557 libraries = ['gdbm'] ) ) |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
558 elif db_incs is not None: |
|
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
559 exts.append( Extension('dbm', ['dbmmodule.c'], |
|
24143
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
560 library_dirs=[dblib_dir], |
|
23867
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
561 include_dirs=db_incs, |
|
24143
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
562 define_macros=[('HAVE_BERKDB_H',None), |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
563 ('DB_DBM_HSEARCH',None)], |
|
23867
45d676933882
This introduces stricter library/header file checking for the Berkeley DB
Skip Montanaro <skip@pobox.com>
parents:
23825
diff
changeset
|
564 libraries=dblibs)) |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
565 |
| 15940 | 566 # Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm: |
| 567 if (self.compiler.find_library_file(lib_dirs, 'gdbm')): | |
| 568 exts.append( Extension('gdbm', ['gdbmmodule.c'], | |
| 569 libraries = ['gdbm'] ) ) | |
| 570 | |
| 571 # The mpz module interfaces to the GNU Multiple Precision library. | |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
572 # You need to ftp the GNU MP library. |
| 15940 | 573 # This was originally written and tested against GMP 1.2 and 1.3.2. |
| 574 # It has been modified by Rob Hooft to work with 2.0.2 as well, but I | |
|
21452
fb6b3fc4e0c1
Update comments about mpz, pointing to gmpy and mxNumber rather than
Guido van Rossum <guido@python.org>
parents:
21391
diff
changeset
|
575 # haven't tested it recently, and it definitely doesn't work with |
|
fb6b3fc4e0c1
Update comments about mpz, pointing to gmpy and mxNumber rather than
Guido van Rossum <guido@python.org>
parents:
21391
diff
changeset
|
576 # GMP 4.0. For more complete modules, refer to |
|
fb6b3fc4e0c1
Update comments about mpz, pointing to gmpy and mxNumber rather than
Guido van Rossum <guido@python.org>
parents:
21391
diff
changeset
|
577 # http://gmpy.sourceforge.net and |
|
fb6b3fc4e0c1
Update comments about mpz, pointing to gmpy and mxNumber rather than
Guido van Rossum <guido@python.org>
parents:
21391
diff
changeset
|
578 # http://www.egenix.com/files/python/mxNumber.html |
| 15940 | 579 |
|
20234
7ea61da878af
Fix a spelling error that has been bugging me for longer than I care to admit.
Greg Ward <gward@python.net>
parents:
19968
diff
changeset
|
580 # A compatible MP library unencumbered by the GPL also exists. It was |
| 15940 | 581 # posted to comp.sources.misc in volume 40 and is widely available from |
| 582 # FTP archive sites. One URL for it is: | |
| 583 # ftp://gatekeeper.dec.com/.b/usenet/comp.sources.misc/volume40/fgmp/part01.Z | |
| 584 | |
| 585 if (self.compiler.find_library_file(lib_dirs, 'gmp')): | |
| 586 exts.append( Extension('mpz', ['mpzmodule.c'], | |
| 587 libraries = ['gmp'] ) ) | |
| 588 | |
| 589 | |
| 590 # Unix-only modules | |
|
16192
4fe69a9f8b30
Modified version of part of patch #102409 for Cygwin:
Andrew M. Kuchling <amk@amk.ca>
parents:
16176
diff
changeset
|
591 if platform not in ['mac', 'win32']: |
| 15940 | 592 # Steen Lumholt's termios module |
| 593 exts.append( Extension('termios', ['termios.c']) ) | |
| 594 # Jeremy Hylton's rlimit interface | |
|
23777
bec1b942e0bc
Patch #488073: AtheOS port.
Martin v. Löwis <martin@v.loewis.de>
parents:
23659
diff
changeset
|
595 if platform not in ['atheos']: |
|
bec1b942e0bc
Patch #488073: AtheOS port.
Martin v. Löwis <martin@v.loewis.de>
parents:
23659
diff
changeset
|
596 exts.append( Extension('resource', ['resource.c']) ) |
| 15940 | 597 |
|
16721
4db0fddb6917
Patch #103544: always compile the dl and nis modules on Unix; let's see
Andrew M. Kuchling <amk@amk.ca>
parents:
16471
diff
changeset
|
598 # Sun yellow pages. Some systems have the functions in libc. |
|
23777
bec1b942e0bc
Patch #488073: AtheOS port.
Martin v. Löwis <martin@v.loewis.de>
parents:
23659
diff
changeset
|
599 if platform not in ['cygwin', 'atheos']: |
|
16804
8156879fe60d
Patch #404680: disables the nis module and enables the dl module when
Andrew M. Kuchling <amk@amk.ca>
parents:
16750
diff
changeset
|
600 if (self.compiler.find_library_file(lib_dirs, 'nsl')): |
|
8156879fe60d
Patch #404680: disables the nis module and enables the dl module when
Andrew M. Kuchling <amk@amk.ca>
parents:
16750
diff
changeset
|
601 libs = ['nsl'] |
|
8156879fe60d
Patch #404680: disables the nis module and enables the dl module when
Andrew M. Kuchling <amk@amk.ca>
parents:
16750
diff
changeset
|
602 else: |
|
8156879fe60d
Patch #404680: disables the nis module and enables the dl module when
Andrew M. Kuchling <amk@amk.ca>
parents:
16750
diff
changeset
|
603 libs = [] |
|
8156879fe60d
Patch #404680: disables the nis module and enables the dl module when
Andrew M. Kuchling <amk@amk.ca>
parents:
16750
diff
changeset
|
604 exts.append( Extension('nis', ['nismodule.c'], |
|
8156879fe60d
Patch #404680: disables the nis module and enables the dl module when
Andrew M. Kuchling <amk@amk.ca>
parents:
16750
diff
changeset
|
605 libraries = libs) ) |
| 15940 | 606 |
| 607 # Curses support, requring the System V version of curses, often | |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
608 # provided by the ncurses library. |
|
16192
4fe69a9f8b30
Modified version of part of patch #102409 for Cygwin:
Andrew M. Kuchling <amk@amk.ca>
parents:
16176
diff
changeset
|
609 if platform == 'sunos4': |
|
16842
76a684fe3f7f
Fix for bug #404875: fix typo in setup.py
Andrew M. Kuchling <amk@amk.ca>
parents:
16804
diff
changeset
|
610 inc_dirs += ['/usr/5include'] |
| 15940 | 611 lib_dirs += ['/usr/5lib'] |
| 612 | |
| 613 if (self.compiler.find_library_file(lib_dirs, 'ncurses')): | |
| 614 curses_libs = ['ncurses'] | |
| 615 exts.append( Extension('_curses', ['_cursesmodule.c'], | |
| 616 libraries = curses_libs) ) | |
| 21274 | 617 elif (self.compiler.find_library_file(lib_dirs, 'curses') |
| 618 and platform != 'darwin'): | |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
619 # OSX has an old Berkeley curses, not good enough for |
|
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
620 # the _curses module. |
| 15940 | 621 if (self.compiler.find_library_file(lib_dirs, 'terminfo')): |
| 622 curses_libs = ['curses', 'terminfo'] | |
| 623 else: | |
| 624 curses_libs = ['curses', 'termcap'] | |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
625 |
| 15940 | 626 exts.append( Extension('_curses', ['_cursesmodule.c'], |
| 627 libraries = curses_libs) ) | |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
628 |
| 15940 | 629 # If the curses module is enabled, check for the panel module |
|
21256
fbf68c59d66c
[Bug #480882] Remove now-pointless check for existence for _curses_panel.c;
Andrew M. Kuchling <amk@amk.ca>
parents:
21233
diff
changeset
|
630 if (module_enabled(exts, '_curses') and |
| 15940 | 631 self.compiler.find_library_file(lib_dirs, 'panel')): |
| 632 exts.append( Extension('_curses_panel', ['_curses_panel.c'], | |
| 633 libraries = ['panel'] + curses_libs) ) | |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
634 |
|
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
635 |
| 15940 | 636 |
| 637 # Lee Busby's SIGFPE modules. | |
| 638 # The library to link fpectl with is platform specific. | |
| 639 # Choose *one* of the options below for fpectl: | |
| 640 | |
|
16192
4fe69a9f8b30
Modified version of part of patch #102409 for Cygwin:
Andrew M. Kuchling <amk@amk.ca>
parents:
16176
diff
changeset
|
641 if platform == 'irix5': |
| 15940 | 642 # For SGI IRIX (tested on 5.3): |
| 643 exts.append( Extension('fpectl', ['fpectlmodule.c'], | |
| 644 libraries=['fpe']) ) | |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
645 elif 0: # XXX how to detect SunPro? |
| 21274 | 646 # For Solaris with SunPro compiler (tested on Solaris 2.5 |
| 647 # with SunPro C 4.2): (Without the compiler you don't have | |
| 648 # -lsunmath.) | |
| 15940 | 649 #fpectl fpectlmodule.c -R/opt/SUNWspro/lib -lsunmath -lm |
| 650 pass | |
| 651 else: | |
| 652 # For other systems: see instructions in fpectlmodule.c. | |
| 653 #fpectl fpectlmodule.c ... | |
| 654 exts.append( Extension('fpectl', ['fpectlmodule.c']) ) | |
| 655 | |
| 656 | |
| 657 # Andrew Kuchling's zlib module. | |
| 658 # This require zlib 1.1.3 (or later). | |
| 659 # See http://www.cdrom.com/pub/infozip/zlib/ | |
|
17531
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
660 zlib_inc = find_file('zlib.h', [], inc_dirs) |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
661 if zlib_inc is not None: |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
662 zlib_h = zlib_inc[0] + '/zlib.h' |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
663 version = '"0.0.0"' |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
664 version_req = '"1.1.3"' |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
665 fp = open(zlib_h) |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
666 while 1: |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
667 line = fp.readline() |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
668 if not line: |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
669 break |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
670 if line.find('#define ZLIB_VERSION', 0) == 0: |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
671 version = line.split()[2] |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
672 break |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
673 if version >= version_req: |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
674 if (self.compiler.find_library_file(lib_dirs, 'z')): |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
675 exts.append( Extension('zlib', ['zlibmodule.c'], |
|
c497fa3fe38a
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
Guido van Rossum <guido@python.org>
parents:
17099
diff
changeset
|
676 libraries = ['z']) ) |
| 15940 | 677 |
| 678 # Interface to the Expat XML parser | |
| 679 # | |
|
23889
41ab532d4f60
Update description of the Expat library.
Fred Drake <fdrake@acm.org>
parents:
23867
diff
changeset
|
680 # Expat was written by James Clark and is now maintained by a |
|
41ab532d4f60
Update description of the Expat library.
Fred Drake <fdrake@acm.org>
parents:
23867
diff
changeset
|
681 # group of developers on SourceForge; see www.libexpat.org for |
|
41ab532d4f60
Update description of the Expat library.
Fred Drake <fdrake@acm.org>
parents:
23867
diff
changeset
|
682 # more information. The pyexpat module was written by Paul |
|
41ab532d4f60
Update description of the Expat library.
Fred Drake <fdrake@acm.org>
parents:
23867
diff
changeset
|
683 # Prescod after a prototype by Jack Jansen. Source of Expat |
|
41ab532d4f60
Update description of the Expat library.
Fred Drake <fdrake@acm.org>
parents:
23867
diff
changeset
|
684 # 1.95.2 is included in Modules/expat/. Usage of a system |
|
41ab532d4f60
Update description of the Expat library.
Fred Drake <fdrake@acm.org>
parents:
23867
diff
changeset
|
685 # shared libexpat.so/expat.dll is not advised. |
|
41ab532d4f60
Update description of the Expat library.
Fred Drake <fdrake@acm.org>
parents:
23867
diff
changeset
|
686 # |
|
41ab532d4f60
Update description of the Expat library.
Fred Drake <fdrake@acm.org>
parents:
23867
diff
changeset
|
687 # More information on Expat can be found at www.libexpat.org. |
|
41ab532d4f60
Update description of the Expat library.
Fred Drake <fdrake@acm.org>
parents:
23867
diff
changeset
|
688 # |
|
21932
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
689 if sys.byteorder == "little": |
|
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
690 xmlbo = "12" |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
691 else: |
|
21932
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
692 xmlbo = "21" |
|
21942
9d44e752d617
Compute expat -I directives from srcdir. Fixes #517214.
Martin v. Löwis <martin@v.loewis.de>
parents:
21939
diff
changeset
|
693 expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat') |
|
21932
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
694 exts.append(Extension('pyexpat', |
|
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
695 sources = [ |
|
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
696 'pyexpat.c', |
|
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
697 'expat/xmlparse.c', |
|
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
698 'expat/xmlrole.c', |
|
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
699 'expat/xmltok.c', |
|
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
700 ], |
|
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
701 define_macros = [ |
|
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
702 ('HAVE_EXPAT_H',None), |
|
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
703 ('XML_NS', '1'), |
|
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
704 ('XML_DTD', '1'), |
|
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
705 ('XML_BYTE_ORDER', xmlbo), |
|
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
706 ('XML_CONTEXT_BYTES','1024'), |
|
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
707 ], |
|
21942
9d44e752d617
Compute expat -I directives from srcdir. Fixes #517214.
Martin v. Löwis <martin@v.loewis.de>
parents:
21939
diff
changeset
|
708 include_dirs = [expatinc] |
|
21932
ab68ad43d514
Use included Expat library. Drop support for older expat versions.
Martin v. Löwis <martin@v.loewis.de>
parents:
21788
diff
changeset
|
709 )) |
| 15940 | 710 |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
711 # Dynamic loading module |
|
21610
a9e06ffaf7fb
Patch #497126: Always compile dl.
Martin v. Löwis <martin@v.loewis.de>
parents:
21452
diff
changeset
|
712 dl_inc = find_file('dlfcn.h', [], inc_dirs) |
|
23777
bec1b942e0bc
Patch #488073: AtheOS port.
Martin v. Löwis <martin@v.loewis.de>
parents:
23659
diff
changeset
|
713 if (dl_inc is not None) and (platform not in ['atheos']): |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
714 exts.append( Extension('dl', ['dlmodule.c']) ) |
|
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
715 |
| 15940 | 716 # Platform-specific libraries |
|
16192
4fe69a9f8b30
Modified version of part of patch #102409 for Cygwin:
Andrew M. Kuchling <amk@amk.ca>
parents:
16176
diff
changeset
|
717 if platform == 'linux2': |
| 15940 | 718 # Linux-specific modules |
| 719 exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) ) | |
| 720 | |
|
16192
4fe69a9f8b30
Modified version of part of patch #102409 for Cygwin:
Andrew M. Kuchling <amk@amk.ca>
parents:
16176
diff
changeset
|
721 if platform == 'sunos5': |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
722 # SunOS specific modules |
| 15940 | 723 exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) ) |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
724 |
|
21233
803ccbe3ee7c
As of OS X 10.1.1 the version numbering scheme has changed. Convert all "darwin*" to "darwin" and use that for testing.
Jack Jansen <jack.jansen@cwi.nl>
parents:
21039
diff
changeset
|
725 if platform == 'darwin': |
|
24143
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
726 # Mac OS X specific modules. Modules linked against the Carbon |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
727 # framework are only built for framework-enabled Pythons. As |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
728 # of MacOSX 10.1 importing the Carbon framework from a non-windowing |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
729 # application (MacOSX server, not logged in on the console) may |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
730 # result in Python crashing. |
|
19704
1901f875b7d3
On MacOSX built the toolbox extension modules iff we're building with
Jack Jansen <jack.jansen@cwi.nl>
parents:
19680
diff
changeset
|
731 # |
|
1901f875b7d3
On MacOSX built the toolbox extension modules iff we're building with
Jack Jansen <jack.jansen@cwi.nl>
parents:
19680
diff
changeset
|
732 # I would like to trigger on WITH_NEXT_FRAMEWORK but that isn't |
|
1901f875b7d3
On MacOSX built the toolbox extension modules iff we're building with
Jack Jansen <jack.jansen@cwi.nl>
parents:
19680
diff
changeset
|
733 # available here. This Makefile variable is also what the install |
|
1901f875b7d3
On MacOSX built the toolbox extension modules iff we're building with
Jack Jansen <jack.jansen@cwi.nl>
parents:
19680
diff
changeset
|
734 # procedure triggers on. |
|
23957
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
735 exts.append( Extension('_CF', ['cf/_CFmodule.c', 'cf/pycfbridge.c'], |
|
22159
71902e1cfbef
Apply Jack's patch attached to
Michael W. Hudson <mwh@python.net>
parents:
22104
diff
changeset
|
736 extra_link_args=['-framework', 'CoreFoundation']) ) |
|
24143
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
737 |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
738 framework = sysconfig.get_config_var('PYTHONFRAMEWORK') |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
739 if framework: |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
740 exts.append( Extension('gestalt', ['gestaltmodule.c'], |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
741 extra_link_args=['-framework', 'Carbon']) ) |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
742 exts.append( Extension('MacOS', ['macosmodule.c'], |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
743 extra_link_args=['-framework', 'Carbon']) ) |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
744 exts.append( Extension('icglue', ['icgluemodule.c'], |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
745 extra_link_args=['-framework', 'Carbon']) ) |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
746 exts.append( Extension('macfs', |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
747 ['macfsmodule.c', |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
748 '../Python/getapplbycreator.c'], |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
749 extra_link_args=['-framework', 'Carbon']) ) |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
750 exts.append( Extension('_Res', ['res/_Resmodule.c'], |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
751 extra_link_args=['-framework', 'Carbon']) ) |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
752 exts.append( Extension('_Snd', ['snd/_Sndmodule.c'], |
|
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
753 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
754 exts.append( Extension('Nav', ['Nav.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
755 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
756 exts.append( Extension('_AE', ['ae/_AEmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
757 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
758 exts.append( Extension('_App', ['app/_Appmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
759 extra_link_args=['-framework', 'Carbon']) ) |
|
21379
743f67befb57
Build _CarbonEvt module on Mac OS X. Still gives a couple of warnings
Jack Jansen <jack.jansen@cwi.nl>
parents:
21321
diff
changeset
|
760 exts.append( Extension('_CarbonEvt', ['carbonevt/_CarbonEvtmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
761 extra_link_args=['-framework', 'Carbon']) ) |
|
21391
2c32fc5f23c0
build CoreGraphics under darwin
Just van Rossum <just@letterror.com>
parents:
21379
diff
changeset
|
762 exts.append( Extension('_CG', ['cg/_CGmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
763 extra_link_args=['-framework', 'ApplicationServices', |
|
21391
2c32fc5f23c0
build CoreGraphics under darwin
Just van Rossum <just@letterror.com>
parents:
21379
diff
changeset
|
764 '-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
765 exts.append( Extension('_Cm', ['cm/_Cmmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
766 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
767 exts.append( Extension('_Ctl', ['ctl/_Ctlmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
768 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
769 exts.append( Extension('_Dlg', ['dlg/_Dlgmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
770 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
771 exts.append( Extension('_Drag', ['drag/_Dragmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
772 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
773 exts.append( Extension('_Evt', ['evt/_Evtmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
774 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
775 exts.append( Extension('_Fm', ['fm/_Fmmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
776 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
777 exts.append( Extension('_Icn', ['icn/_Icnmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
778 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
779 exts.append( Extension('_List', ['list/_Listmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
780 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
781 exts.append( Extension('_Menu', ['menu/_Menumodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
782 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
783 exts.append( Extension('_Mlte', ['mlte/_Mltemodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
784 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
785 exts.append( Extension('_Qd', ['qd/_Qdmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
786 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
787 exts.append( Extension('_Qdoffs', ['qdoffs/_Qdoffsmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
788 extra_link_args=['-framework', 'Carbon']) ) |
|
19704
1901f875b7d3
On MacOSX built the toolbox extension modules iff we're building with
Jack Jansen <jack.jansen@cwi.nl>
parents:
19680
diff
changeset
|
789 exts.append( Extension('_Qt', ['qt/_Qtmodule.c'], |
| 21274 | 790 extra_link_args=['-framework', 'QuickTime', |
| 791 '-framework', 'Carbon']) ) | |
|
21775
16cc538401b3
Mac _Scrap module is now carbon-compliant, so build it on OSX.
Jack Jansen <jack.jansen@cwi.nl>
parents:
21742
diff
changeset
|
792 exts.append( Extension('_Scrap', ['scrap/_Scrapmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
793 extra_link_args=['-framework', 'Carbon']) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
794 exts.append( Extension('_TE', ['te/_TEmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
795 extra_link_args=['-framework', 'Carbon']) ) |
|
23957
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
796 # As there is no standardized place (yet) to put |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
797 # user-installed Mac libraries on OSX, we search for "waste" |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
798 # in parent directories of the Python source tree. You |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
799 # should put a symlink to your Waste installation in the |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
800 # same folder as your python source tree. Or modify the |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
801 # next few lines:-) |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
802 waste_incs = find_file("WASTE.h", [], |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
803 ['../'*n + 'waste/C_C++ Headers' for n in (0,1,2,3,4)]) |
|
21321
3a2cf5e45656
Mods to make WASTE module compile and link for MachoPython. Not tested
Jack Jansen <jack.jansen@cwi.nl>
parents:
21277
diff
changeset
|
804 waste_libs = find_library_file(self.compiler, "WASTE", [], |
|
24143
e9e6111beec1
The readme file said that OSX Carbon modules were only built for
Jack Jansen <jack.jansen@cwi.nl>
parents:
24032
diff
changeset
|
805 [ "../"*n + "waste/Static Libraries" for n in (0,1,2,3,4)]) |
|
21321
3a2cf5e45656
Mods to make WASTE module compile and link for MachoPython. Not tested
Jack Jansen <jack.jansen@cwi.nl>
parents:
21277
diff
changeset
|
806 if waste_incs != None and waste_libs != None: |
|
23957
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
807 (srcdir,) = sysconfig.get_config_vars('srcdir') |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
808 exts.append( Extension('waste', |
|
23957
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
809 ['waste/wastemodule.c'] + [ |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
810 os.path.join(srcdir, d) for d in |
|
21321
3a2cf5e45656
Mods to make WASTE module compile and link for MachoPython. Not tested
Jack Jansen <jack.jansen@cwi.nl>
parents:
21277
diff
changeset
|
811 'Mac/Wastemods/WEObjectHandlers.c', |
|
3a2cf5e45656
Mods to make WASTE module compile and link for MachoPython. Not tested
Jack Jansen <jack.jansen@cwi.nl>
parents:
21277
diff
changeset
|
812 'Mac/Wastemods/WETabHooks.c', |
|
3a2cf5e45656
Mods to make WASTE module compile and link for MachoPython. Not tested
Jack Jansen <jack.jansen@cwi.nl>
parents:
21277
diff
changeset
|
813 'Mac/Wastemods/WETabs.c' |
|
3a2cf5e45656
Mods to make WASTE module compile and link for MachoPython. Not tested
Jack Jansen <jack.jansen@cwi.nl>
parents:
21277
diff
changeset
|
814 ], |
|
23957
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
815 include_dirs = waste_incs + [os.path.join(srcdir, 'Mac/Wastemods')], |
|
21321
3a2cf5e45656
Mods to make WASTE module compile and link for MachoPython. Not tested
Jack Jansen <jack.jansen@cwi.nl>
parents:
21277
diff
changeset
|
816 library_dirs = waste_libs, |
|
3a2cf5e45656
Mods to make WASTE module compile and link for MachoPython. Not tested
Jack Jansen <jack.jansen@cwi.nl>
parents:
21277
diff
changeset
|
817 libraries = ['WASTE'], |
|
3a2cf5e45656
Mods to make WASTE module compile and link for MachoPython. Not tested
Jack Jansen <jack.jansen@cwi.nl>
parents:
21277
diff
changeset
|
818 extra_link_args = ['-framework', 'Carbon'], |
|
3a2cf5e45656
Mods to make WASTE module compile and link for MachoPython. Not tested
Jack Jansen <jack.jansen@cwi.nl>
parents:
21277
diff
changeset
|
819 ) ) |
|
20789
961b24f8e1d8
Link the core with CoreServices, not with Carbon, and don't use any Carbon
Jack Jansen <jack.jansen@cwi.nl>
parents:
20593
diff
changeset
|
820 exts.append( Extension('_Win', ['win/_Winmodule.c'], |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
821 extra_link_args=['-framework', 'Carbon']) ) |
|
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
822 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
823 self.extensions.extend(exts) |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
824 |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
825 # Call the method for detecting whether _tkinter can be compiled |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
826 self.detect_tkinter(inc_dirs, lib_dirs) |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
827 |
|
23957
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
828 def detect_tkinter_darwin(self, inc_dirs, lib_dirs): |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
829 # The _tkinter module, using frameworks. Since frameworks are quite |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
830 # different the UNIX search logic is not sharable. |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
831 from os.path import join, exists |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
832 framework_dirs = [ |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
833 '/System/Library/Frameworks/', |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
834 '/Library/Frameworks', |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
835 join(os.getenv('HOME'), '/Library/Frameworks') |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
836 ] |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
837 |
|
23957
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
838 # Find the directory that contains the Tcl.framwork and Tk.framework |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
839 # bundles. |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
840 # XXX distutils should support -F! |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
841 for F in framework_dirs: |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
842 # both Tcl.framework and Tk.framework should be present |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
843 for fw in 'Tcl', 'Tk': |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
844 if not exists(join(F, fw + '.framework')): |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
845 break |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
846 else: |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
847 # ok, F is now directory with both frameworks. Continure |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
848 # building |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
849 break |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
850 else: |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
851 # Tk and Tcl frameworks not found. Normal "unix" tkinter search |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
852 # will now resume. |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
853 return 0 |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
854 |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
855 # For 8.4a2, we must add -I options that point inside the Tcl and Tk |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
856 # frameworks. In later release we should hopefully be able to pass |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
857 # the -F option to gcc, which specifies a framework lookup path. |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
858 # |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
859 include_dirs = [ |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
860 join(F, fw + '.framework', H) |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
861 for fw in 'Tcl', 'Tk' |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
862 for H in 'Headers', 'Versions/Current/PrivateHeaders' |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
863 ] |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
864 |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
865 # For 8.4a2, the X11 headers are not included. Rather than include a |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
866 # complicated search, this is a hard-coded path. It could bail out |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
867 # if X11 libs are not found... |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
868 include_dirs.append('/usr/X11R6/include') |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
869 frameworks = ['-framework', 'Tcl', '-framework', 'Tk'] |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
870 |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
871 ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
872 define_macros=[('WITH_APPINIT', 1)], |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
873 include_dirs = include_dirs, |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
874 libraries = [], |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
875 extra_compile_args = frameworks, |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
876 extra_link_args = frameworks, |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
877 ) |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
878 self.extensions.append(ext) |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
879 return 1 |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
880 |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
881 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
882 def detect_tkinter(self, inc_dirs, lib_dirs): |
| 15940 | 883 # The _tkinter module. |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
884 |
|
23957
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
885 # Rather than complicate the code below, detecting and building |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
886 # AquaTk is a separate method. Only one Tkinter will be built on |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
887 # Darwin - either AquaTk, if it is found, or X11 based Tk. |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
888 platform = self.get_platform() |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
889 if platform == 'darwin' and \ |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
890 self.detect_tkinter_darwin(inc_dirs, lib_dirs): |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
891 return |
|
03bba7282852
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
Jack Jansen <jack.jansen@cwi.nl>
parents:
23889
diff
changeset
|
892 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
893 # Assume we haven't found any of the libraries or include files |
|
18819
dc9baf80c45a
Patch #443669: Permit _tkinter to build on cygwin32.
Martin v. Löwis <martin@v.loewis.de>
parents:
18601
diff
changeset
|
894 # The versions with dots are used on Unix, and the versions without |
|
dc9baf80c45a
Patch #443669: Permit _tkinter to build on cygwin32.
Martin v. Löwis <martin@v.loewis.de>
parents:
18601
diff
changeset
|
895 # dots on Windows, for detection by cygwin. |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
896 tcllib = tklib = tcl_includes = tk_includes = None |
|
18819
dc9baf80c45a
Patch #443669: Permit _tkinter to build on cygwin32.
Martin v. Löwis <martin@v.loewis.de>
parents:
18601
diff
changeset
|
897 for version in ['8.4', '84', '8.3', '83', '8.2', |
|
dc9baf80c45a
Patch #443669: Permit _tkinter to build on cygwin32.
Martin v. Löwis <martin@v.loewis.de>
parents:
18601
diff
changeset
|
898 '82', '8.1', '81', '8.0', '80']: |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
899 tklib = self.compiler.find_library_file(lib_dirs, |
|
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
900 'tk' + version ) |
|
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
901 tcllib = self.compiler.find_library_file(lib_dirs, |
|
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
902 'tcl' + version ) |
|
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
903 if tklib and tcllib: |
| 15940 | 904 # Exit the loop when we've found the Tcl/Tk libraries |
| 905 break | |
| 906 | |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
907 # Now check for the header files |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
908 if tklib and tcllib: |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
909 # Check for the include files on Debian, where |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
910 # they're put in /usr/include/{tcl,tk}X.Y |
|
16467
1c71aa7d5513
Patch #103578 ] _tkinter build fix for he current Debian unstable tcl/tk 8.3
Andrew M. Kuchling <amk@amk.ca>
parents:
16447
diff
changeset
|
911 debian_tcl_include = [ '/usr/include/tcl' + version ] |
| 21274 | 912 debian_tk_include = [ '/usr/include/tk' + version ] + \ |
| 913 debian_tcl_include | |
|
16467
1c71aa7d5513
Patch #103578 ] _tkinter build fix for he current Debian unstable tcl/tk 8.3
Andrew M. Kuchling <amk@amk.ca>
parents:
16447
diff
changeset
|
914 tcl_includes = find_file('tcl.h', inc_dirs, debian_tcl_include) |
|
1c71aa7d5513
Patch #103578 ] _tkinter build fix for he current Debian unstable tcl/tk 8.3
Andrew M. Kuchling <amk@amk.ca>
parents:
16447
diff
changeset
|
915 tk_includes = find_file('tk.h', inc_dirs, debian_tk_include) |
| 15940 | 916 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
917 if (tcllib is None or tklib is None and |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
918 tcl_includes is None or tk_includes is None): |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
919 # Something's missing, so give up |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
920 return |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
921 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
922 # OK... everything seems to be present for Tcl/Tk. |
| 15940 | 923 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
924 include_dirs = [] ; libs = [] ; defs = [] ; added_lib_dirs = [] |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
925 for dir in tcl_includes + tk_includes: |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
926 if dir not in include_dirs: |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
927 include_dirs.append(dir) |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
928 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
929 # Check for various platform-specific directories |
|
16192
4fe69a9f8b30
Modified version of part of patch #102409 for Cygwin:
Andrew M. Kuchling <amk@amk.ca>
parents:
16176
diff
changeset
|
930 if platform == 'sunos5': |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
931 include_dirs.append('/usr/openwin/include') |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
932 added_lib_dirs.append('/usr/openwin/lib') |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
933 elif os.path.exists('/usr/X11R6/include'): |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
934 include_dirs.append('/usr/X11R6/include') |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
935 added_lib_dirs.append('/usr/X11R6/lib') |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
936 elif os.path.exists('/usr/X11R5/include'): |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
937 include_dirs.append('/usr/X11R5/include') |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
938 added_lib_dirs.append('/usr/X11R5/lib') |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
939 else: |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
940 # Assume default location for X11 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
941 include_dirs.append('/usr/X11/include') |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
942 added_lib_dirs.append('/usr/X11/lib') |
| 15940 | 943 |
|
19968
e9128ea45cda
[Patch #462258] On Cygwin, don't build Tkinter unless the X header files
Andrew M. Kuchling <amk@amk.ca>
parents:
19935
diff
changeset
|
944 # If Cygwin, then verify that X is installed before proceeding |
|
e9128ea45cda
[Patch #462258] On Cygwin, don't build Tkinter unless the X header files
Andrew M. Kuchling <amk@amk.ca>
parents:
19935
diff
changeset
|
945 if platform == 'cygwin': |
|
e9128ea45cda
[Patch #462258] On Cygwin, don't build Tkinter unless the X header files
Andrew M. Kuchling <amk@amk.ca>
parents:
19935
diff
changeset
|
946 x11_inc = find_file('X11/Xlib.h', [], inc_dirs) |
|
e9128ea45cda
[Patch #462258] On Cygwin, don't build Tkinter unless the X header files
Andrew M. Kuchling <amk@amk.ca>
parents:
19935
diff
changeset
|
947 if x11_inc is None: |
|
e9128ea45cda
[Patch #462258] On Cygwin, don't build Tkinter unless the X header files
Andrew M. Kuchling <amk@amk.ca>
parents:
19935
diff
changeset
|
948 # X header files missing, so give up |
|
e9128ea45cda
[Patch #462258] On Cygwin, don't build Tkinter unless the X header files
Andrew M. Kuchling <amk@amk.ca>
parents:
19935
diff
changeset
|
949 return |
|
e9128ea45cda
[Patch #462258] On Cygwin, don't build Tkinter unless the X header files
Andrew M. Kuchling <amk@amk.ca>
parents:
19935
diff
changeset
|
950 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
951 # Check for BLT extension |
| 21274 | 952 if self.compiler.find_library_file(lib_dirs + added_lib_dirs, |
| 953 'BLT8.0'): | |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
954 defs.append( ('WITH_BLT', 1) ) |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
955 libs.append('BLT8.0') |
| 15940 | 956 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
957 # Add the Tcl/Tk libraries |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
958 libs.append('tk'+version) |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
959 libs.append('tcl'+version) |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
960 |
|
16192
4fe69a9f8b30
Modified version of part of patch #102409 for Cygwin:
Andrew M. Kuchling <amk@amk.ca>
parents:
16176
diff
changeset
|
961 if platform in ['aix3', 'aix4']: |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
962 libs.append('ld') |
| 15940 | 963 |
|
18819
dc9baf80c45a
Patch #443669: Permit _tkinter to build on cygwin32.
Martin v. Löwis <martin@v.loewis.de>
parents:
18601
diff
changeset
|
964 # Finally, link with the X11 libraries (not appropriate on cygwin) |
|
dc9baf80c45a
Patch #443669: Permit _tkinter to build on cygwin32.
Martin v. Löwis <martin@v.loewis.de>
parents:
18601
diff
changeset
|
965 if platform != "cygwin": |
|
dc9baf80c45a
Patch #443669: Permit _tkinter to build on cygwin32.
Martin v. Löwis <martin@v.loewis.de>
parents:
18601
diff
changeset
|
966 libs.append('X11') |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
967 |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
968 ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
969 define_macros=[('WITH_APPINIT', 1)] + defs, |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
970 include_dirs = include_dirs, |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
971 libraries = libs, |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
972 library_dirs = added_lib_dirs, |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
973 ) |
|
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
974 self.extensions.append(ext) |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
975 |
|
15996
c503fa9b265e
Sizable reorganization of how header and library files are found
Andrew M. Kuchling <amk@amk.ca>
parents:
15970
diff
changeset
|
976 # XXX handle these, but how to detect? |
| 15940 | 977 # *** Uncomment and edit for PIL (TkImaging) extension only: |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
978 # -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \ |
| 15940 | 979 # *** Uncomment and edit for TOGL extension only: |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
980 # -DWITH_TOGL togl.c \ |
| 15940 | 981 # *** Uncomment these for TOGL extension only: |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
982 # -lGL -lGLU -lXext -lXmu \ |
| 15940 | 983 |
|
17886
0af824c88203
Fix bug #232619: fix misleading warning on installing to lib-dynload
Andrew M. Kuchling <amk@amk.ca>
parents:
17531
diff
changeset
|
984 class PyBuildInstall(install): |
|
0af824c88203
Fix bug #232619: fix misleading warning on installing to lib-dynload
Andrew M. Kuchling <amk@amk.ca>
parents:
17531
diff
changeset
|
985 # Suppress the warning about installation into the lib_dynload |
|
0af824c88203
Fix bug #232619: fix misleading warning on installing to lib-dynload
Andrew M. Kuchling <amk@amk.ca>
parents:
17531
diff
changeset
|
986 # directory, which is not in sys.path when running Python during |
|
0af824c88203
Fix bug #232619: fix misleading warning on installing to lib-dynload
Andrew M. Kuchling <amk@amk.ca>
parents:
17531
diff
changeset
|
987 # installation: |
|
0af824c88203
Fix bug #232619: fix misleading warning on installing to lib-dynload
Andrew M. Kuchling <amk@amk.ca>
parents:
17531
diff
changeset
|
988 def initialize_options (self): |
|
0af824c88203
Fix bug #232619: fix misleading warning on installing to lib-dynload
Andrew M. Kuchling <amk@amk.ca>
parents:
17531
diff
changeset
|
989 install.initialize_options(self) |
|
0af824c88203
Fix bug #232619: fix misleading warning on installing to lib-dynload
Andrew M. Kuchling <amk@amk.ca>
parents:
17531
diff
changeset
|
990 self.warn_dir=0 |
|
21787
3ef7bed007f6
Sjoerd Mullender pointed out that setup.py contained some tabs,
Michael W. Hudson <mwh@python.net>
parents:
21775
diff
changeset
|
991 |
| 15940 | 992 def main(): |
|
17890
a1ddc4080cc5
Patch #411055 from MvL: import each extension after building it, and
Andrew M. Kuchling <amk@amk.ca>
parents:
17889
diff
changeset
|
993 # turn off warnings when deprecated modules are imported |
|
a1ddc4080cc5
Patch #411055 from MvL: import each extension after building it, and
Andrew M. Kuchling <amk@amk.ca>
parents:
17889
diff
changeset
|
994 import warnings |
|
a1ddc4080cc5
Patch #411055 from MvL: import each extension after building it, and
Andrew M. Kuchling <amk@amk.ca>
parents:
17889
diff
changeset
|
995 warnings.filterwarnings("ignore",category=DeprecationWarning) |
| 15940 | 996 setup(name = 'Python standard library', |
|
15967
dcae3e08d848
- compile struct module
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents:
15961
diff
changeset
|
997 version = '%d.%d' % sys.version_info[:2], |
|
17886
0af824c88203
Fix bug #232619: fix misleading warning on installing to lib-dynload
Andrew M. Kuchling <amk@amk.ca>
parents:
17531
diff
changeset
|
998 cmdclass = {'build_ext':PyBuildExt, 'install':PyBuildInstall}, |
| 15940 | 999 # The struct module is defined here, because build_ext won't be |
| 1000 # called unless there's at least one extension module defined. | |
| 16844 | 1001 ext_modules=[Extension('struct', ['structmodule.c'])], |
| 1002 | |
| 1003 # Scripts to install | |
| 1004 scripts = ['Tools/scripts/pydoc'] | |
| 15940 | 1005 ) |
|
16201
38678cb0b3cd
the ucnhash module is no longer used
Fredrik Lundh <fredrik@pythonware.com>
parents:
16192
diff
changeset
|
1006 |
| 15940 | 1007 # --install-platlib |
| 1008 if __name__ == '__main__': | |
| 1009 main() |
