changed: #fileInClassLibrary:inPackage:
authorClaus Gittinger <cg@exept.de>
Fri, 07 Oct 2011 23:50:06 +0200
changeset 13785 966eb3315984
parent 13784 64c593e788bd
child 13786 c7b1422f915d
changed: #fileInClassLibrary:inPackage:
Smalltalk.st
--- a/Smalltalk.st	Fri Oct 07 21:23:11 2011 +0200
+++ b/Smalltalk.st	Fri Oct 07 23:50:06 2011 +0200
@@ -5783,8 +5783,8 @@
      and load it. This installs all of its contained classes.
      Return true if ok, false if not.
      Notice: the argument may not have an extension (by purpose);
-	     the sharedLib extension (.dll / .so / .sl) is added here, to
-	     make the caller independent of the underlying operatingSystem."
+             the sharedLib extension (.dll / .so / .sl) is added here, to
+             make the caller independent of the underlying operatingSystem."
 
     |baseName handle libraryFilename packagePath|
 
@@ -5792,21 +5792,28 @@
 
     baseName := aClassLibraryName asFilename withSuffix:(ObjectFileLoader sharedLibrarySuffix).
     baseName exists ifTrue:[
-	"/ load local file first...
-	handle := ObjectFileLoader loadObjectFile:baseName.
+        "/ load local file first...
+        handle := ObjectFileLoader loadObjectFile:baseName.
     ].
     handle isNil ifTrue:[
-	packagePath := self getPackageDirectoryForPackage:packageID.
-	packagePath isNil ifTrue:[^ false].
-	packagePath := packagePath asFilename.
-	libraryFilename := packagePath / baseName.
-	libraryFilename exists ifFalse:[
-	    "in windows (with Borland compiler, DLLs in development environment are under objbc"
-	    libraryFilename := packagePath / 'objbc' / baseName.
-	].
-	libraryFilename exists ifTrue:[
-	    handle := ObjectFileLoader loadObjectFile:libraryFilename pathName.
-	].
+        packagePath := self getPackageDirectoryForPackage:packageID.
+        packagePath isNil ifTrue:[^ false].
+        packagePath := packagePath asFilename.
+        libraryFilename := packagePath / baseName.
+        libraryFilename exists ifFalse:[
+            libraryFilename := nil.    
+            #('objbc' 'objvc') do:[:eachPossibleCompiledCodeDir |    
+                "in windows, with Borland compiler, DLLs in development environment are under objbc;
+                 with MSVC, they are under objvc"
+                libraryFilename isNil ifTrue:[
+                    libraryFilename := packagePath / eachPossibleCompiledCodeDir / baseName.
+                    libraryFilename exists ifFalse:[ libraryFilename := nil ]
+                ].
+            ].
+        ].
+        libraryFilename exists ifTrue:[
+            handle := ObjectFileLoader loadObjectFile:libraryFilename pathName.
+        ].
     ].
 
 "/    handle notNil ifTrue:[
@@ -5820,7 +5827,7 @@
      Smalltalk fileInClassLibrary:'refactoryBrowser' inPackage:'stx:goodies/refactoryBrowser'
     "
 
-    "Modified: 8.1.1997 / 17:58:56 / cg"
+    "Modified: / 07-10-2011 / 23:49:47 / cg"
 !
 
 fileInSourceFile:filename lazy:loadLazy silent:beSilent
@@ -7676,11 +7683,11 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.977 2011-10-07 09:46:22 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.978 2011-10-07 21:50:06 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.977 2011-10-07 09:46:22 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.978 2011-10-07 21:50:06 cg Exp $'
 !
 
 version_SVN