mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Patch #103899: Don't compile modules configured in Setup. This seems much
simpler than adding a bazillion switches, but means that the makesetup method probably can't ever go away completely. Oh well...
This commit is contained in:
parent
e06337a928
commit
8d7f0869ee
1 changed files with 16 additions and 0 deletions
16
setup.py
16
setup.py
|
@ -8,6 +8,7 @@ __version__ = "$Revision$"
|
||||||
|
|
||||||
import sys, os, getopt
|
import sys, os, getopt
|
||||||
from distutils import sysconfig
|
from distutils import sysconfig
|
||||||
|
from distutils import text_file
|
||||||
from distutils.errors import *
|
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
|
||||||
|
@ -89,6 +90,21 @@ 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 to figure out which modules are turned
|
||||||
|
# on in the file.
|
||||||
|
input = text_file.TextFile('Modules/Setup', join_lines=1)
|
||||||
|
remove_modules = []
|
||||||
|
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)
|
||||||
|
|
||||||
# When you run "make CC=altcc" or something similar, you really want
|
# When you run "make CC=altcc" or something similar, you really want
|
||||||
# those environment variables passed into the setup.py phase. Here's
|
# those environment variables passed into the setup.py phase. Here's
|
||||||
# a small set of useful ones.
|
# a small set of useful ones.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue