summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2006-06-27 12:53:52 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2006-06-27 12:53:52 (GMT)
commit9b8b619491144430a88c2a767e398c67ae057c5a (patch)
tree73130f6c168ac490d8adfb0c4a0e1380ed88a08b /setup.py
parent3249d00f4d42a714d2038685c6b280a7fcfc5be7 (diff)
downloadcpython-9b8b619491144430a88c2a767e398c67ae057c5a.zip
cpython-9b8b619491144430a88c2a767e398c67ae057c5a.tar.gz
cpython-9b8b619491144430a88c2a767e398c67ae057c5a.tar.bz2
Use staticly build copies of zlib and bzip2 to build the OSX installer, that
way the resulting binaries have a better change of running on 10.3. This patch also updates the search logic for sleepycat db3/4, without this patch you cannot use a sleepycat build with a non-standard prefix; with this you can (at least on OSX) if you add the prefix to CPPFLAGS/LDFLAGS at configure-time. This change is needed to build the binary installer for OSX.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py32
1 files changed, 30 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index bd9b8b8..0c36184 100644
--- a/setup.py
+++ b/setup.py
@@ -638,6 +638,24 @@ class PyBuildExt(build_ext):
db_inc_paths.append('/pkg/db-3.%d/include' % x)
db_inc_paths.append('/opt/db-3.%d/include' % x)
+ # Add some common subdirectories for Sleepycat DB to the list,
+ # based on the standard include directories. This way DB3/4 gets
+ # picked up when it is installed in a non-standard prefix and
+ # the user has added that prefix into inc_dirs.
+ std_variants = []
+ for dn in inc_dirs:
+ std_variants.append(os.path.join(dn, 'db3'))
+ std_variants.append(os.path.join(dn, 'db4'))
+ for x in (0,1,2,3,4):
+ std_variants.append(os.path.join(dn, "db4%d"%x))
+ std_variants.append(os.path.join(dn, "db4.%d"%x))
+ for x in (2,3):
+ std_variants.append(os.path.join(dn, "db3%d"%x))
+ std_variants.append(os.path.join(dn, "db3.%d"%x))
+
+ db_inc_paths = std_variants + db_inc_paths
+
+
db_ver_inc_map = {}
class db_found(Exception): pass
@@ -940,13 +958,23 @@ class PyBuildExt(build_ext):
break
if version >= version_req:
if (self.compiler.find_library_file(lib_dirs, 'z')):
+ if sys.platform == "darwin":
+ zlib_extra_link_args = ('-Wl,-search_paths_first',)
+ else:
+ zlib_extra_link_args = ()
exts.append( Extension('zlib', ['zlibmodule.c'],
- libraries = ['z']) )
+ libraries = ['z'],
+ extra_link_args = zlib_extra_link_args))
# Gustavo Niemeyer's bz2 module.
if (self.compiler.find_library_file(lib_dirs, 'bz2')):
+ if sys.platform == "darwin":
+ bz2_extra_link_args = ('-Wl,-search_paths_first',)
+ else:
+ bz2_extra_link_args = ()
exts.append( Extension('bz2', ['bz2module.c'],
- libraries = ['bz2']) )
+ libraries = ['bz2'],
+ extra_link_args = bz2_extra_link_args) )
# Interface to the Expat XML parser
#