[Python-checkins] CVS: python/dist/src setup.py,1.29,1.30

A.M. Kuchling akuchling@users.sourceforge.net
Fri, 23 Feb 2001 08:32:34 -0800


Update of /cvsroot/python/python/dist/src
In directory usw-pr-cvs1:/tmp/cvs-serv16212

Modified Files:
	setup.py 
Log Message:
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...


Index: setup.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/setup.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** setup.py	2001/02/23 16:27:48	1.29
--- setup.py	2001/02/23 16:32:32	1.30
***************
*** 9,12 ****
--- 9,13 ----
  import sys, os, getopt
  from distutils import sysconfig
+ from distutils import text_file
  from distutils.errors import *
  from distutils.core import Extension, setup
***************
*** 90,93 ****
--- 91,109 ----
                  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