diff setup.py @ 16750:90e90c92198b legacy-trunk

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...
author Andrew M. Kuchling <amk@amk.ca>
date Fri, 23 Feb 2001 16:32:32 +0000
parents 7815919e2af8
children 8156879fe60d
line wrap: on
line diff
--- a/setup.py	Fri Feb 23 16:27:48 2001 +0000
+++ b/setup.py	Fri Feb 23 16:32:32 2001 +0000
@@ -8,6 +8,7 @@
 
 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 @@
             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.