Commit e1327927 authored by Boxiang Sun's avatar Boxiang Sun

Add some Pyston modification to from_cpython/setup.py

Disable some extensions, part of because they were handled by
from_cpython/CMakefile.txt, part of beacuase we need to enable it in
seperated PR. Such as tk extension.

And also add some modifications to let extension can find the source
code in correct path.
parent 50d62a1f
...@@ -8,9 +8,6 @@ from glob import glob ...@@ -8,9 +8,6 @@ from glob import glob
from platform import machine as platform_machine from platform import machine as platform_machine
import sysconfig import sysconfig
from distutils import log
from distutils import text_file
from distutils.errors import *
from distutils.core import Extension, setup from distutils.core import Extension, setup
from distutils.command.build_ext import build_ext from distutils.command.build_ext import build_ext
from distutils.command.install import install from distutils.command.install import install
...@@ -29,11 +26,6 @@ def get_platform(): ...@@ -29,11 +26,6 @@ def get_platform():
return sys.platform return sys.platform
host_platform = get_platform() host_platform = get_platform()
# Were we compiled --with-pydebug or with #define Py_DEBUG?
COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
# This global variable is used to hold the list of modules to be disabled.
disabled_module_list = []
def add_dir_to_list(dirlist, dir): def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if """Add the directory 'dir' to the list 'dirlist' (at the front) if
...@@ -154,6 +146,15 @@ def find_module_file(module, dirlist): ...@@ -154,6 +146,15 @@ def find_module_file(module, dirlist):
log.info("WARNING: multiple copies of %s found"%module) log.info("WARNING: multiple copies of %s found"%module)
return os.path.join(list[0], module) return os.path.join(list[0], module)
# Pyston change: find the real path of source file
def relpath(fn):
r = os.path.join(os.path.dirname(__file__), fn)
return r
# This global variable is used to hold the list of modules to be disabled.
disabled_module_list = []
class PyBuildExt(build_ext): class PyBuildExt(build_ext):
def __init__(self, dist): def __init__(self, dist):
...@@ -182,7 +183,7 @@ class PyBuildExt(build_ext): ...@@ -182,7 +183,7 @@ class PyBuildExt(build_ext):
# Maybe running on Windows but not using CYGWIN? # Maybe running on Windows but not using CYGWIN?
raise ValueError("No source directory; cannot proceed.") raise ValueError("No source directory; cannot proceed.")
srcdir = os.path.abspath(srcdir) srcdir = os.path.abspath(srcdir)
moddirlist = [os.path.join(srcdir, 'Modules')] moddirlist = [os.path.join(srcdir, '../from_cpython/Modules')]
# Platform-dependent module source and include directories # Platform-dependent module source and include directories
incdirlist = [] incdirlist = []
...@@ -194,9 +195,10 @@ class PyBuildExt(build_ext): ...@@ -194,9 +195,10 @@ class PyBuildExt(build_ext):
moddirlist.append(macmoddir) moddirlist.append(macmoddir)
incdirlist.append(os.path.join(srcdir, 'Mac/Include')) incdirlist.append(os.path.join(srcdir, 'Mac/Include'))
# Pyston change: Pyston doesn't use this for now.
# Fix up the paths for scripts, too # Fix up the paths for scripts, too
self.distribution.scripts = [os.path.join(srcdir, filename) # self.distribution.scripts = [os.path.join(srcdir, filename)
for filename in self.distribution.scripts] # for filename in self.distribution.scripts]
# Python header files # Python header files
headers = [sysconfig.get_config_h_filename()] headers = [sysconfig.get_config_h_filename()]
...@@ -220,34 +222,35 @@ class PyBuildExt(build_ext): ...@@ -220,34 +222,35 @@ class PyBuildExt(build_ext):
if ext.name in sys.builtin_module_names: if ext.name in sys.builtin_module_names:
self.extensions.remove(ext) self.extensions.remove(ext)
# Parse Modules/Setup and Modules/Setup.local to figure out which # Pyston change: comment this out, we don't have this file, so didn't
# modules are turned on in the file. # use this block of code
remove_modules = [] # # Parse Modules/Setup and Modules/Setup.local to figure out which
for filename in ('Modules/Setup', 'Modules/Setup.local'): # # modules are turned on in the file.
input = text_file.TextFile(filename, join_lines=1) # remove_modules = []
while 1: # for filename in ('Modules/Setup', 'Modules/Setup.local'):
line = input.readline() # input = text_file.TextFile(filename, join_lines=1)
if not line: break # while 1:
line = line.split() # line = input.readline()
remove_modules.append(line[0]) # if not line: break
input.close() # line = line.split()
# remove_modules.append(line[0])
for ext in self.extensions[:]: # input.close()
if ext.name in remove_modules: #
self.extensions.remove(ext) # for ext in self.extensions[:]:
# if ext.name in remove_modules:
# When you run "make CC=altcc" or something similar, you really want # self.extensions.remove(ext)
# those environment variables passed into the setup.py phase. Here's #
# a small set of useful ones. # # When you run "make CC=altcc" or something similar, you really want
compiler = os.environ.get('CC') # # those environment variables passed into the setup.py phase. Here's
args = {} # # a small set of useful ones.
# unfortunately, distutils doesn't let us provide separate C and C++ # compiler = os.environ.get('CC')
# compilers # args = {}
if compiler is not None: # # unfortunately, distutils doesn't let us provide separate C and C++
(ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS') # # compilers
args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags # if compiler is not None:
self.compiler.set_executables(**args) # (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
# args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
# self.compiler.set_executables(**args)
build_ext.build_extensions(self) build_ext.build_extensions(self)
longest = max([len(e.name) for e in self.extensions]) longest = max([len(e.name) for e in self.extensions])
...@@ -440,9 +443,10 @@ class PyBuildExt(build_ext): ...@@ -440,9 +443,10 @@ class PyBuildExt(build_ext):
if not cross_compiling: if not cross_compiling:
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
if cross_compiling: # Pyston change: we don't support cross compiling yet
self.add_gcc_paths() # if cross_compiling:
self.add_multiarch_paths() # self.add_gcc_paths()
# self.add_multiarch_paths()
# Add paths specified in the environment variables LDFLAGS and # Add paths specified in the environment variables LDFLAGS and
# CPPFLAGS for header and library files. # CPPFLAGS for header and library files.
...@@ -506,7 +510,8 @@ class PyBuildExt(build_ext): ...@@ -506,7 +510,8 @@ class PyBuildExt(build_ext):
add_dir_to_list(inc_dirs, d) add_dir_to_list(inc_dirs, d)
for d in ( for d in (
'/lib64', '/usr/lib64', '/lib64', '/usr/lib64',
'/lib', '/usr/lib', # Pyston change: add addtional search path for lib
'/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu'
): ):
add_dir_to_list(lib_dirs, d) add_dir_to_list(lib_dirs, d)
exts = [] exts = []
...@@ -561,64 +566,86 @@ class PyBuildExt(build_ext): ...@@ -561,64 +566,86 @@ class PyBuildExt(build_ext):
# on pretty much any POSIXish platform. # on pretty much any POSIXish platform.
# #
# Pyston change: the _weakref module is handled by from_cpython/CMakefile.txt
# Some modules that are normally always on: # Some modules that are normally always on:
#exts.append( Extension('_weakref', ['_weakref.c']) ) #exts.append( Extension('_weakref', ['_weakref.c']) )
# array objects # array objects
exts.append( Extension('array', ['arraymodule.c']) ) # Pyston change: the array module is handled by from_cpython/CMakefile
# exts.append( Extension('array', ['arraymodule.c']) )
# complex math library functions # complex math library functions
exts.append( Extension('cmath', ['cmathmodule.c', '_math.c'], exts.append( Extension('cmath', sources = map(relpath, [
"Modules/cmathmodule.c",]),
depends=['_math.h'], depends=['_math.h'],
libraries=math_libs) ) ))
# math library functions, e.g. sin() # math library functions, e.g. sin()
exts.append( Extension('math', ['mathmodule.c', '_math.c'], exts.append( Extension('math', ['mathmodule.c', '_math.c'],
depends=['_math.h'], depends=['_math.h'],
libraries=math_libs) ) libraries=math_libs) )
# fast string operations implemented in C # Pyston change: the modules list in this section are handled by from_cpython/CMakefile.txt
exts.append( Extension('strop', ['stropmodule.c']) ) # # fast string operations implemented in C
# time operations and variables # exts.append( Extension('strop', ['stropmodule.c']) )
exts.append( Extension('time', ['timemodule.c'], # # time operations and variables
libraries=math_libs) ) # exts.append( Extension('time', ['timemodule.c'],
exts.append( Extension('datetime', ['datetimemodule.c', 'timemodule.c'], # libraries=math_libs) )
libraries=math_libs) ) # # Pyston change: the datetime handled by from_cpython/CMakefile.txt
# fast iterator tools implemented in C # exts.append( Extension('datetime', ['datetimemodule.c', 'timemodule.c'],
exts.append( Extension("itertools", ["itertoolsmodule.c"]) ) # libraries=math_libs) )
# # Pyston change: comment out, handled by from_cpython/CMakefile.txt
# # fast iterator tools implemented in C
# exts.append( Extension("itertools", ["itertoolsmodule.c"]) )
# code that will be builtins in the future, but conflict with the # code that will be builtins in the future, but conflict with the
# current builtins # current builtins
exts.append( Extension('future_builtins', ['future_builtins.c']) ) exts.append( Extension('future_builtins', sources = map(relpath, [
# random number generator implemented in C "Modules/future_builtins.c",
exts.append( Extension("_random", ["_randommodule.c"]) ) ])) )
# high-performance collections
exts.append( Extension("_collections", ["_collectionsmodule.c"]) ) # Pyston change: comment out, those modules are handled by from_cpython/CMakefile.txt
# bisect # # random number generator implemented in C
exts.append( Extension("_bisect", ["_bisectmodule.c"]) ) # exts.append( Extension("_random", ["_randommodule.c"]) )
# heapq # # Pyston change: handled by from_cpython/CMakefile.txt
exts.append( Extension("_heapq", ["_heapqmodule.c"]) ) # # high-performance collections
# operator.add() and similar goodies # exts.append( Extension("_collections", ["_collectionsmodule.c"]) )
exts.append( Extension('operator', ['operator.c']) ) # Pyston change: the bisect module handled by from_cpython/CMakefile.txt
# Python 3.1 _io library # # bisect
exts.append( Extension("_io", # exts.append( Extension("_bisect", ["_bisectmodule.c"]) )
["_io/bufferedio.c", "_io/bytesio.c", "_io/fileio.c", # Pyston change: the _heapq module handled by from_cpython/CMakefile.txt
"_io/iobase.c", "_io/_iomodule.c", "_io/stringio.c", "_io/textio.c"], # # heapq
depends=["_io/_iomodule.h"], include_dirs=["Modules/_io"])) # exts.append( Extension("_heapq", ["_heapqmodule.c"]) )
# _functools
exts.append( Extension("_functools", ["_functoolsmodule.c"]) ) # Pyston change: the operator module handled by from_cpython/CMakefile
# _json speedups # # operator.add() and similar goodies
exts.append( Extension("_json", ["_json.c"]) ) # exts.append( Extension('operator', ['operator.c']) )
# Python C API test module
exts.append( Extension('_testcapi', ['_testcapimodule.c'], # Pyston change: io module handled by from_cpython/CMakefile.txt
depends=['testcapi_long.h']) ) # # Python 3.1 _io library
# profilers (_lsprof is for cProfile.py) # exts.append( Extension("_io",
exts.append( Extension('_hotshot', ['_hotshot.c']) ) # ["_io/bufferedio.c", "_io/bytesio.c", "_io/fileio.c",
exts.append( Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c']) ) # "_io/iobase.c", "_io/_iomodule.c", "_io/stringio.c", "_io/textio.c"],
# depends=["_io/_iomodule.h"], include_dirs=["Modules/_io"]))
# Pyston change: handled by from_cpython/CMakefile.txt
# # _functools
# exts.append( Extension("_functools", ["_functoolsmodule.c"]) )
# # _json speedups
# exts.append( Extension("_json", ["_json.c"]) )
# # Python C API test module
# exts.append( Extension('_testcapi', ['_testcapimodule.c'],
# depends=['testcapi_long.h']) )
# # profilers (_lsprof is for cProfile.py)
# exts.append( Extension('_hotshot', ['_hotshot.c']) )
# exts.append( Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c']) )
# Pyston change: the unicodedata module handled by from_cpython/CMakefile.txt
# static Unicode character database # static Unicode character database
if have_unicode: # if have_unicode:
exts.append( Extension('unicodedata', ['unicodedata.c']) ) # exts.append( Extension('unicodedata', ['unicodedata.c']) )
else: # else:
missing.append('unicodedata') # missing.append('unicodedata')
# access to ISO C locale support # access to ISO C locale support
data = open('pyconfig.h').read() # data = open('pyconfig.h').read()
m = re.search(r"#s*define\s+WITH_LIBINTL\s+1\s*", data) # m = re.search(r"#s*define\s+WITH_LIBINTL\s+1\s*", data)
# Pyston change: hard code the variable for now
m = None
if m is not None: if m is not None:
locale_libs = ['intl'] locale_libs = ['intl']
else: else:
...@@ -628,51 +655,65 @@ class PyBuildExt(build_ext): ...@@ -628,51 +655,65 @@ class PyBuildExt(build_ext):
else: else:
locale_extra_link_args = [] locale_extra_link_args = []
exts.append( Extension('_locale', sources = map(relpath, [
exts.append( Extension('_locale', ['_localemodule.c'], "Modules/_localemodule.c",
libraries=locale_libs, ])) )
extra_link_args=locale_extra_link_args) )
# Modules with some UNIX dependencies -- on by default: # Modules with some UNIX dependencies -- on by default:
# (If you have a really backward UNIX, select and socket may not be # (If you have a really backward UNIX, select and socket may not be
# supported...) # supported...)
# fcntl(2) and ioctl(2) # fcntl(2) and ioctl(2)
libs = [] # Pyston change: handled by from_cpython/CMakefile.txt
if (config_h_vars.get('FLOCK_NEEDS_LIBBSD', False)): # libs = []
# May be necessary on AIX for flock function # if (config_h_vars.get('FLOCK_NEEDS_LIBBSD', False)):
libs = ['bsd'] # # May be necessary on AIX for flock function
exts.append( Extension('fcntl', ['fcntlmodule.c'], libraries=libs) ) # libs = ['bsd']
# exts.append( Extension('fcntl', ['fcntlmodule.c'], libraries=libs) )
# pwd(3) # pwd(3)
exts.append( Extension('pwd', ['pwdmodule.c']) ) # Pyston change: the pwd module handled by from_cpython/CMakefile.txt
# exts.append( Extension('pwd', ['pwdmodule.c']) )
# grp(3) # grp(3)
exts.append( Extension('grp', ['grpmodule.c']) ) exts.append( Extension('grp', sources = map(relpath, [
"Modules/grpmodule.c",
])) )
# spwd, shadow passwords # spwd, shadow passwords
if (config_h_vars.get('HAVE_GETSPNAM', False) or # Pyston change: handled by from_cpython/CMakefile.txt
config_h_vars.get('HAVE_GETSPENT', False)): # if (config_h_vars.get('HAVE_GETSPNAM', False) or
exts.append( Extension('spwd', ['spwdmodule.c']) ) # config_h_vars.get('HAVE_GETSPENT', False)):
else: # exts.append( Extension('spwd', ['spwdmodule.c']) )
missing.append('spwd') # else:
# missing.append('spwd')
# Pyston change: the select module handled by from_cpython/CMakefile.txt
# select(2); not on ancient System V # select(2); not on ancient System V
exts.append( Extension('select', ['selectmodule.c']) ) # exts.append( Extension('select', ['selectmodule.c']) )
# Fred Drake's interface to the Python parser # Fred Drake's interface to the Python parser
exts.append( Extension('parser', ['parsermodule.c']) ) exts.append( Extension('parser', sources = map(relpath, [
"Modules/parsermodule.c",
])) )
# cStringIO and cPickle # cStringIO and cPickle
exts.append( Extension('cStringIO', ['cStringIO.c']) ) exts.append( Extension('cStringIO', sources = map(relpath, [
exts.append( Extension('cPickle', ['cPickle.c']) ) "Modules/cStringIO.c",
])) )
exts.append( Extension('cPickle', sources = map(relpath, [
"Modules/cPickle.c",
])) )
# Memory-mapped files (also works on Win32). # Memory-mapped files (also works on Win32).
if host_platform not in ['atheos']: if host_platform not in ['atheos']:
exts.append( Extension('mmap', ['mmapmodule.c']) ) exts.append( Extension('mmap', sources = map(relpath, [
"Modules/mmapmodule.c",
])) )
else: else:
missing.append('mmap') missing.append('mmap')
# Lance Ellinghaus's syslog module # Lance Ellinghaus's syslog module
# syslog daemon interface # syslog daemon interface
exts.append( Extension('syslog', ['syslogmodule.c']) ) # Pyston change: disable the those modules in this setup.py
# exts.append( Extension('syslog', ['syslogmodule.c']) )
# George Neville-Neil's timing module: # George Neville-Neil's timing module:
# Deprecated in PEP 4 http://www.python.org/peps/pep-0004.html # Deprecated in PEP 4 http://www.python.org/peps/pep-0004.html
...@@ -691,7 +732,8 @@ class PyBuildExt(build_ext): ...@@ -691,7 +732,8 @@ class PyBuildExt(build_ext):
# Operations on audio samples # Operations on audio samples
# According to #993173, this one should actually work fine on # According to #993173, this one should actually work fine on
# 64-bit platforms. # 64-bit platforms.
exts.append( Extension('audioop', ['audioop.c']) ) # Pyston change: disable the audioop modules in this setup.py
# exts.append( Extension('audioop', ['audioop.c']) )
# Disabled on 64-bit platforms # Disabled on 64-bit platforms
if sys.maxint != 9223372036854775807L: if sys.maxint != 9223372036854775807L:
...@@ -761,28 +803,29 @@ class PyBuildExt(build_ext): ...@@ -761,28 +803,29 @@ class PyBuildExt(build_ext):
['/usr/lib/termcap'], ['/usr/lib/termcap'],
'termcap'): 'termcap'):
readline_libs.append('termcap') readline_libs.append('termcap')
exts.append( Extension('readline', ['readline.c'], exts.append( Extension('readline', sources = map(relpath, [
library_dirs=['/usr/lib/termcap'], "Modules/readline.c",
extra_link_args=readline_extra_link_args, ])))
libraries=readline_libs) )
else: else:
missing.append('readline') missing.append('readline')
# Pyston change: disable the crypt module in this setup.py
# crypt module. # crypt module.
# if self.compiler.find_library_file(lib_dirs, 'crypt'):
# libs = ['crypt']
# else:
# libs = []
# exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) )
if self.compiler.find_library_file(lib_dirs, 'crypt'): # Pyston change: handled by from_cpython/CMakefile.txt
libs = ['crypt']
else:
libs = []
exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) )
# CSV files # CSV files
exts.append( Extension('_csv', ['_csv.c']) ) # exts.append( Extension('_csv', ['_csv.c']) )
# Pyston change: disable the _socket module in this setup.py
# socket(2) # socket(2)
exts.append( Extension('_socket', ['socketmodule.c', 'timemodule.c'], # exts.append( Extension('_socket', ['socketmodule.c', 'timemodule.c'],
depends=['socketmodule.h'], # depends=['socketmodule.h'],
libraries=math_libs) ) # libraries=math_libs) )
# Detect SSL support for the socket module (via _ssl) # Detect SSL support for the socket module (via _ssl)
search_for_ssl_incs_in = [ search_for_ssl_incs_in = [
'/usr/local/ssl/include', '/usr/local/ssl/include',
...@@ -801,15 +844,17 @@ class PyBuildExt(build_ext): ...@@ -801,15 +844,17 @@ class PyBuildExt(build_ext):
'/usr/contrib/ssl/lib/' '/usr/contrib/ssl/lib/'
] ) ] )
if (ssl_incs is not None and # Pyston change: the _ssl module is handled by
ssl_libs is not None): # from_cpython/CMakefiles.txy
exts.append( Extension('_ssl', ['_ssl.c'], # if (ssl_incs is not None and
include_dirs = ssl_incs, # ssl_libs is not None):
library_dirs = ssl_libs, # exts.append( Extension('_ssl', ['_ssl.c'],
libraries = ['ssl', 'crypto'], # include_dirs = ssl_incs,
depends = ['socketmodule.h']), ) # library_dirs = ssl_libs,
else: # libraries = ['ssl', 'crypto'],
missing.append('_ssl') # depends = ['socketmodule.h']), )
# else:
# missing.append('_ssl')
# find out which version of OpenSSL we have # find out which version of OpenSSL we have
openssl_ver = 0 openssl_ver = 0
...@@ -838,33 +883,38 @@ class PyBuildExt(build_ext): ...@@ -838,33 +883,38 @@ class PyBuildExt(build_ext):
have_usable_openssl = (have_any_openssl and have_usable_openssl = (have_any_openssl and
openssl_ver >= min_openssl_ver) openssl_ver >= min_openssl_ver)
if have_any_openssl: # Pyston change: didn't support hashlib yet.
if have_usable_openssl: # if have_any_openssl:
# The _hashlib module wraps optimized implementations # if have_usable_openssl:
# of hash functions from the OpenSSL library. # # The _hashlib module wraps optimized implementations
exts.append( Extension('_hashlib', ['_hashopenssl.c'], # # of hash functions from the OpenSSL library.
include_dirs = ssl_incs, # exts.append( Extension('_hashlib', ['_hashopenssl.c'],
library_dirs = ssl_libs, # include_dirs = ssl_incs,
libraries = ['ssl', 'crypto']) ) # library_dirs = ssl_libs,
else: # libraries = ['ssl', 'crypto']) )
print ("warning: openssl 0x%08x is too old for _hashlib" % # else:
openssl_ver) # print ("warning: openssl 0x%08x is too old for _hashlib" %
missing.append('_hashlib') # openssl_ver)
if COMPILED_WITH_PYDEBUG or not have_usable_openssl: # missing.append('_hashlib')
# The _sha module implements the SHA1 hash algorithm. # Pyston change: the shaXXX module handled by from_cpython/CMakefile
exts.append( Extension('_sha', ['shamodule.c']) ) # if COMPILED_WITH_PYDEBUG or not have_usable_openssl:
# The _md5 module implements the RSA Data Security, Inc. MD5 # # The _sha module implements the SHA1 hash algorithm.
# Message-Digest Algorithm, described in RFC 1321. The # exts.append( Extension('_sha', ['shamodule.c']) )
# necessary files md5.c and md5.h are included here.
exts.append( Extension('_md5', # Pyston change: the md5 module handled by from_cpython/CMakefile
sources = ['md5module.c', 'md5.c'], # # The _md5 module implements the RSA Data Security, Inc. MD5
depends = ['md5.h']) ) # # Message-Digest Algorithm, described in RFC 1321. The
# # necessary files md5.c and md5.h are included here.
min_sha2_openssl_ver = 0x00908000 # exts.append( Extension('_md5',
if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver: # sources = ['md5module.c', 'md5.c'],
# OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash # depends = ['md5.h']) )
exts.append( Extension('_sha256', ['sha256module.c']) ) #
exts.append( Extension('_sha512', ['sha512module.c']) ) # Pyston change: the shaXXX module handled by from_cpython/CMakefile
# min_sha2_openssl_ver = 0x00908000
# if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver:
# # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
# exts.append( Extension('_sha256', ['sha256module.c']) )
# exts.append( Extension('_sha512', ['sha512module.c']) )
# Modules that provide persistent dictionary-like semantics. You will # Modules that provide persistent dictionary-like semantics. You will
# probably want to arrange for at least one of them to be available on # probably want to arrange for at least one of them to be available on
...@@ -1074,12 +1124,13 @@ class PyBuildExt(build_ext): ...@@ -1074,12 +1124,13 @@ class PyBuildExt(build_ext):
# correct and most trouble free, but may cause problems in # correct and most trouble free, but may cause problems in
# some unusual system configurations (e.g. the directory # some unusual system configurations (e.g. the directory
# is on an NFS server that goes away). # is on an NFS server that goes away).
exts.append(Extension('_bsddb', ['_bsddb.c'], # Pyston change: we don't suport bsddb module yet.
depends = ['bsddb.h'], # exts.append(Extension('_bsddb', ['_bsddb.c'],
library_dirs=dblib_dir, # depends = ['bsddb.h'],
runtime_library_dirs=dblib_dir, # library_dirs=dblib_dir,
include_dirs=db_incs, # runtime_library_dirs=dblib_dir,
libraries=dblibs)) # include_dirs=db_incs,
# libraries=dblibs))
else: else:
if db_setup_debug: print "db: no appropriate library found" if db_setup_debug: print "db: no appropriate library found"
db_incs = None db_incs = None
...@@ -1182,15 +1233,16 @@ class PyBuildExt(build_ext): ...@@ -1182,15 +1233,16 @@ class PyBuildExt(build_ext):
else: else:
sqlite_extra_link_args = () sqlite_extra_link_args = ()
exts.append(Extension('_sqlite3', sqlite_srcs, # Pyston change: we don't suport sqlite yet.
define_macros=sqlite_defines, # exts.append(Extension('_sqlite3', sqlite_srcs,
include_dirs=["Modules/_sqlite", # define_macros=sqlite_defines,
sqlite_incdir], # include_dirs=["Modules/_sqlite",
library_dirs=sqlite_libdir, # sqlite_incdir],
extra_link_args=sqlite_extra_link_args, # library_dirs=sqlite_libdir,
libraries=["sqlite3",])) # extra_link_args=sqlite_extra_link_args,
else: # libraries=["sqlite3",]))
missing.append('_sqlite3') # else:
# missing.append('_sqlite3')
# Look for Berkeley db 1.85. Note that it is built as a different # Look for Berkeley db 1.85. Note that it is built as a different
# module name so it can be included even when later versions are # module name so it can be included even when later versions are
...@@ -1232,10 +1284,13 @@ class PyBuildExt(build_ext): ...@@ -1232,10 +1284,13 @@ class PyBuildExt(build_ext):
dbm_order = ['gdbm'] dbm_order = ['gdbm']
# The standard Unix dbm module: # The standard Unix dbm module:
if host_platform not in ['cygwin']: if host_platform not in ['cygwin']:
config_args = [arg.strip("'") # Pyston change: hard code the dbm_args, Pyston don't support
for arg in sysconfig.get_config_var("CONFIG_ARGS").split()] # CONFIG_ARGS yet.
dbm_args = [arg for arg in config_args dbm_args = None
if arg.startswith('--with-dbmliborder=')] # config_args = [arg.strip("'")
# for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
# dbm_args = [arg for arg in config_args
# if arg.startswith('--with-dbmliborder=')]
if dbm_args: if dbm_args:
dbm_order = [arg.split('=')[-1] for arg in dbm_args][-1].split(":") dbm_order = [arg.split('=')[-1] for arg in dbm_args][-1].split(":")
else: else:
...@@ -1299,40 +1354,47 @@ class PyBuildExt(build_ext): ...@@ -1299,40 +1354,47 @@ class PyBuildExt(build_ext):
], ],
libraries=dblibs) libraries=dblibs)
break break
if dbmext is not None:
exts.append(dbmext)
else:
missing.append('dbm')
# Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm: # Pyston change: we don't support those dbm modules yet
if ('gdbm' in dbm_order and # if dbmext is not None:
self.compiler.find_library_file(lib_dirs, 'gdbm')): # exts.append(dbmext)
exts.append( Extension('gdbm', ['gdbmmodule.c'], # else:
libraries = ['gdbm'] ) ) # missing.append('dbm')
else: #
missing.append('gdbm') # # Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
# if ('gdbm' in dbm_order and
# self.compiler.find_library_file(lib_dirs, 'gdbm')):
# exts.append( Extension('gdbm', ['gdbmmodule.c'],
# libraries = ['gdbm'] ) )
# else:
# missing.append('gdbm')
# Unix-only modules # Unix-only modules
if host_platform not in ['win32']: if host_platform not in ['win32']:
# Steen Lumholt's termios module # Steen Lumholt's termios module
exts.append( Extension('termios', ['termios.c']) ) exts.append( Extension('termios', sources = map(relpath, [
# Jeremy Hylton's rlimit interface "Modules/termios.c",
if host_platform not in ['atheos']: ])) )
exts.append( Extension('resource', ['resource.c']) )
else: # Pyston change: the resource module handled by from_cpython/CMakefile
missing.append('resource') # # Jeremy Hylton's rlimit interface
# if host_platform not in ['atheos']:
# Sun yellow pages. Some systems have the functions in libc. # exts.append( Extension('resource', ['resource.c']) )
if (host_platform not in ['cygwin', 'atheos', 'qnx6'] and # else:
find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None): # missing.append('resource')
if (self.compiler.find_library_file(lib_dirs, 'nsl')): #
libs = ['nsl'] # Pyston change: we don't support nis module yet
else: # # Sun yellow pages. Some systems have the functions in libc.
libs = [] # if (host_platform not in ['cygwin', 'atheos', 'qnx6'] and
exts.append( Extension('nis', ['nismodule.c'], # find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
libraries = libs) ) # if (self.compiler.find_library_file(lib_dirs, 'nsl')):
else: # libs = ['nsl']
missing.append('nis') # else:
# libs = []
# exts.append( Extension('nis', ['nismodule.c'],
# libraries = libs) )
# else:
# missing.append('nis')
else: else:
missing.extend(['nis', 'resource', 'termios']) missing.extend(['nis', 'resource', 'termios'])
...@@ -1348,7 +1410,9 @@ class PyBuildExt(build_ext): ...@@ -1348,7 +1410,9 @@ class PyBuildExt(build_ext):
curses_libs = [curses_library] curses_libs = [curses_library]
curses_incs = find_file('curses.h', inc_dirs, curses_incs = find_file('curses.h', inc_dirs,
[os.path.join(d, 'ncursesw') for d in inc_dirs]) [os.path.join(d, 'ncursesw') for d in inc_dirs])
exts.append( Extension('_curses', ['_cursesmodule.c'], exts.append( Extension('_curses',
sources = map(relpath,
[ "Modules/_cursesmodule.c", ]),
include_dirs = curses_incs, include_dirs = curses_incs,
libraries = curses_libs) ) libraries = curses_libs) )
elif curses_library == 'curses' and host_platform != 'darwin': elif curses_library == 'curses' and host_platform != 'darwin':
...@@ -1365,16 +1429,18 @@ class PyBuildExt(build_ext): ...@@ -1365,16 +1429,18 @@ class PyBuildExt(build_ext):
libraries = curses_libs) ) libraries = curses_libs) )
else: else:
missing.append('_curses') missing.append('_curses')
# Pyston change: disable these modules in this setup.py
# If the curses module is enabled, check for the panel module # # If the curses module is enabled, check for the panel module
if (module_enabled(exts, '_curses') and # if (module_enabled(exts, '_curses') and
self.compiler.find_library_file(lib_dirs, panel_library)): # self.compiler.find_library_file(lib_dirs, panel_library)):
exts.append( Extension('_curses_panel', ['_curses_panel.c'], # exts.append( Extension('_curses_panel', ['_curses_panel.c'],
include_dirs = curses_incs, # include_dirs = curses_incs,
libraries = [panel_library] + curses_libs) ) # libraries = [panel_library] + curses_libs) )
else: # else:
missing.append('_curses_panel') # missing.append('_curses_panel')
#
# Pyston change: the zlib module is handled by from_cpython/CMakefile
# And the code of build zlib in below is untested.
# Andrew Kuchling's zlib module. Note that some versions of zlib # Andrew Kuchling's zlib module. Note that some versions of zlib
# 1.1.3 have security problems. See CERT Advisory CA-2002-07: # 1.1.3 have security problems. See CERT Advisory CA-2002-07:
# http://www.cert.org/advisories/CA-2002-07.html # http://www.cert.org/advisories/CA-2002-07.html
...@@ -1420,28 +1486,30 @@ class PyBuildExt(build_ext): ...@@ -1420,28 +1486,30 @@ class PyBuildExt(build_ext):
else: else:
missing.append('zlib') missing.append('zlib')
# Helper module for various ascii-encoders. Uses zlib for an optimized # Pyston change: handled by from_cpython/CMakefile
# crc32 if we have it. Otherwise binascii uses its own. # # Helper module for various ascii-encoders. Uses zlib for an optimized
if have_zlib: # # crc32 if we have it. Otherwise binascii uses its own.
extra_compile_args = ['-DUSE_ZLIB_CRC32'] # if have_zlib:
libraries = ['z'] # extra_compile_args = ['-DUSE_ZLIB_CRC32']
extra_link_args = zlib_extra_link_args # libraries = ['z']
else: # extra_link_args = zlib_extra_link_args
extra_compile_args = [] # else:
libraries = [] # extra_compile_args = []
extra_link_args = [] # libraries = []
exts.append( Extension('binascii', ['binascii.c'], # extra_link_args = []
extra_compile_args = extra_compile_args, # exts.append( Extension('binascii', ['binascii.c'],
libraries = libraries, # extra_compile_args = extra_compile_args,
extra_link_args = extra_link_args) ) # libraries = libraries,
# extra_link_args = extra_link_args) )
#
# Gustavo Niemeyer's bz2 module. # Gustavo Niemeyer's bz2 module.
if (self.compiler.find_library_file(lib_dirs, 'bz2')): if (self.compiler.find_library_file(lib_dirs, 'bz2')):
if host_platform == "darwin": if host_platform == "darwin":
bz2_extra_link_args = ('-Wl,-search_paths_first',) bz2_extra_link_args = ('-Wl,-search_paths_first',)
else: else:
bz2_extra_link_args = () bz2_extra_link_args = ()
exts.append( Extension('bz2', ['bz2module.c'], exts.append( Extension('bz2', sources = map(relpath,
[ "Modules/bz2module.c", ]),
libraries = ['bz2'], libraries = ['bz2'],
extra_link_args = bz2_extra_link_args) ) extra_link_args = bz2_extra_link_args) )
else: else:
...@@ -1458,81 +1526,86 @@ class PyBuildExt(build_ext): ...@@ -1458,81 +1526,86 @@ class PyBuildExt(build_ext):
# #
# More information on Expat can be found at www.libexpat.org. # More information on Expat can be found at www.libexpat.org.
# #
if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"):
expat_inc = []
define_macros = []
expat_lib = ['expat']
expat_sources = []
expat_depends = []
else:
expat_inc = [os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')]
define_macros = [
('HAVE_EXPAT_CONFIG_H', '1'),
]
expat_lib = []
expat_sources = ['expat/xmlparse.c',
'expat/xmlrole.c',
'expat/xmltok.c']
expat_depends = ['expat/ascii.h',
'expat/asciitab.h',
'expat/expat.h',
'expat/expat_config.h',
'expat/expat_external.h',
'expat/internal.h',
'expat/latin1tab.h',
'expat/utf8tab.h',
'expat/xmlrole.h',
'expat/xmltok.h',
'expat/xmltok_impl.h'
]
# Pyston change: Pyston don't support CONFIG_ARGS yet
# if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"):
# expat_inc = []
# define_macros = []
# expat_lib = ['expat']
# expat_sources = []
# expat_depends = []
# else:
# expat_inc = [os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')]
define_macros = [('HAVE_EXPAT_CONFIG_H', '1'),]
expat_sources = map(relpath, ['Modules/expat/xmlparse.c',
'Modules/expat/xmlrole.c',
'Modules/expat/xmltok.c',
'Modules/pyexpat.c'])
expat_depends = map(relpath, ['Modules/expat/ascii.h',
'Modules/expat/asciitab.h',
'Modules/expat/expat.h',
'Modules/expat/expat_config.h',
'Modules/expat/expat_external.h',
'Modules/expat/internal.h',
'Modules/expat/latin1tab.h',
'Modules/expat/utf8tab.h',
'Modules/expat/xmlrole.h',
'Modules/expat/xmltok.h',
'Modules/expat/xmltok_impl.h'
])
exts.append(Extension('pyexpat', exts.append(Extension('pyexpat',
define_macros = define_macros, define_macros = define_macros,
include_dirs = expat_inc, include_dirs = [relpath('Modules/expat')],
libraries = expat_lib, sources = expat_sources,
sources = ['pyexpat.c'] + expat_sources,
depends = expat_depends, depends = expat_depends,
)) ))
# Pyston change: we don't need this complicated configuration for now.
# expat_inc = [os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')]
# Fredrik Lundh's cElementTree module. Note that this also # Fredrik Lundh's cElementTree module. Note that this also
# uses expat (via the CAPI hook in pyexpat). # uses expat (via the CAPI hook in pyexpat).
#
# if os.path.isfile(os.path.join(srcdir, 'Modules', '_elementtree.c')):
# define_macros.append(('USE_PYEXPAT_CAPI', None))
# elementtree depends on expat
define_macros = define_macros + [('USE_PYEXPAT_CAPI', None),]
if os.path.isfile(os.path.join(srcdir, 'Modules', '_elementtree.c')):
define_macros.append(('USE_PYEXPAT_CAPI', None))
exts.append(Extension('_elementtree', exts.append(Extension('_elementtree',
define_macros = define_macros, define_macros = define_macros,
include_dirs = expat_inc, include_dirs = [relpath('Modules/expat')],
libraries = expat_lib, # libraries = pyexpat.libraries,
sources = ['_elementtree.c'], sources = [relpath('Modules/_elementtree.c')],
depends = ['pyexpat.c'] + expat_sources + depends = expat_depends,
expat_depends,
)) ))
else: # else:
missing.append('_elementtree') # missing.append('_elementtree')
# Hye-Shik Chang's CJKCodecs modules. # Pyston change: disable those modules in setup.py for now
if have_unicode: # # Hye-Shik Chang's CJKCodecs modules.
exts.append(Extension('_multibytecodec', # if have_unicode:
['cjkcodecs/multibytecodec.c'])) # exts.append(Extension('_multibytecodec',
for loc in ('kr', 'jp', 'cn', 'tw', 'hk', 'iso2022'): # ['cjkcodecs/multibytecodec.c']))
exts.append(Extension('_codecs_%s' % loc, # for loc in ('kr', 'jp', 'cn', 'tw', 'hk', 'iso2022'):
['cjkcodecs/_codecs_%s.c' % loc])) # exts.append(Extension('_codecs_%s' % loc,
else: # ['cjkcodecs/_codecs_%s.c' % loc]))
missing.append('_multibytecodec') # else:
for loc in ('kr', 'jp', 'cn', 'tw', 'hk', 'iso2022'): # missing.append('_multibytecodec')
missing.append('_codecs_%s' % loc) # for loc in ('kr', 'jp', 'cn', 'tw', 'hk', 'iso2022'):
# missing.append('_codecs_%s' % loc)
# Dynamic loading module # #
if sys.maxint == 0x7fffffff: # # Dynamic loading module
# This requires sizeof(int) == sizeof(long) == sizeof(char*) # if sys.maxint == 0x7fffffff:
dl_inc = find_file('dlfcn.h', [], inc_dirs) # # This requires sizeof(int) == sizeof(long) == sizeof(char*)
if (dl_inc is not None) and (host_platform not in ['atheos']): # dl_inc = find_file('dlfcn.h', [], inc_dirs)
exts.append( Extension('dl', ['dlmodule.c']) ) # if (dl_inc is not None) and (host_platform not in ['atheos']):
else: # exts.append( Extension('dl', ['dlmodule.c']) )
missing.append('dl') # else:
else: # missing.append('dl')
missing.append('dl') # else:
# missing.append('dl')
#
# Thomas Heller's _ctypes module # Thomas Heller's _ctypes module
self.detect_ctypes(inc_dirs, lib_dirs) self.detect_ctypes(inc_dirs, lib_dirs)
...@@ -1576,42 +1649,39 @@ class PyBuildExt(build_ext): ...@@ -1576,42 +1649,39 @@ class PyBuildExt(build_ext):
] ]
else: else:
multiprocessing_srcs = [ '_multiprocessing/multiprocessing.c', multiprocessing_srcs = map(relpath, [
'_multiprocessing/socket_connection.c' "Modules/_multiprocessing/multiprocessing.c",
] "Modules/_multiprocessing/socket_connection.c",
if (sysconfig.get_config_var('HAVE_SEM_OPEN') and not "Modules/_multiprocessing/semaphore.c",
sysconfig.get_config_var('POSIX_SEMAPHORES_NOT_ENABLED')): ])
multiprocessing_srcs.append('_multiprocessing/semaphore.c') # if sysconfig.get_config_var('WITH_THREAD'):
exts.append( Extension('_multiprocessing', multiprocessing_srcs,
if sysconfig.get_config_var('WITH_THREAD'):
exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
define_macros=macros.items(),
include_dirs=["Modules/_multiprocessing"])) include_dirs=["Modules/_multiprocessing"]))
else: # else:
missing.append('_multiprocessing') # missing.append('_multiprocessing')
# End multiprocessing # End multiprocessing
# Pyston change: disable these modules in this setup.py
# Platform-specific libraries # # Platform-specific libraries
if host_platform == 'linux2': # if host_platform == 'linux2':
# Linux-specific modules # # Linux-specific modules
exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) ) # exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
else: # else:
missing.append('linuxaudiodev') # missing.append('linuxaudiodev')
#
if (host_platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6', # if (host_platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
'freebsd7', 'freebsd8') # 'freebsd7', 'freebsd8')
or host_platform.startswith("gnukfreebsd")): # or host_platform.startswith("gnukfreebsd")):
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) ) # exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
else: # else:
missing.append('ossaudiodev') # missing.append('ossaudiodev')
#
if host_platform == 'sunos5': # if host_platform == 'sunos5':
# SunOS specific modules # # SunOS specific modules
exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) ) # exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) )
else: # else:
missing.append('sunaudiodev') # missing.append('sunaudiodev')
if host_platform == 'darwin': if host_platform == 'darwin':
# _scproxy # _scproxy
...@@ -1622,6 +1692,7 @@ class PyBuildExt(build_ext): ...@@ -1622,6 +1692,7 @@ class PyBuildExt(build_ext):
])) ]))
# Pyston change: this code is untested in Mac
if host_platform == 'darwin' and ("--disable-toolbox-glue" not in if host_platform == 'darwin' and ("--disable-toolbox-glue" not in
sysconfig.get_config_var("CONFIG_ARGS")): sysconfig.get_config_var("CONFIG_ARGS")):
...@@ -1720,12 +1791,12 @@ class PyBuildExt(build_ext): ...@@ -1720,12 +1791,12 @@ class PyBuildExt(build_ext):
self.extensions.extend(exts) self.extensions.extend(exts)
# Pyston change: disbale the tk module
# Call the method for detecting whether _tkinter can be compiled # # Call the method for detecting whether _tkinter can be compiled
self.detect_tkinter(inc_dirs, lib_dirs) # self.detect_tkinter(inc_dirs, lib_dirs)
#
if '_tkinter' not in [e.name for e in self.extensions]: # if '_tkinter' not in [e.name for e in self.extensions]:
missing.append('_tkinter') # missing.append('_tkinter')
## # Uncomment these lines if you want to play with xxmodule.c ## # Uncomment these lines if you want to play with xxmodule.c
## ext = Extension('xx', ['xxmodule.c']) ## ext = Extension('xx', ['xxmodule.c'])
...@@ -2055,11 +2126,12 @@ class PyBuildExt(build_ext): ...@@ -2055,11 +2126,12 @@ class PyBuildExt(build_ext):
include_dirs = [] include_dirs = []
extra_compile_args = [] extra_compile_args = []
extra_link_args = [] extra_link_args = []
sources = ['_ctypes/_ctypes.c', sources = map(relpath, ["Modules/_ctypes/_ctypes.c",
'_ctypes/callbacks.c', "Modules/_ctypes/callbacks.c",
'_ctypes/callproc.c', "Modules/_ctypes/callproc.c",
'_ctypes/stgdict.c', "Modules/_ctypes/stgdict.c",
'_ctypes/cfield.c'] "Modules/_ctypes/cfield.c"
])
depends = ['_ctypes/ctypes.h'] depends = ['_ctypes/ctypes.h']
if host_platform == 'darwin': if host_platform == 'darwin':
...@@ -2092,18 +2164,22 @@ class PyBuildExt(build_ext): ...@@ -2092,18 +2164,22 @@ class PyBuildExt(build_ext):
sources=sources, sources=sources,
depends=depends) depends=depends)
ext_test = Extension('_ctypes_test', ext_test = Extension('_ctypes_test',
sources=['_ctypes/_ctypes_test.c']) sources= map(relpath, ['Modules/_ctypes/_ctypes_test.c']))
self.extensions.extend([ext, ext_test]) self.extensions.extend([ext, ext_test])
if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"): # Pyston change: Pyston don't support CONFIG_ARGS yet.
return # if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"):
# return
if host_platform == 'darwin': if host_platform == 'darwin':
# OS X 10.5 comes with libffi.dylib; the include files are # OS X 10.5 comes with libffi.dylib; the include files are
# in /usr/include/ffi # in /usr/include/ffi
inc_dirs.append('/usr/include/ffi') inc_dirs.append('/usr/include/ffi')
ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")] # Pyston change: still hard code the ffi include dir
# because we don't support this variable configuration in get_config_var yet
ffi_inc = ['/usr/include/x86_64-linux-gnu']
# ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
if not ffi_inc or ffi_inc[0] == '': if not ffi_inc or ffi_inc[0] == '':
ffi_inc = find_file('ffi.h', [], inc_dirs) ffi_inc = find_file('ffi.h', [], inc_dirs)
if ffi_inc is not None: if ffi_inc is not None:
...@@ -2206,29 +2282,18 @@ def main(): ...@@ -2206,29 +2282,18 @@ def main():
# turn off warnings when deprecated modules are imported # turn off warnings when deprecated modules are imported
import warnings import warnings
warnings.filterwarnings("ignore",category=DeprecationWarning) warnings.filterwarnings("ignore",category=DeprecationWarning)
setup(# PyPI Metadata (PEP 301) setup(
name = "Python", name = "Pyston",
version = sys.version.split()[0], version = "1.0",
url = "http://www.python.org/%s" % sys.version[:3], description = "Pyston shared modules",
maintainer = "Guido van Rossum and the Python community",
maintainer_email = "python-dev@python.org",
description = "A high-level object-oriented programming language",
long_description = SUMMARY.strip(),
license = "PSF license",
classifiers = filter(None, CLASSIFIERS.split("\n")),
platforms = ["Many"],
# Build info # Build info
cmdclass = {'build_ext':PyBuildExt, 'install':PyBuildInstall, cmdclass = {'build_ext':PyBuildExt,},
'install_lib':PyBuildInstallLib},
# The struct module is defined here, because build_ext won't be # The struct module is defined here, because build_ext won't be
# called unless there's at least one extension module defined. # called unless there's at least one extension module defined.
ext_modules=[Extension('_struct', ['_struct.c'])], ext_modules = [Extension("_struct", sources = map(relpath, [
"Modules/_struct.c",
]))]
# Scripts to install
scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
'Tools/scripts/2to3',
'Lib/smtpd.py']
) )
# --install-platlib # --install-platlib
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment