summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2001-02-23 16:32:32 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2001-02-23 16:32:32 (GMT)
commit8d7f0869ee672d7e9e8e1bf126bf717d8223ee2b (patch)
treec4eb47aeb26abf85d1346a15bd80624c9d77d214 /setup.py
parente06337a9285ce50ba86dd7dff27df0b56905a8b0 (diff)
downloadcpython-8d7f0869ee672d7e9e8e1bf126bf717d8223ee2b.zip
cpython-8d7f0869ee672d7e9e8e1bf126bf717d8223ee2b.tar.gz
cpython-8d7f0869ee672d7e9e8e1bf126bf717d8223ee2b.tar.bz2
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...
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 4e8008b..0892f16 100644
--- a/setup.py
+++ b/setup.py
@@ -8,6 +8,7 @@ __version__ = "$Revision$"
import sys, os, getopt
from distutils import sysconfig
+from distutils import text_file
from distutils.errors import *
from distutils.core import Extension, setup
from distutils.command.build_ext import build_ext
@@ -89,6 +90,21 @@ class PyBuildExt(build_ext):
if ext.name in sys.builtin_module_names:
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
# those environment variables passed into the setup.py phase. Here's
# a small set of useful ones.