]> granicus.if.org Git - python/commitdiff
Changed to pay attention to the 'runtime_library_dirs' list (= 'rpath'
authorGreg Ward <gward@python.net>
Sat, 18 Mar 2000 15:19:51 +0000 (15:19 +0000)
committerGreg Ward <gward@python.net>
Sat, 18 Mar 2000 15:19:51 +0000 (15:19 +0000)
option in the 'build_ext' command):
  * in ccompiler.py: 'gen_lib_options()' now takes 'runtime_library_dirs'
    parameter
  * in unixccompiler.py and msvccompiler.py: now pass
    'self.runtime_library_dirs' to 'gen_lib_options()', and define
    'runtime_library_dir_option()' (although in msvccompiler.py it
    blows up with a DistutilsPlatformError right now!)

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

index 46dabadee92ff3d995d5bebc5830020cfa51e955..4a8c1d38c83b504cc4040429f372f78f0d84e7d6 100644 (file)
@@ -770,7 +770,7 @@ def gen_preprocess_options (macros, include_dirs):
 # gen_preprocess_options ()
 
 
-def gen_lib_options (compiler, library_dirs, libraries):
+def gen_lib_options (compiler, library_dirs, runtime_library_dirs, libraries):
     """Generate linker options for searching library directories and
        linking with specific libraries.  'libraries' and 'library_dirs'
        are, respectively, lists of library names (not filenames!) and
@@ -783,6 +783,9 @@ def gen_lib_options (compiler, library_dirs, libraries):
     for dir in library_dirs:
         lib_opts.append (compiler.library_dir_option (dir))
 
+    for dir in runtime_library_dirs:
+        lib_opts.append (compiler.runtime_library_dir_option (dir))
+
     # XXX it's important that we *not* remove redundant library mentions!
     # sometimes you really do have to say "-lfoo -lbar -lfoo" in order to
     # resolve all symbols.  I just hope we never have to say "-lfoo obj.o
index bf5257f1d6b7aca2f526d04ad55a05cde93ab283..7324b8e1c622c123c8b63923fa071a814e666577 100644 (file)
@@ -307,7 +307,9 @@ class MSVCCompiler (CCompiler) :
             self._fix_link_args (objects, output_dir, takes_libs=1,
                                  libraries=libraries, library_dirs=library_dirs)
         
-        lib_opts = gen_lib_options (self, library_dirs, libraries)
+        lib_opts = gen_lib_options (self,
+                                    library_dirs, self.runtime_library_dirs,
+                                    libraries)
         if type (output_dir) not in (StringType, NoneType):
             raise TypeError, "'output_dir' must be a string or None"
         if output_dir is not None:
@@ -348,6 +350,10 @@ class MSVCCompiler (CCompiler) :
     def library_dir_option (self, dir):
         return "/LIBPATH:" + dir
 
+    def runtime_library_dir_option (self, dir):
+        raise DistutilsPlatformError, \
+              "don't know how to set runtime library search path for MSVC++"
+
     def library_option (self, lib):
         return self.library_filename (lib)
 
index 0d2858de1cc46cc3940629f15adeb726b7b30020..ec85571ddfac7c7c37d3e95565b9a159e6564ce6 100644 (file)
@@ -197,7 +197,9 @@ class UnixCCompiler (CCompiler):
             self._fix_link_args (objects, output_dir, takes_libs=1,
                                  libraries=libraries, library_dirs=library_dirs)
 
-        lib_opts = gen_lib_options (self, library_dirs, libraries)
+        lib_opts = gen_lib_options (self,
+                                    library_dirs, self.runtime_library_dirs,
+                                    libraries)
         if type (output_dir) not in (StringType, NoneType):
             raise TypeError, "'output_dir' must be a string or None"
         if output_dir is not None:
@@ -234,7 +236,9 @@ class UnixCCompiler (CCompiler):
             self._fix_link_args (objects, output_dir, takes_libs=1,
                                  libraries=libraries, library_dirs=library_dirs)
 
-        lib_opts = gen_lib_options (self, library_dirs, libraries)
+        lib_opts = gen_lib_options (self,
+                                    library_dirs, self.runtime_library_dirs,
+                                    libraries)
         output_filename = output_progname # Unix-ism!
         if output_dir is not None:
             output_filename = os.path.join (output_dir, output_filename)
@@ -262,6 +266,9 @@ class UnixCCompiler (CCompiler):
     def library_dir_option (self, dir):
         return "-L" + dir
 
+    def runtime_library_dir_option (self, dir):
+        return "-R" + dir
+
     def library_option (self, lib):
         return "-l" + lib