]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added support for the 'export_symbols' parameter to 'link_shared_object()'
authorGreg Ward <gward@python.net>
Sat, 20 May 2000 13:23:21 +0000 (13:23 +0000)
committerGreg Ward <gward@python.net>
Sat, 20 May 2000 13:23:21 +0000 (13:23 +0000)
and 'link_shared_lib()'.  In MSVCCompiler, this is meaningful: it adds
/EXPORT: options to the linker command line.  In UnixCCompiler, it
is ignored.

Lib/distutils/ccompiler.py
Lib/distutils/msvccompiler.py
Lib/distutils/unixccompiler.py

index ffad294706d45bf369826a6f26bae91ff89063c2..51f5ae02a91a84720a897d2897999f23115c789f 100644 (file)
@@ -493,6 +493,7 @@ class CCompiler:
                          libraries=None,
                          library_dirs=None,
                          runtime_library_dirs=None,
+                         export_symbols=None,
                          debug=0,
                          extra_preargs=None,
                          extra_postargs=None):
@@ -515,7 +516,13 @@ class CCompiler:
            search for libraries that were specified as bare library names
            (ie. no directory component).  These are on top of the system
            default and those supplied to 'add_library_dir()' and/or
-           'set_library_dirs()'.
+           'set_library_dirs()'.  'runtime_library_dirs' is a list of
+           directories that will be embedded into the shared library and
+           used to search for other shared libraries that *it* depends on
+           at run-time.  (This may only be relevant on Unix.)
+
+           'export_symbols' is a list of symbols that the shared library
+           will export.  (This appears to be relevant only on Windows.)
 
            'debug' is as for 'compile()' and 'create_static_lib()', with the
            slight distinction that it actually matters on most platforms
@@ -536,6 +543,7 @@ class CCompiler:
                             libraries=None,
                             library_dirs=None,
                             runtime_library_dirs=None,
+                            export_symbols=None,
                             debug=0,
                             extra_preargs=None,
                             extra_postargs=None):
index 3667afcd2dd9982c478032d4c6037ad7bc9d8387..b6ff432ce341062d2416d36aee0809d007c984cc 100644 (file)
@@ -304,6 +304,7 @@ class MSVCCompiler (CCompiler) :
                          libraries=None,
                          library_dirs=None,
                          runtime_library_dirs=None,
+                         export_symbols=None,
                          debug=0,
                          extra_preargs=None,
                          extra_postargs=None):
@@ -313,6 +314,8 @@ class MSVCCompiler (CCompiler) :
                                  output_dir=output_dir,
                                  libraries=libraries,
                                  library_dirs=library_dirs,
+                                 runtime_library_dirs=runtime_library_dirs,
+                                 export_symbols=export_symbols,
                                  debug=debug,
                                  extra_preargs=extra_preargs,
                                  extra_postargs=extra_postargs)
@@ -325,6 +328,7 @@ class MSVCCompiler (CCompiler) :
                             libraries=None,
                             library_dirs=None,
                             runtime_library_dirs=None,
+                            export_symbols=None,
                             debug=0,
                             extra_preargs=None,
                             extra_postargs=None):
@@ -350,8 +354,12 @@ class MSVCCompiler (CCompiler) :
             else:
                 ldflags = self.ldflags_shared
 
-            ld_args = ldflags + lib_opts + \
-                      objects + ['/OUT:' + output_filename]
+            export_opts = []
+            for sym in (export_symbols or []):
+                export_opts.append("/EXPORT:" + sym)
+
+            ld_args = (ldflags + lib_opts + export_opts + 
+                       objects + ['/OUT:' + output_filename])
 
             if extra_preargs:
                 ld_args[:0] = extra_preargs
index 5e1524c67c833b6c8e0977dfc6cfd837fa8ee90b..40f564ab8854f9a628dfcf686216e05b7bba82d7 100644 (file)
@@ -178,6 +178,7 @@ class UnixCCompiler (CCompiler):
                          libraries=None,
                          library_dirs=None,
                          runtime_library_dirs=None,
+                         export_symbols=None,
                          debug=0,
                          extra_preargs=None,
                          extra_postargs=None):
@@ -188,6 +189,7 @@ class UnixCCompiler (CCompiler):
             libraries,
             library_dirs,
             runtime_library_dirs,
+            export_symbols,
             debug,
             extra_preargs,
             extra_postargs)
@@ -200,6 +202,7 @@ class UnixCCompiler (CCompiler):
                             libraries=None,
                             library_dirs=None,
                             runtime_library_dirs=None,
+                            export_symbols=None,
                             debug=0,
                             extra_preargs=None,
                             extra_postargs=None):