#BUGFIX by stefan
authorStefan Vogel <sv@exept.de>
Mon, 02 Jul 2018 14:22:11 +0200
changeset 23177 1f49ca31ecc8
parent 23176 2fb80eee8c4d
child 23178 9744ff458ba9
#BUGFIX by stefan class: Smalltalk class changed: #fileInClassLibrary:inPackage: consider objmingw, too when searching fro windows DLLs
Smalltalk.st
--- a/Smalltalk.st	Mon Jul 02 09:32:45 2018 +0200
+++ b/Smalltalk.st	Mon Jul 02 14:22:11 2018 +0200
@@ -6938,45 +6938,33 @@
      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|
 
     ObjectFileLoader isNil ifTrue:[
-	^ PackageLoadError raiseRequestWith:packageID errorString:' - no ObjectFileLoader'
+        ^ PackageLoadError raiseRequestWith:packageID errorString:' - no ObjectFileLoader'
     ].
 
     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:[
-	    ^ PackageNotFoundError raiseRequestWith:packageID.
-	].
-	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 notNil and:[libraryFilename exists]) ifTrue:[
-	    handle := ObjectFileLoader loadObjectFile:libraryFilename pathName.
-	].
+        packagePath := self getPackageDirectoryForPackage:packageID.
+        packagePath isNil ifTrue:[
+            ^ PackageNotFoundError raiseRequestWith:packageID.
+        ].
+        libraryFilename := ObjectFileLoader binaryClassFilenameForPackage:packageID inDirectory:packagePath.    
+        (libraryFilename notNil and:[libraryFilename exists]) ifTrue:[
+            handle := ObjectFileLoader loadObjectFile:libraryFilename pathName.
+        ].
     ].
 
     handle isNil ifTrue:[
-	^ PackageNotFoundError raiseRequestWith:packageID.
+        ^ PackageNotFoundError raiseRequestWith:packageID.
     ].
 "/    handle notNil ifTrue:[
 "/        Transcript showCR:('    Smalltalk: loaded %1.' bindWith:libraryFilename pathName).
@@ -6990,6 +6978,7 @@
     "
 
     "Modified: / 08-10-2011 / 00:08:51 / cg"
+    "Modified: / 02-07-2018 / 14:19:16 / Stefan Vogel"
 !
 
 fileInSourceFile:filenameArg lazy:loadLazy silent:beSilent