[Python-checkins] CVS: python/dist/src/Lib/distutils unixccompiler.py,1.37,1.38

Fred L. Drake fdrake@users.sourceforge.net
Mon, 10 Dec 2001 21:04:26 -0800


Update of /cvsroot/python/python/dist/src/Lib/distutils
In directory usw-pr-cvs1:/tmp/cvs-serv28424/Lib/distutils

Modified Files:
	unixccompiler.py 
Log Message:
When using GCC, use the right option to add a directory to the list of dirs
searched for a dependency for runtime linking.
This closes SF bug #445902.


Index: unixccompiler.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/unixccompiler.py,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** unixccompiler.py	2001/12/06 20:51:35	1.37
--- unixccompiler.py	2001/12/11 05:04:24	1.38
***************
*** 21,24 ****
--- 21,25 ----
  from types import *
  from copy import copy
+ from distutils import sysconfig
  from distutils.dep_util import newer
  from distutils.ccompiler import \
***************
*** 250,254 ****
  
      def runtime_library_dir_option (self, dir):
!         return "-R" + dir
  
      def library_option (self, lib):
--- 251,271 ----
  
      def runtime_library_dir_option (self, dir):
!         # XXX Hackish, at the very least.  See Python bug #445902:
!         # http://sourceforge.net/tracker/index.php
!         #   ?func=detail&aid=445902&group_id=5470&atid=105470
!         # Linkers on different platforms need different options to
!         # specify that directories need to be added to the list of
!         # directories searched for dependencies when a dynamic library
!         # is sought.  GCC has to be told to pass the -R option through
!         # to the linker, whereas other compilers just know this.
!         # Other compilers may need something slightly different.  At
!         # this time, there's no way to determine this information from
!         # the configuration data stored in the Python installation, so
!         # we use this hack.
!         compiler = os.path.basename(sysconfig.get_config_var("CC"))
!         if compiler == "gcc" or compiler == "g++":
!             return "-Wl,-R" + dir
!         else:
!             return "-R" + dir
  
      def library_option (self, lib):