[Synopsis-cvs] Synopsis/Synopsis/Synopsis/dist/command config.py,1.1,1.2

Stefan Seefeld stefan at frida.spi-inc.org
Wed Sep 17 21:11:01 UTC 2003


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

Modified Files:
	config.py 
Log Message:
C++ and C parser modules now compile via 'python setup.py build_ext'.

Index: config.py
===================================================================
RCS file: /cvs/synopsis/Synopsis/Synopsis/dist/command/config.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -d -r1.1 -r1.2
--- config.py	18 Sep 2003 02:54:14 -0000	1.1
+++ config.py	18 Sep 2003 04:10:05 -0000	1.2
@@ -12,8 +12,21 @@ class config(build.build):
 
     description = "configure the package"
 
+    user_options = build.build.user_options[:] + [
+        ('disable-gc', None,
+         "whether or not to build the C++ parser with the garbage collector")
+        ]
+    boolean_options = build.build.boolean_options[:] + ['disable-gc']
+
     extensions = ['Synopsis/Parser/C', 'Synopsis/Parser/C++']
 
+    def initialize_options (self):
+        build.build.initialize_options(self)
+        self.disable_gc = 0
+
+    def finalize_options (self):
+        build.build.finalize_options(self)
+
     def run(self):
 
         self.config_extensions()
@@ -22,7 +35,9 @@ class config(build.build):
 
         for ext in config.extensions:
             self.config_extension(ext)
-
+        if not self.disable_gc:
+            self.config_extension('Synopsis/Parser/C++/gc')
+            
     def config_extension(self, ext):
 
         self.announce("configuring '%s'" % ext)
@@ -38,5 +53,8 @@ class config(build.build):
         os.chdir(tempdir)
 
         command = "%s/configure --with-python=%s"%(srcdir, sys.executable)
+        if ext == 'Synopsis/Parser/C++' and self.disable_gc:
+            command += ' --disable-gc'
+        self.announce(command)
         spawn(['sh', '-c', command], self.verbose, self.dry_run)
         os.chdir(cwd)





More information about the Synopsis-changes mailing list