mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
parent
a045f191b4
commit
94f25283c9
20 changed files with 52 additions and 196 deletions
79
setup.py
79
setup.py
|
@ -150,22 +150,21 @@ class PyBuildExt(build_ext):
|
|||
if ext.name in sys.builtin_module_names:
|
||||
self.extensions.remove(ext)
|
||||
|
||||
if platform != 'mac':
|
||||
# Parse Modules/Setup and Modules/Setup.local to figure out which
|
||||
# modules are turned on in the file.
|
||||
remove_modules = []
|
||||
for filename in ('Modules/Setup', 'Modules/Setup.local'):
|
||||
input = text_file.TextFile(filename, join_lines=1)
|
||||
while 1:
|
||||
line = input.readline()
|
||||
if not line: break
|
||||
line = line.split()
|
||||
remove_modules.append(line[0])
|
||||
input.close()
|
||||
# Parse Modules/Setup and Modules/Setup.local to figure out which
|
||||
# modules are turned on in the file.
|
||||
remove_modules = []
|
||||
for filename in ('Modules/Setup', 'Modules/Setup.local'):
|
||||
input = text_file.TextFile(filename, join_lines=1)
|
||||
while 1:
|
||||
line = input.readline()
|
||||
if not line: break
|
||||
line = line.split()
|
||||
remove_modules.append(line[0])
|
||||
input.close()
|
||||
|
||||
for ext in self.extensions[:]:
|
||||
if ext.name in remove_modules:
|
||||
self.extensions.remove(ext)
|
||||
for ext in self.extensions[:]:
|
||||
if ext.name in remove_modules:
|
||||
self.extensions.remove(ext)
|
||||
|
||||
# When you run "make CC=altcc" or something similar, you really want
|
||||
# those environment variables passed into the setup.py phase. Here's
|
||||
|
@ -381,7 +380,7 @@ class PyBuildExt(build_ext):
|
|||
|
||||
# Check for MacOS X, which doesn't need libm.a at all
|
||||
math_libs = ['m']
|
||||
if platform in ['darwin', 'mac']:
|
||||
if platform == 'darwin':
|
||||
math_libs = []
|
||||
|
||||
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
|
||||
|
@ -441,19 +440,16 @@ class PyBuildExt(build_ext):
|
|||
|
||||
# fcntl(2) and ioctl(2)
|
||||
exts.append( Extension('fcntl', ['fcntlmodule.c']) )
|
||||
if platform not in ['mac']:
|
||||
# pwd(3)
|
||||
exts.append( Extension('pwd', ['pwdmodule.c']) )
|
||||
# grp(3)
|
||||
exts.append( Extension('grp', ['grpmodule.c']) )
|
||||
# spwd, shadow passwords
|
||||
if (config_h_vars.get('HAVE_GETSPNAM', False) or
|
||||
config_h_vars.get('HAVE_GETSPENT', False)):
|
||||
exts.append( Extension('spwd', ['spwdmodule.c']) )
|
||||
else:
|
||||
missing.append('spwd')
|
||||
# pwd(3)
|
||||
exts.append( Extension('pwd', ['pwdmodule.c']) )
|
||||
# grp(3)
|
||||
exts.append( Extension('grp', ['grpmodule.c']) )
|
||||
# spwd, shadow passwords
|
||||
if (config_h_vars.get('HAVE_GETSPNAM', False) or
|
||||
config_h_vars.get('HAVE_GETSPENT', False)):
|
||||
exts.append( Extension('spwd', ['spwdmodule.c']) )
|
||||
else:
|
||||
missing.extend(['pwd', 'grp', 'spwd'])
|
||||
missing.append('spwd')
|
||||
|
||||
# select(2); not on ancient System V
|
||||
exts.append( Extension('select', ['selectmodule.c']) )
|
||||
|
@ -462,17 +458,11 @@ class PyBuildExt(build_ext):
|
|||
exts.append( Extension('parser', ['parsermodule.c']) )
|
||||
|
||||
# Memory-mapped files (also works on Win32).
|
||||
if platform not in ['mac']:
|
||||
exts.append( Extension('mmap', ['mmapmodule.c']) )
|
||||
else:
|
||||
missing.append('mmap')
|
||||
exts.append( Extension('mmap', ['mmapmodule.c']) )
|
||||
|
||||
# Lance Ellinghaus's syslog module
|
||||
if platform not in ['mac']:
|
||||
# syslog daemon interface
|
||||
exts.append( Extension('syslog', ['syslogmodule.c']) )
|
||||
else:
|
||||
missing.append('syslog')
|
||||
# syslog daemon interface
|
||||
exts.append( Extension('syslog', ['syslogmodule.c']) )
|
||||
|
||||
#
|
||||
# Here ends the simple stuff. From here on, modules need certain
|
||||
|
@ -532,16 +522,13 @@ class PyBuildExt(build_ext):
|
|||
else:
|
||||
missing.append('readline')
|
||||
|
||||
if platform not in ['mac']:
|
||||
# crypt module.
|
||||
# crypt module.
|
||||
|
||||
if self.compiler_obj.find_library_file(lib_dirs, 'crypt'):
|
||||
libs = ['crypt']
|
||||
else:
|
||||
libs = []
|
||||
exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) )
|
||||
if self.compiler_obj.find_library_file(lib_dirs, 'crypt'):
|
||||
libs = ['crypt']
|
||||
else:
|
||||
missing.append('crypt')
|
||||
libs = []
|
||||
exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) )
|
||||
|
||||
# CSV files
|
||||
exts.append( Extension('_csv', ['_csv.c']) )
|
||||
|
@ -986,7 +973,7 @@ class PyBuildExt(build_ext):
|
|||
missing.append('_gdbm')
|
||||
|
||||
# Unix-only modules
|
||||
if platform not in ['mac', 'win32']:
|
||||
if platform != 'win32':
|
||||
# Steen Lumholt's termios module
|
||||
exts.append( Extension('termios', ['termios.c']) )
|
||||
# Jeremy Hylton's rlimit interface
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue