h_win32.rc
changeset 1301 ac987c5eaab3
parent 1300 a153aa1ed4a5
child 1302 257bd1bb74f2
--- a/h_win32.rc	Wed Feb 20 15:03:49 2013 +0100
+++ b/h_win32.rc	Wed Feb 20 15:56:30 2013 +0100
@@ -39,7 +39,7 @@
 !
 
 |incl libs tryPathesForBin path usedCompiler
- bccPath msvcPath mingwPath hasBCC hasMSVC hasMINGW
+ bccPath msvcPath mingw64Path mingw32Path
  searchedLibraries
  linkCommand linkArgs ccCommand ccCompilationOptions
  |
@@ -70,14 +70,14 @@
     "/ uncomment one of the following
     bccPath := 'C:\borland\bcc55\bin'.
     msvcPath := 'C:\Programme\Microsoft Visual Studio 10.0\VC\BIN'.
-    mingwPath := 'C:\mingw64\bin'.
+    mingw64Path := 'C:\mingw64\bin'.
 
     "/ or take a look what we find installed:
     path := (OperatingSystem getEnvironment:'PATH') asCollectionOfSubstringsSeparatedBy:$;.
     ExternalBytes sizeofPointer == 8 ifTrue:[
-	mingwPath := path detect:[:d | d asLowercase includesString:'mingw64'] ifNone:nil.
-	mingwPath isNil ifTrue:[
-	    mingwPath := tryPathesForBin value:
+	mingw64Path := path detect:[:d | d asLowercase includesString:'mingw64'] ifNone:nil.
+	mingw64Path isNil ifTrue:[
+	    mingw64Path := tryPathesForBin value:
 			    #(
 				'C:\Programme\mingw64\bin'
 				'C:\Programs\mingw64\bin'
@@ -164,25 +164,43 @@
 	].
     ].
 
-    (usedCompiler isNil and:[mingwPath notNil]) ifTrue:[
-	"/ mingw
-	ExternalBytes sizeofPointer ~~ 8 ifTrue:[
-	    'host.rc [info]: invalid compiler setup (mingw cannot be used with 32 bit architecture)' infoPrintCR.
+    usedCompiler isNil ifTrue:[
+	ExternalBytes sizeofPointer == 8 ifTrue:[
+	    mingw64Path notNil ifTrue:[
+		"/ mingw64
+		'host.rc [info]: setup for mingw64 compiler' infoPrintCR.
+		mingw64Path := mingw64Path asFilename.
+		ccCommand := (mingw64Path / 'gcc') pathName.
+		linkCommand := (mingw64Path / 'gcc') pathName.
+		ccCompilationOptions := ''.
+		searchedLibraries := #('import32.lib' 'odbc32.lib' 'glu32.lib' 'opengl32.lib').
+
+		libs := #(
+			'-L..\..\lib\mingw'
+			).
+		libs := libs asStringWith:Character space.
+		linkArgs := (libs).
+		incl := incl asStringWith:Character space.
+		usedCompiler := 'mingw'.
+	    ].
 	] ifFalse:[
-	    'host.rc [info]: setup for mingw64 compiler' infoPrintCR.
-	    mingwPath := mingwPath asFilename.
-	    ccCommand := (mingwPath / 'gcc') pathName.
-	    linkCommand := (mingwPath / 'gcc') pathName.
-	    ccCompilationOptions := ''.
-	    searchedLibraries := #('import32.lib' 'odbc32.lib' 'glu32.lib' 'opengl32.lib').
+	    mingw32Path notNil ifTrue:[
+		"/ mingw32
+		'host.rc [info]: setup for mingw32 compiler' infoPrintCR.
+		mingw32Path := mingw32Path asFilename.
+		ccCommand := (mingw32Path / 'gcc') pathName.
+		linkCommand := (mingw32Path / 'gcc') pathName.
+		ccCompilationOptions := ''.
+		searchedLibraries := #('import32.lib' 'odbc32.lib' 'glu32.lib' 'opengl32.lib').
 
-	    libs := #(
-		    '-L..\..\lib\mingw'
-		    ).
-	    libs := libs asStringWith:Character space.
-	    linkArgs := (libs).
-	    incl := incl asStringWith:Character space.
-	    usedCompiler := 'mingw'.
+		libs := #(
+			'-L..\..\lib\mingw'
+			).
+		libs := libs asStringWith:Character space.
+		linkArgs := (libs).
+		incl := incl asStringWith:Character space.
+		usedCompiler := 'mingw'.
+	    ].
 	].
     ].