--- a/ObjectFileLoader.st Thu Mar 21 11:20:13 2013 +0100
+++ b/ObjectFileLoader.st Fri Mar 22 11:08:27 2013 +0100
@@ -2611,7 +2611,8 @@
Other systems may require more ..."
|osType oFileName soFileName expFileName librunExpFileName
- needSharedObject ld ldArg expFile ok outfile output libDir libDirBasename|
+ needSharedObject ld ldArg expFile ok outfile output libDir libDirBasename
+ errorMessage homeDir|
osType := OperatingSystem getOSType.
@@ -2640,21 +2641,24 @@
]
]
].
-
- libDir := '..\',libDirBasename.
- libDir asFilename exists ifFalse:[
- libDir := '..\lib\',libDirBasename.
- libDir asFilename exists ifFalse:[
- libDir := '..\lib'.
- libDir asFilename exists ifFalse:[
- libDir := '..\..\',libDirBasename.
- libDir asFilename exists ifFalse:[
- ObjectFileLoadError raiseRequestErrorString:'could not locate directory where .lib files are'.
- LastError := 'could not locate directory where .lib files are'.
- ^ nil
- ]
- ]
- ]
+ homeDir := Smalltalk packagePath detect:[:p | (p asFilename / 'stx' / libDirBasename) exists] ifNone:nil.
+ homeDir notNil ifTrue:[
+ libDir := homeDir asFilename / 'stx' / libDirBasename
+ ].
+ libDir isNil ifTrue:[
+ "/ some fallback
+ libDir := #( '..'
+ '..\..'
+ '..\..\..'
+ '..\..\stx'
+ '..\..\..\stx'
+ ) detect:[:p | (p asFilename / libDirBasename) exists] ifNone:nil.
+
+ libDir isNil ifTrue:[
+ LastError := errorMessage := 'could not locate directory where .lib files are (',libDirBasename,')'.
+ ObjectFileLoadError raiseRequestErrorString:errorMessage.
+ ^ nil
+ ].
].
"/ ].
@@ -4493,11 +4497,11 @@
!ObjectFileLoader class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.344 2013-03-11 14:29:24 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.345 2013-03-22 10:08:27 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.344 2013-03-11 14:29:24 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.345 2013-03-22 10:08:27 cg Exp $'
! !