changes for mingw
authorClaus Gittinger <cg@exept.de>
Thu, 10 Jan 2013 13:03:01 +0100
changeset 2993 823a9a40f04c
parent 2992 428e437002b0
child 2994 5db4570abe68
changes for mingw
Make.spec
ObjectFileLoader.st
mingwmake.bat
--- a/Make.spec	Tue Jan 08 16:36:55 2013 +0100
+++ b/Make.spec	Thu Jan 10 13:03:01 2013 +0100
@@ -108,60 +108,57 @@
 
 
 COMMON_OBJS= \
-    $(OUTDIR)Breakpoint.$(O) \
-    $(OUTDIR)BreakpointDescription.$(O) \
-    $(OUTDIR)CompilationErrorHandler.$(O) \
-    $(OUTDIR)DoNotShowCompilerWarningAgainActionQuery.$(O) \
-    $(OUTDIR)InstrumentationContext.$(O) \
-    $(OUTDIR)InstrumentationInfo.$(O) \
-    $(OUTDIR)InstrumentedMethod.$(O) \
-    $(OUTDIR)LazyMethod.$(O) \
-    $(OUTDIR)ObjectFileHandle.$(O) \
-    $(OUTDIR)ObjectFileLoader.$(O) \
-    $(OUTDIR)ParseNode.$(O) \
-    $(OUTDIR)ParserFlags.$(O) \
-    $(OUTDIR)ProgramNodeBuilder.$(O) \
-    $(OUTDIR)ProgramNodeEnumerator.$(O) \
-    $(OUTDIR)STCCompilerInterface.$(O) \
-    $(OUTDIR)Scanner.$(O) \
-    $(OUTDIR)SourceFileLoader.$(O) \
-    $(OUTDIR)Structure.$(O) \
-    $(OUTDIR)Switch.$(O) \
-    $(OUTDIR)UndefinedVariable.$(O) \
-    $(OUTDIR)Variable.$(O) \
-    $(OUTDIR)stx_libcomp.$(O) \
-    $(OUTDIR)AssignmentNode.$(O) \
-    $(OUTDIR)BlockNode.$(O) \
-    $(OUTDIR)BreakpointNode.$(O) \
-    $(OUTDIR)MessageNode.$(O) \
-    $(OUTDIR)ParseErrorNode.$(O) \
-    $(OUTDIR)Parser.$(O) \
-    $(OUTDIR)PrimaryNode.$(O) \
-    $(OUTDIR)ProgramNode.$(O) \
-    $(OUTDIR)StatementNode.$(O) \
-    $(OUTDIR)TextCollectingCompilationErrorHandler.$(O) \
-    $(OUTDIR)WarningCompilationErrorHandler.$(O) \
-    $(OUTDIR)AbstractSyntaxHighlighter.$(O) \
-    $(OUTDIR)BinaryNode.$(O) \
-    $(OUTDIR)ByteCodeCompiler.$(O) \
-    $(OUTDIR)CascadeNode.$(O) \
-    $(OUTDIR)ConstantNode.$(O) \
-    $(OUTDIR)Explainer.$(O) \
-    $(OUTDIR)PrimitiveNode.$(O) \
-    $(OUTDIR)ReturnNode.$(O) \
-    $(OUTDIR)SelfNode.$(O) \
-    $(OUTDIR)UnaryNode.$(O) \
-    $(OUTDIR)VariableNode.$(O) \
-    $(OUTDIR)ByteCodeCompilerWithBreakpointSupport.$(O) \
-    $(OUTDIR)CodeCoverageHighlighter.$(O) \
-    $(OUTDIR)Decompiler.$(O) \
-    $(OUTDIR)ECompletionConstantNode.$(O) \
-    $(OUTDIR)InstrumentingCompiler.$(O) \
-    $(OUTDIR)SuperNode.$(O) \
-    $(OUTDIR)SyntaxHighlighter.$(O) \
-    $(OUTDIR)SelectorNode.$(O) \
-    $(OUTDIR)DoNotShowCompilerWarningAgainForThisMethodActionQuery.$(O) \
-    $(OUTDIR)extensions.$(O) \
-
-
-
+    $(OUTDIR_SLASH)Breakpoint.$(O) \
+    $(OUTDIR_SLASH)BreakpointDescription.$(O) \
+    $(OUTDIR_SLASH)CompilationErrorHandler.$(O) \
+    $(OUTDIR_SLASH)DoNotShowCompilerWarningAgainActionQuery.$(O) \
+    $(OUTDIR_SLASH)InstrumentationContext.$(O) \
+    $(OUTDIR_SLASH)InstrumentationInfo.$(O) \
+    $(OUTDIR_SLASH)InstrumentedMethod.$(O) \
+    $(OUTDIR_SLASH)LazyMethod.$(O) \
+    $(OUTDIR_SLASH)ObjectFileHandle.$(O) \
+    $(OUTDIR_SLASH)ObjectFileLoader.$(O) \
+    $(OUTDIR_SLASH)ParseNode.$(O) \
+    $(OUTDIR_SLASH)ParserFlags.$(O) \
+    $(OUTDIR_SLASH)ProgramNodeBuilder.$(O) \
+    $(OUTDIR_SLASH)ProgramNodeEnumerator.$(O) \
+    $(OUTDIR_SLASH)STCCompilerInterface.$(O) \
+    $(OUTDIR_SLASH)Scanner.$(O) \
+    $(OUTDIR_SLASH)SourceFileLoader.$(O) \
+    $(OUTDIR_SLASH)Structure.$(O) \
+    $(OUTDIR_SLASH)Switch.$(O) \
+    $(OUTDIR_SLASH)UndefinedVariable.$(O) \
+    $(OUTDIR_SLASH)Variable.$(O) \
+    $(OUTDIR_SLASH)stx_libcomp.$(O) \
+    $(OUTDIR_SLASH)AssignmentNode.$(O) \
+    $(OUTDIR_SLASH)BlockNode.$(O) \
+    $(OUTDIR_SLASH)BreakpointNode.$(O) \
+    $(OUTDIR_SLASH)MessageNode.$(O) \
+    $(OUTDIR_SLASH)ParseErrorNode.$(O) \
+    $(OUTDIR_SLASH)Parser.$(O) \
+    $(OUTDIR_SLASH)PrimaryNode.$(O) \
+    $(OUTDIR_SLASH)ProgramNode.$(O) \
+    $(OUTDIR_SLASH)StatementNode.$(O) \
+    $(OUTDIR_SLASH)TextCollectingCompilationErrorHandler.$(O) \
+    $(OUTDIR_SLASH)WarningCompilationErrorHandler.$(O) \
+    $(OUTDIR_SLASH)AbstractSyntaxHighlighter.$(O) \
+    $(OUTDIR_SLASH)BinaryNode.$(O) \
+    $(OUTDIR_SLASH)ByteCodeCompiler.$(O) \
+    $(OUTDIR_SLASH)CascadeNode.$(O) \
+    $(OUTDIR_SLASH)ConstantNode.$(O) \
+    $(OUTDIR_SLASH)Explainer.$(O) \
+    $(OUTDIR_SLASH)PrimitiveNode.$(O) \
+    $(OUTDIR_SLASH)ReturnNode.$(O) \
+    $(OUTDIR_SLASH)SelfNode.$(O) \
+    $(OUTDIR_SLASH)UnaryNode.$(O) \
+    $(OUTDIR_SLASH)VariableNode.$(O) \
+    $(OUTDIR_SLASH)ByteCodeCompilerWithBreakpointSupport.$(O) \
+    $(OUTDIR_SLASH)CodeCoverageHighlighter.$(O) \
+    $(OUTDIR_SLASH)Decompiler.$(O) \
+    $(OUTDIR_SLASH)ECompletionConstantNode.$(O) \
+    $(OUTDIR_SLASH)InstrumentingCompiler.$(O) \
+    $(OUTDIR_SLASH)SuperNode.$(O) \
+    $(OUTDIR_SLASH)SyntaxHighlighter.$(O) \
+    $(OUTDIR_SLASH)SelectorNode.$(O) \
+    $(OUTDIR_SLASH)DoNotShowCompilerWarningAgainForThisMethodActionQuery.$(O) \
+    $(OUTDIR_SLASH)extensions.$(O) \
--- a/ObjectFileLoader.st	Tue Jan 08 16:36:55 2013 +0100
+++ b/ObjectFileLoader.st	Thu Jan 10 13:03:01 2013 +0100
@@ -122,6 +122,7 @@
 
 #ifdef WIN_DL
 # undef INT
+# undef UINT
 # undef Array
 # undef Number
 # undef Method
@@ -136,6 +137,10 @@
 # undef Process
 # undef Processor
 # undef Rectangle
+# undef String
+# undef Character
+# undef Point
+# undef Object
 
 # ifdef __i386__
 #  ifndef _X86_
@@ -219,9 +224,22 @@
 # ifdef __DEF_Rectangle
 #  define Rectangle __DEF_Rectangle
 # endif
-
-
-# define INT int
+# ifdef __DEF_String
+#  define String __DEF_String
+# endif
+# ifdef __DEF_Character
+#  define Character __DEF_Character
+# endif
+# ifdef __DEF_Point
+#  define Point __DEF_Point
+# endif
+# ifdef __DEF_Object
+#  define Object __DEF_Object
+# endif
+
+
+# define INT STX_INT
+# define UINT STX_UINT
 
 #endif /* WIN_DL */
 
@@ -300,75 +318,75 @@
     "/ Verbose := true.
 
     OperatingSystem isMSDOSlike ifTrue:[
-        "/ default setup for msc
-        ParserFlags useBorlandC ifTrue:[
-            libDir := '..\lib\bc'.
-            libDir asFilename exists ifFalse:[
-                libDir := '..\lib\lib\bc'.
-                libDir asFilename exists ifFalse:[
-                    libDir := '..\lib'.
-                ]
-            ].
-
-            linkCommand isNil ifTrue:[
-                "/ linkCommand := 'tlink32'.
-                linkCommand := 'ilink32'.
-            ].
-            linkArgs isNil ifTrue:[
-                "/ linkArgs := '-L',libDir,' -L\Programme\Borland\CBuilder3\lib -c -ap -Tpd -s -Gi -v -w-dup ',libDir,'\librun.lib'.
-                linkArgs := '-L',libDir,' -L\Programme\Borland\CBuilder3\lib -r -c -ap -Tpd -Gi -w-dup'.
-            ].
-            searchedLibraries := #(
-                                    'import32.lib'
-                                  ).
-        ] ifFalse:[
-            linkCommand isNil ifTrue:[
-                linkCommand := 'link'
-            ].
-            linkArgs isNil ifTrue:[
-                linkArgs := '/NOPACK /NOLOGO /DEBUG /MACHINE:I386 /DLL /OUT:%1.dll /DEF:%1.def'
-            ].
-        ].
+	"/ default setup for msc
+	ParserFlags useBorlandC ifTrue:[
+	    libDir := '..\lib\bc'.
+	    libDir asFilename exists ifFalse:[
+		libDir := '..\lib\lib\bc'.
+		libDir asFilename exists ifFalse:[
+		    libDir := '..\lib'.
+		]
+	    ].
+
+	    linkCommand isNil ifTrue:[
+		"/ linkCommand := 'tlink32'.
+		linkCommand := 'ilink32'.
+	    ].
+	    linkArgs isNil ifTrue:[
+		"/ linkArgs := '-L',libDir,' -L\Programme\Borland\CBuilder3\lib -c -ap -Tpd -s -Gi -v -w-dup ',libDir,'\librun.lib'.
+		linkArgs := '-L',libDir,' -L\Programme\Borland\CBuilder3\lib -r -c -ap -Tpd -Gi -w-dup'.
+	    ].
+	    searchedLibraries := #(
+				    'import32.lib'
+				  ).
+	] ifFalse:[
+	    linkCommand isNil ifTrue:[
+		linkCommand := 'link'
+	    ].
+	    linkArgs isNil ifTrue:[
+		linkArgs := '/NOPACK /NOLOGO /DEBUG /MACHINE:I386 /DLL /OUT:%1.dll /DEF:%1.def'
+	    ].
+	].
     ].
 
     MySymbolTable isNil ifTrue:[
-        NextHandleID := 1.
-        ObjectMemory addDependent:self.
-
-        OperatingSystem isMSDOSlike ifTrue:[
-            searchedLibraries := #(
-                                    'import32.lib'
-                                  ).
-        ].
-
-        OperatingSystem isUNIXlike ifTrue:[
-            |ldLibraryPath|
-
-            systemType := OperatingSystem getOSType.
-
-            "/ name of object file, where initial symbol table is found
-            "/ not req'd for all architectures.
-
-            MySymbolTable := 'stx'.
-
-            searchedLibraries := #().
-
-            "/ default libraryPath where shared objects are expected
-            "/ when a sharedObject load requires other objects to be loaded.
-            "/ For more compatibility with ELF systems, look for a shell variable
-            "/ named LD_LIBRARY_PATH, and - if present - take that instead if a default.
-            "/ Can (should) be set in the smalltalk.rc file.
-
-            ldLibraryPath := OperatingSystem getEnvironment:'LD_LIBRARY_PATH'.
-            ldLibraryPath isEmptyOrNil ifTrue:[
-                libPath := '.:lib:/usr/local/smalltalk/lib:/usr/local/lib:/usr/lib:/lib'.
-            ] ifFalse:[
-                "/ only needed for AIX - the dynamic linker of other Unixes use LD_LIBRARY_PATH implicitly
-                systemType = #aix ifTrue:[
-                    libPath := ldLibraryPath.
-                ].
-            ]
-        ]
+	NextHandleID := 1.
+	ObjectMemory addDependent:self.
+
+	OperatingSystem isMSDOSlike ifTrue:[
+	    searchedLibraries := #(
+				    'import32.lib'
+				  ).
+	].
+
+	OperatingSystem isUNIXlike ifTrue:[
+	    |ldLibraryPath|
+
+	    systemType := OperatingSystem getOSType.
+
+	    "/ name of object file, where initial symbol table is found
+	    "/ not req'd for all architectures.
+
+	    MySymbolTable := 'stx'.
+
+	    searchedLibraries := #().
+
+	    "/ default libraryPath where shared objects are expected
+	    "/ when a sharedObject load requires other objects to be loaded.
+	    "/ For more compatibility with ELF systems, look for a shell variable
+	    "/ named LD_LIBRARY_PATH, and - if present - take that instead if a default.
+	    "/ Can (should) be set in the smalltalk.rc file.
+
+	    ldLibraryPath := OperatingSystem getEnvironment:'LD_LIBRARY_PATH'.
+	    ldLibraryPath isEmptyOrNil ifTrue:[
+		libPath := '.:lib:/usr/local/smalltalk/lib:/usr/local/lib:/usr/lib:/lib'.
+	    ] ifFalse:[
+		"/ only needed for AIX - the dynamic linker of other Unixes use LD_LIBRARY_PATH implicitly
+		systemType = #aix ifTrue:[
+		    libPath := ldLibraryPath.
+		].
+	    ]
+	]
     ].
 
     ParserFlags linkCommand:linkCommand.
@@ -639,7 +657,7 @@
    "this should return a string to list the namelist of file.
     The output of the command should be one line for each symbol,
     formatted as:
-        addr  segment  name
+	addr  segment  name
     This is parsed and read by #namesMatching:segment:in:.
 
     If your default nm command cannot produce this, write a little
@@ -651,10 +669,10 @@
 
     os := OperatingSystem getOSType.
     (os = #irix or:[os = #osf]) ifTrue:[
-        ^ 'nm -B ' , file
+	^ 'nm -B ' , file
     ].
     (os = #solaris) ifTrue:[
-        ^ 'nm -p ' , file
+	^ 'nm -p ' , file
     ].
     ^ 'nm ' , file
 
@@ -2519,87 +2537,87 @@
     osType := OperatingSystem getOSType.
 
     osType = #win32 ifTrue:[
-        self activityNotification:'generating shared object'.
-
-        ParserFlags linkArgs isNil ifTrue:[
-            ld := self linkCommand , ' ' , baseFileName , '.obj'.
-            ld := ld
-               , ' /NOPACK /NOLOGO /DEBUG /MACHINE:I386 /DLL'
-               , ' /OUT:' , baseFileName , '.dll '
+	self activityNotification:'generating shared object'.
+
+	ParserFlags linkArgs isNil ifTrue:[
+	    ld := self linkCommand , ' ' , baseFileName , '.obj'.
+	    ld := ld
+	       , ' /NOPACK /NOLOGO /DEBUG /MACHINE:I386 /DLL'
+	       , ' /OUT:' , baseFileName , '.dll '
 "/               , ' /DEF:' , baseFileName , '.def'.
-        ] ifFalse:[
-            libDir := ParserFlags libDirectory.
-            (libDir notNil and:[libDir asFilename exists]) ifFalse:[
-                libDirBasename :=
-                        ParserFlags useBorlandC
-                            ifTrue:[ 'lib\bc' ]
-                            ifFalse:[
-                                ParserFlags useVisualC
-                                    ifTrue:[ 'lib\vc' ]
-                                    ifFalse:[ 'lib\bc' ]].
-
-                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'.
-                                ^ nil
-                            ]
-                        ]
-                    ]
-                ].
-            ].
-
-            ParserFlags useBorlandC ifTrue:[
-                ld := self linkCommand , ' ' , (ParserFlags linkArgs bindWith:baseFileName).
-                ld := ld , ' c0d32.obj ' , baseFileName , '.obj '.
-                ld := ld , ',' , baseFileName , '.dll,,',libDir,'\librun.lib '.
-                ld := ld , (ParserFlags searchedLibraries asStringCollection asStringWith: $ ).
-                ld := ld , ' ',libDir,'\cs32i.lib,,'.
-            ] ifFalse:[
-                ParserFlags useVisualC ifTrue:[
-                    "/ todo: fix for correct link libs
-                    ld := self linkCommand , ' ' , (ParserFlags linkArgs bindWith:baseFileName).
-                    ld := ld , ' c0d32.obj ' , baseFileName , '.obj '.
-                    ld := ld , ',' , baseFileName , '.dll,,',libDir,'\librun.lib '.
-                    ld := ld , (ParserFlags searchedLibraries asStringCollection asStringWith: $ ).
-                    ld := ld , ' ',libDir,'\cs32i.lib,,'.
-                ] ifFalse:[
-                    ObjectFileLoadError raiseRequestErrorString:'for dynamic objects, only borlandC is (currently) supported'.
-                    ^ nil
-                ]
-            ]
-        ].
-
-        outfile := (baseFileName , '.out').
-
-        ok := OperatingSystem executeCommand:(ld , ' >' , outfile).
-        ok ifFalse:[
-            output := (baseFileName , '.out') asFilename contentsOfEntireFile.
-            Transcript showCR:output; endEntry.
-            Transcript showCR:'Failed linkCommand:'.
-            Transcript showCR:ld.
-            Transcript showCR:'ParserFlags are:'.
-            Transcript showCR:ParserFlags.
-            
-        ].
-
-        #('.obj' '.out' '.tds' '.ilc' '.ild'
-          '.ilf' '.ils' '.lib' '.map' '.def') do:[:eachSuffix|
-            (baseFileName , eachSuffix) asFilename delete.
-        ].
-
-        ok ifFalse:[
-            LastError := output.
-            "/ ObjectFileLoadError raiseRequestErrorString:'link failed'.
-            ^ nil
-        ].
-        oFileName := (baseFileName , self sharedLibraryExtension) asFilename name.
-        ^ oFileName
+	] ifFalse:[
+	    libDir := ParserFlags libDirectory.
+	    (libDir notNil and:[libDir asFilename exists]) ifFalse:[
+		libDirBasename :=
+			ParserFlags useBorlandC
+			    ifTrue:[ 'lib\bc' ]
+			    ifFalse:[
+				ParserFlags useVisualC
+				    ifTrue:[ 'lib\vc' ]
+				    ifFalse:[ 'lib\bc' ]].
+
+		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'.
+				^ nil
+			    ]
+			]
+		    ]
+		].
+	    ].
+
+	    ParserFlags useBorlandC ifTrue:[
+		ld := self linkCommand , ' ' , (ParserFlags linkArgs bindWith:baseFileName).
+		ld := ld , ' c0d32.obj ' , baseFileName , '.obj '.
+		ld := ld , ',' , baseFileName , '.dll,,',libDir,'\librun.lib '.
+		ld := ld , (ParserFlags searchedLibraries asStringCollection asStringWith: $ ).
+		ld := ld , ' ',libDir,'\cs32i.lib,,'.
+	    ] ifFalse:[
+		ParserFlags useVisualC ifTrue:[
+		    "/ todo: fix for correct link libs
+		    ld := self linkCommand , ' ' , (ParserFlags linkArgs bindWith:baseFileName).
+		    ld := ld , ' c0d32.obj ' , baseFileName , '.obj '.
+		    ld := ld , ',' , baseFileName , '.dll,,',libDir,'\librun.lib '.
+		    ld := ld , (ParserFlags searchedLibraries asStringCollection asStringWith: $ ).
+		    ld := ld , ' ',libDir,'\cs32i.lib,,'.
+		] ifFalse:[
+		    ObjectFileLoadError raiseRequestErrorString:'for dynamic objects, only borlandC is (currently) supported'.
+		    ^ nil
+		]
+	    ]
+	].
+
+	outfile := (baseFileName , '.out').
+
+	ok := OperatingSystem executeCommand:(ld , ' >' , outfile).
+	ok ifFalse:[
+	    output := (baseFileName , '.out') asFilename contentsOfEntireFile.
+	    Transcript showCR:output; endEntry.
+	    Transcript showCR:'Failed linkCommand:'.
+	    Transcript showCR:ld.
+	    Transcript showCR:'ParserFlags are:'.
+	    Transcript showCR:ParserFlags.
+
+	].
+
+	#('.obj' '.out' '.tds' '.ilc' '.ild'
+	  '.ilf' '.ils' '.lib' '.map' '.def') do:[:eachSuffix|
+	    (baseFileName , eachSuffix) asFilename delete.
+	].
+
+	ok ifFalse:[
+	    LastError := output.
+	    "/ ObjectFileLoadError raiseRequestErrorString:'link failed'.
+	    ^ nil
+	].
+	oFileName := (baseFileName , self sharedLibraryExtension) asFilename name.
+	^ oFileName
     ].
 
     "/ UNIX systems
@@ -2608,115 +2626,115 @@
     needSharedObject := false.
 
     ObjectFileLoader loadableBinaryObjectFormat == #elf ifTrue:[
-        "
-         link it to a shared object with 'ld -shared'
-         Currently, we support 32-bit objects only.
-        "
-        needSharedObject := true.
-        ld := self linkCommand ? 'cc'.
-        ldArg := self linkSharedArgs ? '-m32 -shared'.
+	"
+	 link it to a shared object with 'ld -shared'
+	 Currently, we support 32-bit objects only.
+	"
+	needSharedObject := true.
+	ld := self linkCommand ? 'cc'.
+	ldArg := self linkSharedArgs ? '-m32 -shared'.
     ].
 
     osType = #irix ifTrue:[
-        "
-         link it to a shared object with 'ld -shared'
-        "
-        needSharedObject := true.
-        ldArg := self linkSharedArgs ? '-shared'.
+	"
+	 link it to a shared object with 'ld -shared'
+	"
+	needSharedObject := true.
+	ldArg := self linkSharedArgs ? '-shared'.
     ].
 
     osType = #'sys5_4' ifTrue:[
-        "
-         link it to a shared object with 'ld -G'
-        "
-        needSharedObject := true.
-        ldArg := self linkSharedArgs ? '-G'.
+	"
+	 link it to a shared object with 'ld -G'
+	"
+	needSharedObject := true.
+	ldArg := self linkSharedArgs ? '-G'.
     ].
 
     osType = #osf ifTrue:[
-        "
-         link it to a shared object with 'ld -shared'
-        "
-        needSharedObject := true.
-        ldArg := self linkSharedArgs ? '-shared'.
+	"
+	 link it to a shared object with 'ld -shared'
+	"
+	needSharedObject := true.
+	ldArg := self linkSharedArgs ? '-shared'.
     ].
 
     osType = #solaris ifTrue:[
-        "
-         link it to a shared object with 'ld -G -B dynamic'
-        "
-        needSharedObject := true.
-        ldArg := self linkSharedArgs ? '-G -Bdynamic'.
+	"
+	 link it to a shared object with 'ld -G -B dynamic'
+	"
+	needSharedObject := true.
+	ldArg := self linkSharedArgs ? '-G -Bdynamic'.
     ].
 
     osType = #hpux ifTrue:[
-        "
-         link it to a shared object with 'ld -b -B immediate'
-        "
-        needSharedObject := true.
-        ldArg := self linkSharedArgs ? '-b -B immediate'.
+	"
+	 link it to a shared object with 'ld -b -B immediate'
+	"
+	needSharedObject := true.
+	ldArg := self linkSharedArgs ? '-b -B immediate'.
     ].
 
     osType = #aix ifTrue:[
-        self activityNotification:'create export file'.
-
-        "/ create an exports file.
-        expFileName := './' , baseFileName , '.exp'.
-        [
-            expFile := expFileName asFilename writeStream.
-            expFile nextPutAll:'#!! ./' , baseFileName , (self sharedLibraryExtension).
-            expFile cr.
-            expFile nextPutAll:'_' , baseFileName , '_Init'.
-            expFile close.
-        ] on:FileStream openErrorSignal do:[:ex| "do nothing"].
-
-        self activityNotification:'generating shared object'.
-
-        "
-         link it to a shared object with 'cc -bI:...librun.exp -bE -bMSRE'
-        "
-        needSharedObject := true.
-        ld := 'cc'.
-        librunExpFileName := Smalltalk getSystemFileName:'lib/librun_aix.exp'.
-        librunExpFileName isNil ifTrue:[
-            LastError := 'missing exports file: ''lib/librun_aix.exp'' - cannot link'.
-            ^ nil
-        ].
-
-        ldArg := '-bI:' , librunExpFileName ,
-                ' -bE:' , baseFileName , '.exp' ,
-                ' -bM:SRE -e _' , baseFileName , '_Init'.
+	self activityNotification:'create export file'.
+
+	"/ create an exports file.
+	expFileName := './' , baseFileName , '.exp'.
+	[
+	    expFile := expFileName asFilename writeStream.
+	    expFile nextPutAll:'#!! ./' , baseFileName , (self sharedLibraryExtension).
+	    expFile cr.
+	    expFile nextPutAll:'_' , baseFileName , '_Init'.
+	    expFile close.
+	] on:FileStream openErrorSignal do:[:ex| "do nothing"].
+
+	self activityNotification:'generating shared object'.
+
+	"
+	 link it to a shared object with 'cc -bI:...librun.exp -bE -bMSRE'
+	"
+	needSharedObject := true.
+	ld := 'cc'.
+	librunExpFileName := Smalltalk getSystemFileName:'lib/librun_aix.exp'.
+	librunExpFileName isNil ifTrue:[
+	    LastError := 'missing exports file: ''lib/librun_aix.exp'' - cannot link'.
+	    ^ nil
+	].
+
+	ldArg := '-bI:' , librunExpFileName ,
+		' -bE:' , baseFileName , '.exp' ,
+		' -bM:SRE -e _' , baseFileName , '_Init'.
     ].
 
     oFileName := baseFileName , self objectFileExtension.
     needSharedObject ifTrue:[
-        self activityNotification:'generating shared object'.
-
-        soFileName := baseFileName , self sharedLibraryExtension.
-        OperatingSystem removeFile:soFileName.
-        ld := ld , ' ' , ldArg , ' ', (ParserFlags linkArgs ? '') ,
-                 ' -o ' , soFileName , ' ' , oFileName , ' ',
-                 ((ParserFlags searchedLibraries  ? #()) asStringCollection asStringWith: $ ).
-
-        Verbose ifTrue:[
-            'linking with:' errorPrintCR.
-            '   ' errorPrint. ld errorPrintCR.
-        ].
-        ok := OperatingSystem executeCommand:(ld , ' >errorOutput 2>&1').
-
-        ok ifFalse:[
-            output := 'errorOutput' asFilename contentsOfEntireFile.
-            Transcript showCR:'linker error message:'.
-            Transcript showCR:output.
-            Transcript showCR:'linker command:'.
-            Transcript showCR:ld; endEntry.
-        ].
-
-        OperatingSystem removeFile:oFileName.
-        expFileName notNil ifTrue:[
-            OperatingSystem removeFile:expFileName
-        ].
-        ^ soFileName.
+	self activityNotification:'generating shared object'.
+
+	soFileName := baseFileName , self sharedLibraryExtension.
+	OperatingSystem removeFile:soFileName.
+	ld := ld , ' ' , ldArg , ' ', (ParserFlags linkArgs ? '') ,
+		 ' -o ' , soFileName , ' ' , oFileName , ' ',
+		 ((ParserFlags searchedLibraries  ? #()) asStringCollection asStringWith: $ ).
+
+	Verbose ifTrue:[
+	    'linking with:' errorPrintCR.
+	    '   ' errorPrint. ld errorPrintCR.
+	].
+	ok := OperatingSystem executeCommand:(ld , ' >errorOutput 2>&1').
+
+	ok ifFalse:[
+	    output := 'errorOutput' asFilename contentsOfEntireFile.
+	    Transcript showCR:'linker error message:'.
+	    Transcript showCR:output.
+	    Transcript showCR:'linker command:'.
+	    Transcript showCR:ld; endEntry.
+	].
+
+	OperatingSystem removeFile:oFileName.
+	expFileName notNil ifTrue:[
+	    OperatingSystem removeFile:expFileName
+	].
+	^ soFileName.
     ].
 
     "
@@ -2775,32 +2793,32 @@
 
     fn := pathNameOrFilename asFilename.
     fn exists ifTrue:[
-        pathName := fn pathName.
-        self copyLibrariesWhenLoading ifTrue:[
-            fn copyTo:(tempFile := ParserFlags stcModulePath asFilename construct:fn baseName).
-            pathName := tempFile pathName.
-        ].
+	pathName := fn pathName.
+	self copyLibrariesWhenLoading ifTrue:[
+	    fn copyTo:(tempFile := ParserFlags stcModulePath asFilename construct:fn baseName).
+	    pathName := tempFile pathName.
+	].
     ] ifFalse:[
-        "/ something like "kernel32.dll"; must be along the PATH setting
-        pathName := pathNameOrFilename asString.
+	"/ something like "kernel32.dll"; must be along the PATH setting
+	pathName := pathNameOrFilename asString.
     ].
 
     Verbose ifTrue:[
-        ('loadDynamic: ',pathNameOrFilename asString,' (',pathName asString,')...') errorPrintCR
+	('loadDynamic: ',pathNameOrFilename asString,' (',pathName asString,')...') errorPrintCR
     ].
     encodedPathName := OperatingSystem encodePath:pathName.
 
     "/ already loaded ?
     handle := self handleForDynamicObject:encodedPathName.
     handle notNil ifTrue:[
-        Verbose ifTrue:[
-            ('... ' , pathName , ' already loaded.') errorPrintCR.
-        ].
-        ^ handle
+	Verbose ifTrue:[
+	    ('... ' , pathName , ' already loaded.') errorPrintCR.
+	].
+	^ handle
     ].
 
     Verbose ifTrue:[
-        ('initializeLoader...') errorPrintCR
+	('initializeLoader...') errorPrintCR
     ].
     self initializeLoader.
 
@@ -2814,29 +2832,29 @@
     buffer at:4 put:NextHandleID. NextHandleID := NextHandleID + 1.
 
     Verbose ifTrue:[
-        ('primLoadDynamicObject...') errorPrintCR
+	('primLoadDynamicObject...') errorPrintCR
     ].
 
     buffer := self primLoadDynamicObject:encodedPathName into:buffer.
     Verbose ifTrue:[
-        ('done') errorPrintCR
+	('done') errorPrintCR
     ].
 
     buffer isNil ifTrue:[
-        LastError == #notImplemented ifTrue:[
-            'ObjectFileLoader [warning]: no dynamic load facility present.' infoPrintCR.
-        ] ifFalse:[
-            LastError == #linkError ifTrue:[
-                LinkErrorMessage notNil ifTrue:[
-                    ('ObjectFileLoader [warning]: load error:' , LinkErrorMessage) infoPrintCR.
-                ] ifFalse:[
-                    ('ObjectFileLoader [warning]: load error') infoPrintCR.
-                ].
-            ].
-        ].
-        ('ObjectFileLoader [warning]: failed to load: ' , pathName) infoPrintCR.
-        Transcript showCR:('ObjectFileLoader [warning]: failed to load: ' , pathName).
-        ^ nil
+	LastError == #notImplemented ifTrue:[
+	    'ObjectFileLoader [warning]: no dynamic load facility present.' infoPrintCR.
+	] ifFalse:[
+	    LastError == #linkError ifTrue:[
+		LinkErrorMessage notNil ifTrue:[
+		    ('ObjectFileLoader [warning]: load error:' , LinkErrorMessage) infoPrintCR.
+		] ifFalse:[
+		    ('ObjectFileLoader [warning]: load error') infoPrintCR.
+		].
+	    ].
+	].
+	('ObjectFileLoader [warning]: failed to load: ' , pathName) infoPrintCR.
+	Transcript showCR:('ObjectFileLoader [warning]: failed to load: ' , pathName).
+	^ nil
     ].
 
     "
@@ -2849,13 +2867,13 @@
     handle moduleID:(buffer at:4).
 
     LoadedObjects isNil ifTrue:[
-        LoadedObjects := Dictionary new.
+	LoadedObjects := Dictionary new.
     ].
     LoadedObjects at:pathName put:handle.
     "/ Smalltalk flushCachedClasses.
 
     Verbose ifTrue:[
-        ('loadDynamic ok; handle is: ' , handle printString) errorPrintCR.
+	('loadDynamic ok; handle is: ' , handle printString) errorPrintCR.
     ].
     "/ ObjectMemory garbageCollect.
 
@@ -4364,11 +4382,11 @@
 !ObjectFileLoader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.324 2013-01-08 15:36:55 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.325 2013-01-10 12:03:00 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.324 2013-01-08 15:36:55 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.325 2013-01-10 12:03:00 cg Exp $'
 ! !
 
 
--- a/mingwmake.bat	Tue Jan 08 16:36:55 2013 +0100
+++ b/mingwmake.bat	Thu Jan 10 13:03:01 2013 +0100
@@ -3,4 +3,6 @@
 @REM type mingwmake, and wait...
 @REM do not edit - automatically generated from ProjectDefinition
 @REM -------
-make.exe -N -f bc.mak USEMINGW=1 %1 %2
+
+@call ..\rules\find_mingw.bat
+make.exe -N -f bc.mak -DUSEMINGW64=1 %*