mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
The readme file said that OSX Carbon modules were only built for
-enable-framework builds, but setup.py built them anyway. Fixed. Also normalized whitespace. Bugfix candidate.
This commit is contained in:
parent
623fdb9884
commit
d1b2045958
1 changed files with 41 additions and 29 deletions
70
setup.py
70
setup.py
|
@ -510,6 +510,7 @@ class PyBuildExt(build_ext):
|
||||||
dblibs = [dblib]
|
dblibs = [dblib]
|
||||||
raise found
|
raise found
|
||||||
except found:
|
except found:
|
||||||
|
dblibs = [dblib]
|
||||||
# A default source build puts Berkeley DB in something like
|
# A default source build puts Berkeley DB in something like
|
||||||
# /usr/local/Berkeley.3.3 and the lib dir under that isn't
|
# /usr/local/Berkeley.3.3 and the lib dir under that isn't
|
||||||
# normally on ld.so's search path, unless the sysadmin has hacked
|
# normally on ld.so's search path, unless the sysadmin has hacked
|
||||||
|
@ -524,33 +525,42 @@ class PyBuildExt(build_ext):
|
||||||
runtime_library_dirs=[dblib_dir],
|
runtime_library_dirs=[dblib_dir],
|
||||||
include_dirs=db_incs,
|
include_dirs=db_incs,
|
||||||
define_macros=[('HAVE_DB_185_H',1)],
|
define_macros=[('HAVE_DB_185_H',1)],
|
||||||
libraries=[dblib]))
|
libraries=dblibs))
|
||||||
else:
|
else:
|
||||||
exts.append(Extension('bsddb', ['bsddbmodule.c'],
|
exts.append(Extension('bsddb', ['bsddbmodule.c'],
|
||||||
library_dirs=[dblib_dir],
|
library_dirs=[dblib_dir],
|
||||||
runtime_library_dirs=[dblib_dir],
|
runtime_library_dirs=[dblib_dir],
|
||||||
include_dirs=db_incs,
|
include_dirs=db_incs,
|
||||||
libraries=[dblib]))
|
libraries=dblibs))
|
||||||
else:
|
else:
|
||||||
db_incs = None
|
db_incs = None
|
||||||
dblibs = []
|
dblibs = []
|
||||||
dblib_dir = None
|
dblib_dir = None
|
||||||
|
|
||||||
# The standard Unix dbm module:
|
# The standard Unix dbm module:
|
||||||
if platform not in ['cygwin', 'mac']:
|
if platform not in ['cygwin']:
|
||||||
if (self.compiler.find_library_file(lib_dirs, 'ndbm')):
|
if (self.compiler.find_library_file(lib_dirs, 'ndbm')
|
||||||
|
and find_file("ndbm.h", inc_dirs, []) is not None):
|
||||||
exts.append( Extension('dbm', ['dbmmodule.c'],
|
exts.append( Extension('dbm', ['dbmmodule.c'],
|
||||||
|
define_macros=[('HAVE_NDBM_H',None)],
|
||||||
libraries = ['ndbm'] ) )
|
libraries = ['ndbm'] ) )
|
||||||
elif self.compiler.find_library_file(lib_dirs, 'gdbm'):
|
elif (platform in ['darwin']
|
||||||
|
and find_file("ndbm.h", inc_dirs, []) is not None):
|
||||||
|
# Darwin has ndbm in libc
|
||||||
exts.append( Extension('dbm', ['dbmmodule.c'],
|
exts.append( Extension('dbm', ['dbmmodule.c'],
|
||||||
|
define_macros=[('HAVE_NDBM_H',None)]) )
|
||||||
|
elif (self.compiler.find_library_file(lib_dirs, 'gdbm')
|
||||||
|
and find_file("gdbm/ndbm.h", inc_dirs, []) is not None):
|
||||||
|
exts.append( Extension('dbm', ['dbmmodule.c'],
|
||||||
|
define_macros=[('HAVE_GDBM_NDBM_H',None)],
|
||||||
libraries = ['gdbm'] ) )
|
libraries = ['gdbm'] ) )
|
||||||
elif db_incs is not None:
|
elif db_incs is not None:
|
||||||
exts.append( Extension('dbm', ['dbmmodule.c'],
|
exts.append( Extension('dbm', ['dbmmodule.c'],
|
||||||
library_dirs=dblib_dir,
|
library_dirs=[dblib_dir],
|
||||||
include_dirs=db_incs,
|
include_dirs=db_incs,
|
||||||
|
define_macros=[('HAVE_BERKDB_H',None),
|
||||||
|
('DB_DBM_HSEARCH',None)],
|
||||||
libraries=dblibs))
|
libraries=dblibs))
|
||||||
else:
|
|
||||||
exts.append( Extension('dbm', ['dbmmodule.c']) )
|
|
||||||
|
|
||||||
# Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
|
# Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
|
||||||
if (self.compiler.find_library_file(lib_dirs, 'gdbm')):
|
if (self.compiler.find_library_file(lib_dirs, 'gdbm')):
|
||||||
|
@ -712,32 +722,34 @@ class PyBuildExt(build_ext):
|
||||||
exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) )
|
exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) )
|
||||||
|
|
||||||
if platform == 'darwin':
|
if platform == 'darwin':
|
||||||
# Mac OS X specific modules. These are ported over from MacPython
|
# Mac OS X specific modules. Modules linked against the Carbon
|
||||||
# and still experimental. Some (such as gestalt or icglue) are
|
# framework are only built for framework-enabled Pythons. As
|
||||||
# already generally useful, some (the GUI ones) really need to
|
# of MacOSX 10.1 importing the Carbon framework from a non-windowing
|
||||||
# be used from a framework.
|
# application (MacOSX server, not logged in on the console) may
|
||||||
|
# result in Python crashing.
|
||||||
#
|
#
|
||||||
# I would like to trigger on WITH_NEXT_FRAMEWORK but that isn't
|
# I would like to trigger on WITH_NEXT_FRAMEWORK but that isn't
|
||||||
# available here. This Makefile variable is also what the install
|
# available here. This Makefile variable is also what the install
|
||||||
# procedure triggers on.
|
# procedure triggers on.
|
||||||
frameworkdir = sysconfig.get_config_var('PYTHONFRAMEWORKDIR')
|
|
||||||
exts.append( Extension('gestalt', ['gestaltmodule.c'],
|
|
||||||
extra_link_args=['-framework', 'Carbon']) )
|
|
||||||
exts.append( Extension('MacOS', ['macosmodule.c'],
|
|
||||||
extra_link_args=['-framework', 'Carbon']) )
|
|
||||||
exts.append( Extension('icglue', ['icgluemodule.c'],
|
|
||||||
extra_link_args=['-framework', 'Carbon']) )
|
|
||||||
exts.append( Extension('macfs',
|
|
||||||
['macfsmodule.c',
|
|
||||||
'../Python/getapplbycreator.c'],
|
|
||||||
extra_link_args=['-framework', 'Carbon']) )
|
|
||||||
exts.append( Extension('_CF', ['cf/_CFmodule.c', 'cf/pycfbridge.c'],
|
exts.append( Extension('_CF', ['cf/_CFmodule.c', 'cf/pycfbridge.c'],
|
||||||
extra_link_args=['-framework', 'CoreFoundation']) )
|
extra_link_args=['-framework', 'CoreFoundation']) )
|
||||||
exts.append( Extension('_Res', ['res/_Resmodule.c'],
|
|
||||||
extra_link_args=['-framework', 'Carbon']) )
|
framework = sysconfig.get_config_var('PYTHONFRAMEWORK')
|
||||||
exts.append( Extension('_Snd', ['snd/_Sndmodule.c'],
|
if framework:
|
||||||
extra_link_args=['-framework', 'Carbon']) )
|
exts.append( Extension('gestalt', ['gestaltmodule.c'],
|
||||||
if frameworkdir:
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
|
exts.append( Extension('MacOS', ['macosmodule.c'],
|
||||||
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
|
exts.append( Extension('icglue', ['icgluemodule.c'],
|
||||||
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
|
exts.append( Extension('macfs',
|
||||||
|
['macfsmodule.c',
|
||||||
|
'../Python/getapplbycreator.c'],
|
||||||
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
|
exts.append( Extension('_Res', ['res/_Resmodule.c'],
|
||||||
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
|
exts.append( Extension('_Snd', ['snd/_Sndmodule.c'],
|
||||||
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
exts.append( Extension('Nav', ['Nav.c'],
|
exts.append( Extension('Nav', ['Nav.c'],
|
||||||
extra_link_args=['-framework', 'Carbon']) )
|
extra_link_args=['-framework', 'Carbon']) )
|
||||||
exts.append( Extension('_AE', ['ae/_AEmodule.c'],
|
exts.append( Extension('_AE', ['ae/_AEmodule.c'],
|
||||||
|
@ -789,7 +801,7 @@ class PyBuildExt(build_ext):
|
||||||
waste_incs = find_file("WASTE.h", [],
|
waste_incs = find_file("WASTE.h", [],
|
||||||
['../'*n + 'waste/C_C++ Headers' for n in (0,1,2,3,4)])
|
['../'*n + 'waste/C_C++ Headers' for n in (0,1,2,3,4)])
|
||||||
waste_libs = find_library_file(self.compiler, "WASTE", [],
|
waste_libs = find_library_file(self.compiler, "WASTE", [],
|
||||||
["../"*n + "waste/Static Libraries" for n in (0,1,2,3,4)])
|
[ "../"*n + "waste/Static Libraries" for n in (0,1,2,3,4)])
|
||||||
if waste_incs != None and waste_libs != None:
|
if waste_incs != None and waste_libs != None:
|
||||||
(srcdir,) = sysconfig.get_config_vars('srcdir')
|
(srcdir,) = sysconfig.get_config_vars('srcdir')
|
||||||
exts.append( Extension('waste',
|
exts.append( Extension('waste',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue