pyd / support.py

Diff from to

support.py

     description = "Build a D application that embeds python with Pyd"
 
     user_options = [
-            ("optimize", "O", "Ask the D compiler to optimize the generated code, at the expense of"
+        ('compiler=', 'c',
+         "specify the compiler type"),
+        ("optimize", "O", "Ask the D compiler to optimize the generated code, at the expense of"
                 " safety features such as array bounds checks."),
-            ("print-flags", None, "Don't build, just print out version flags for pyd") ]
+        ('debug', 'g',
+         "compile extensions and libraries with debugging information"),
+        ('force', 'f',
+         "forcibly build everything (ignore file timestamps)"),
+        ("print-flags", None, "Don't build, just print out version flags for pyd") ]
 
-    boolean_options = ['print-flags']
+    boolean_options = ['print-flags', 'debug', 'force']
 
     def initialize_options(self):
         self.print_flags = False
         self.libraries = None
         self.library_dirs = None
         self.link_objects = None
-        self.debug = 0
+        self.debug = None
         self.optimize = 0
         self.dry_run = 0
         self.verbose = 0
         return os.path.join(*ext_path) + exe_ext
 
     def get_libraries(self, ext):
-        return ext.libraries
-
+        # mostly copied from build_ext.get_libraries
+        if sys.platform == "win32":
+            return ext.libraries
+        elif sys.platform[:6] == "cygwin":
+            return ext.libraries
+        else:
+            from distutils import sysconfig
+            if sysconfig.get_config_var('Py_ENABLE_SHARED'):
+                template = "python%d.%d"
+                pythonlib = (template %
+                             (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
+                if sys.pydebug:
+                    pythonlib += '_d'
+                return ext.libraries + [pythonlib]
+            else:
+                return ext.libraries
 
 def setup(*args, **kwargs):
     if 'cmdclass' not in kwargs:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.