[Python-checkins] python/dist/src/Lib/distutils emxccompiler.py,1.6,1.7
aimacintyre@users.sourceforge.net
aimacintyre@users.sourceforge.net
2002年8月03日 23:21:27 -0700
Update of /cvsroot/python/python/dist/src/Lib/distutils
In directory usw-pr-cvs1:/tmp/cvs-serv5140
Modified Files:
emxccompiler.py
Log Message:
- comment improvement
- implement viable library search routine for EMX
Index: emxccompiler.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/emxccompiler.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** emxccompiler.py 4 Aug 2002 06:17:08 -0000 1.6
--- emxccompiler.py 4 Aug 2002 06:21:25 -0000 1.7
***************
*** 178,182 ****
# -- Miscellaneous methods -----------------------------------------
! # overwrite the one from CCompiler to support rc and res-files
def object_filenames (self,
source_filenames,
--- 178,183 ----
# -- Miscellaneous methods -----------------------------------------
! # override the object_filenames method from CCompiler to
! # support rc and res-files
def object_filenames (self,
source_filenames,
***************
*** 204,207 ****
--- 205,231 ----
# object_filenames ()
+
+ # override the find_library_file method from UnixCCompiler
+ # to deal with file naming/searching differences
+ def find_library_file(self, dirs, lib, debug=0):
+ shortlib = '%s.lib' % lib
+ longlib = 'lib%s.lib' % lib # this form very rare
+
+ # get EMX's default library directory search path
+ try:
+ emx_dirs = os.environ['LIBRARY_PATH'].split(';')
+ except KeyError:
+ emx_dirs = []
+
+ for dir in dirs + emx_dirs:
+ shortlibp = os.path.join(dir, shortlib)
+ longlibp = os.path.join(dir, longlib)
+ if os.path.exists(shortlibp):
+ return shortlibp
+ elif os.path.exists(longlibp):
+ return longlibp
+
+ # Oops, didn't find it in *any* of 'dirs'
+ return None
# class EMXCCompiler