[Synopsis-cvs] Synopsis/Synopsis/Synopsis/dist/command build_ext.py,1.3,1.4 config.py,1.3,1.4

Stefan Seefeld stefan at synopsis.fresco.org
Sun Sep 21 12:57:02 UTC 2003


Update of /cvs/synopsis/Synopsis/Synopsis/dist/command
In directory frida:/tmp/cvs-serv25413/Synopsis/dist/command

Modified Files:
	build_ext.py config.py 
Log Message:
better integration of 'config' command into build system

Index: build_ext.py
===================================================================
RCS file: /cvs/synopsis/Synopsis/Synopsis/dist/command/build_ext.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -d -r1.3 -r1.4
--- build_ext.py	18 Sep 2003 20:30:21 -0000	1.3
+++ build_ext.py	21 Sep 2003 19:56:46 -0000	1.4
@@ -10,6 +10,8 @@ class build_ext(build_ext.build_ext):
 
     def run(self):
 
+        if not os.path.exists(self.build_temp):
+            self.run_command('config')
         for ext in self.extensions:
             self.build_extension(ext)
 
@@ -31,7 +33,7 @@ class build_ext(build_ext.build_ext):
 
         output = []
         for ext in self.extensions:
-            #only append the files that actually could be build
+            #only append the files that actually could be built
             path = os.path.join(self.build_temp, ext[0], ext[1])
             if os.path.isfile(path):
                 output.append(os.path.join(self.build_lib, ext[0], ext[1]))
@@ -45,8 +47,9 @@ class build_ext(build_ext.build_ext):
 
         path = os.path.join(self.build_temp, ext[0])
         if not os.path.exists(path):
-            self.run_command('config')
-
+            self.announce("...not configured, skipping")
+            return
+        
         command = "make -C %s %s"%(path, ext[1])
         spawn(['sh', '-c', command], self.verbose, self.dry_run)
         #The extension may not be compiled. For now just skip it.

Index: config.py
===================================================================
RCS file: /cvs/synopsis/Synopsis/Synopsis/dist/command/config.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -d -r1.3 -r1.4
--- config.py	18 Sep 2003 20:30:21 -0000	1.3
+++ config.py	21 Sep 2003 19:56:46 -0000	1.4
@@ -14,21 +14,26 @@ class config(build.build):
 
     user_options = build.build.user_options[:] + [
         ('disable-gc', None,
-         "whether or not to build the C++ parser with the garbage collector")
+         "whether or not to build the C++ parser with the garbage collector"),
+        ('enable-c', None,
+         "whether or not to build the C parser")
         ]
-    boolean_options = build.build.boolean_options[:] + ['disable-gc']
+    boolean_options = build.build.boolean_options[:] + ['disable-gc', 'enable-c']
 
     def initialize_options (self):
         build.build.initialize_options(self)
         self.disable_gc = 0
+        self.enable_c = 0
 
     def finalize_options (self):
         build.build.finalize_options(self)
         # only append the path once 
         self.extensions = []
         for e in self.distribution.ext_modules:
-            if not self.extensions.count(e[0]):
+            if e[0] not in self.extensions:
                 self.extensions.append(e[0])
+        if not self.enable_c and 'Synopsis/Parser/C' in self.extensions:
+            self.extensions.remove('Synopsis/Parser/C')
 
     def run(self):
 





More information about the Synopsis-changes mailing list