#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Wed, 31 Aug 2016 19:52:10 +0200
changeset 3960 c028435d05a6
parent 3959 d31dca1c3ca9
child 3961 1148f204a97d
#UI_ENHANCEMENT by cg class: ParserFlags changed: #initializeSTCFlagsForTopDirectory:
ParserFlags.st
--- a/ParserFlags.st	Tue Aug 30 11:51:26 2016 +0200
+++ b/ParserFlags.st	Wed Aug 31 19:52:10 2016 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
  COPYRIGHT (c) 2005 by eXept Software AG
@@ -1649,194 +1647,199 @@
 
     topDir := topDirArg.
     OperatingSystem isMSWINDOWSlike ifTrue:[
-	topDirArg isString ifTrue:[
-	    topDir := topDirArg copyReplaceAll:$/ with:$\ ifNone:topDirArg.
-	]
+        topDirArg isString ifTrue:[
+            topDir := topDirArg copyReplaceAll:$/ with:$\ ifNone:topDirArg.
+        ]
     ].
     topDir := topDir asFilename.
     topDirName := topDir name.
 
     "/ if in the development directory, use ./modules
     Smalltalk isSmalltalkDevelopmentSystem ifTrue:[
-	STCModulePath := 'modules'.
+        STCModulePath := 'modules'.
     ] ifFalse:[
-	STCModulePath := Filename tempDirectory constructString:'modules'.
+        STCModulePath := Filename tempDirectory constructString:'modules'.
     ].
 
     (topDir construct:'stc') exists ifFalse:[
-	('ParserFlags [warning]: stc not found in "',topDirName,'"') infoPrintCR.
-	'ParserFlags [warning]: stc-compiling (primitive code) will not work in the browser' infoPrintCR.
-	STCCompilation := #never.
+        ('ParserFlags [warning]: stc not found in "',topDirName,'"') infoPrintCR.
+        'ParserFlags [warning]: stc-compiling (primitive code) will not work in the browser' infoPrintCR.
+        STCCompilation := #never.
     ].
 
     OperatingSystem isMSWINDOWSlike ifTrue:[
-	useBorlandC := useVisualC := useMingw32 := useMingw64 := false.
-	programFiles := OperatingSystem getEnvironment:'ProgramFiles'.
-	programFiles isEmptyOrNil ifTrue:[ programFiles := 'C:\Program Files' ].
-
-	STCCompilationIncludes := '-I',topDirName,'\include -I',topDirName,'\libopengl'.
-
-	ExternalAddress pointerSize == 4 ifFalse:[
-	    bccTop := nil
-	] ifTrue:[
-	    (bccTop := BCCTop) isNil ifTrue:[
-		borlandDir := OperatingSystem getEnvironment:'BCCDIR'.
-		borlandDir isEmptyOrNil ifTrue:[ borlandDir := 'C:\Borland\bcc55' ].
-		bccTop := {
-			    (borlandDir) .
-			    (programFiles , '\Borland\bcc55') .
-			    (programFiles , '\bcc55') .
-			  } detect:[:path | path asFilename exists and:[(path asFilename construct:'include') exists]]
-			     ifNone:nil.
-	    ].
-	].
-
-	STCCompilationDefines := '-DWIN32'.
-
-	(bccTop notNil and:[bccTop asFilename exists]) ifTrue:[
-	    STCCompilationIncludes := STCCompilationIncludes,' -I',bccTop,'\Include'.
-	    LibDirectory := topDirName,'\lib\bc'.
-	    LinkArgs := '-L',topDirName,'\lib\bc'.
-	    LinkArgs := LinkArgs,' -L',bccTop,'\Lib -r -c -ap -Tpd -Gi -w-dup'.
-	    CCPath := 'bcc32'.
-	    MakeCommand := 'bmake'.
-	    LinkCommand := 'ilink32'.
-	    CCCompilationOptions := '-w-'.
-	    useBorlandC := true.
-	] ifFalse:[
-	    ExternalAddress pointerSize == 4 ifFalse:[
-		vcTop := nil.
-	    ] ifTrue:[
-		(vcTop := VCTop) isNil ifTrue:[
-		    vcTop := {
-				(programFiles,'\Microsoft Visual Studio 13.0\VC') .
-				(programFiles,'\Microsoft Visual Studio 12.0\VC') .
-				(programFiles,'\Microsoft Visual Studio 11.0\VC') .
-				(programFiles,'\Microsoft Visual Studio 10.0\VC') .
-				(programFiles,'\Microsoft Visual Studio 9.0\VC' ) .
-			     } detect:[:path | path asFilename exists and:[(path asFilename construct:'bin/cl.exe') exists]]
-			       ifNone:nil.
-		].
-	    ].
-	    (vcTop notNil and:[vcTop asFilename exists]) ifTrue:[
-		useVisualC := true.
-		STCCompilationIncludes := STCCompilationIncludes,' -I',vcTop,'include'.
-
-		(sdkTop := SDKTop) isNil ifTrue:[
-		    sdkTop := {
-				(programFiles,'\Microsoft SDKs\Windows\v9.0A') .
-				(programFiles,'\Microsoft SDKs\Windows\v8.0A') .
-				(programFiles,'\Microsoft SDKs\Windows\v8.0A') .
-				(programFiles,'\Microsoft SDKs\Windows\v7.0A') .
-				(programFiles,'\Microsoft SDKs\Windows\v6.0A') .
-			     }  detect:[:path | path asFilename exists and:[(path asFilename construct:'include') exists]] ifNone:nil.
-		].
-		(sdkTop notNil and:[sdkTop asFilename exists]) ifTrue:[
-		    STCCompilationIncludes := STCCompilationIncludes,' -I',sdkTop,'\include'.
-		].
-		LibDirectory := topDirName,'\lib\vc'.
-		LinkArgs := '-L',topDirName,'\lib\vc'.
-		LinkArgs := LinkArgs,' -r -c -ap -Tpd -Gi -w-dup'.
-		CCPath := vcTop,'\bin\cl.exe'.
-		LinkCommand := 'ilink32'.
-		MakeCommand := 'vcmake'.
-		CCCompilationOptions := '/nologo /ZI  /w /GF /EHsc /FR.\objvc\'.
-	    ] ifFalse:[
-		"/ add definitions for lcc, mingc etc.
-		"/ STCCompilationIncludes := STCCompilationIncludes,' -IC:\xxxxx\Include'.
-		ExternalAddress pointerSize == 4 ifTrue:[
-		    (mingwTop := MingwTop) isNil ifTrue:[
-			mingwTop := {
-				    (programFiles,'\mingw') .
-				    (programFiles,'\mingw') .
-				    ('c:\mingw32') .
-				    ('c:\mingw') .
-				 } detect:[:path | path asFilename exists and:[(path asFilename construct:'bin/gcc.exe') exists]]
-				   ifNone:nil.
-		    ].
-		    (mingwTop notNil and:[mingwTop asFilename exists]) ifTrue:[
-			useMingw32 := true.
-			STCCompilationDefines := STCCompilationDefines,' -D__MINGW32__'.
-			CCCompilationOptions := '-w32'.
-		    ].
-		] ifFalse:[
-		    (mingwTop := MingwTop) isNil ifTrue:[
-			mingwTop := {
-				    (programFiles,'\mingw64') .
-				    (programFiles,'\mingw') .
-				    ('c:\mingw64') .
-				    ('c:\mingw') .
-				 } detect:[:path | path asFilename exists and:[(path asFilename construct:'bin/gcc.exe') exists]]
-				   ifNone:nil.
-		    ].
-		    (mingwTop notNil and:[mingwTop asFilename exists]) ifTrue:[
-			STCCompilationDefines := STCCompilationDefines,' -D__MINGW64__'.
-			"/ CCCompilationOptions := '-w64'.
-		    ].
-		].
-		(mingwTop notNil and:[mingwTop asFilename exists]) ifTrue:[
-		    STCCompilationDefines := STCCompilationDefines,' -D__MINGW__'.
-		    CCPath := mingwTop,'\bin\gcc.exe'.
-		    LinkCommand := 'gcc'.
-		    MakeCommand := 'mingwmake'.
-		    LibDirectory := topDirName,'\lib\mingw'.
-		    LinkArgs := '-L',topDirName,'\lib\mingw'.
-		    "/ LinkArgs := LinkArgs,' -r -c -ap -Tpd -Gi -w-dup'.
-		].
-	    ].
-	].
-	STCCompilationOptions := '+optinline +inlineNew'.
-	(topDirName,'\stc\stc.exe') asFilename exists ifTrue:[
-	    STCPath := (topDirName,'\stc\stc.exe').
-	] ifFalse:[
-	    STCPath := 'stc.exe'.
-	].
-	LibPath := ''.
-	SearchedLibraries := #('import32.lib').
-	"/ SearchedLibraries := #('import32.lib' 'glu32.lib' 'opengl32.lib').
+        useBorlandC := useVisualC := useMingw32 := useMingw64 := false.
+        programFiles := OperatingSystem getEnvironment:'ProgramFiles'.
+        programFiles isEmptyOrNil ifTrue:[ programFiles := 'C:\Program Files' ].
+
+        STCCompilationIncludes := '-I',topDirName,'\include -I',topDirName,'\libopengl'.
+
+        ExternalAddress pointerSize == 4 ifFalse:[
+            bccTop := nil
+        ] ifTrue:[
+            (bccTop := BCCTop) isNil ifTrue:[
+                borlandDir := OperatingSystem getEnvironment:'BCCDIR'.
+                borlandDir isEmptyOrNil ifTrue:[ borlandDir := 'C:\Borland\bcc55' ].
+                bccTop := {
+                            (borlandDir) .
+                            (programFiles , '\Borland\bcc55') .
+                            (programFiles , '\bcc55') .
+                          } detect:[:path | path asFilename exists and:[(path asFilename construct:'include') exists]]
+                             ifNone:nil.
+            ].
+        ].
+
+        STCCompilationDefines := '-DWIN32'.
+
+        (bccTop notNil and:[bccTop asFilename exists]) ifTrue:[
+            STCCompilationIncludes := STCCompilationIncludes,' -I',bccTop,'\Include'.
+            LibDirectory := topDirName,'\lib\bc'.
+            LinkArgs := '-L',topDirName,'\lib\bc'.
+            LinkArgs := LinkArgs,' -L',bccTop,'\Lib -r -c -ap -Tpd -Gi -w-dup'.
+            CCPath := 'bcc32'.
+            MakeCommand := 'bmake'.
+            LinkCommand := 'ilink32'.
+            CCCompilationOptions := '-w-'.
+            useBorlandC := true.
+        ] ifFalse:[
+            ExternalAddress pointerSize == 4 ifFalse:[
+                vcTop := nil.
+            ] ifTrue:[
+                (vcTop := VCTop) isNil ifTrue:[
+                    vcTop := {
+                                (programFiles,'\Microsoft Visual Studio 13.0\VC') .
+                                (programFiles,'\Microsoft Visual Studio 12.0\VC') .
+                                (programFiles,'\Microsoft Visual Studio 11.0\VC') .
+                                (programFiles,'\Microsoft Visual Studio 10.0\VC') .
+                                (programFiles,'\Microsoft Visual Studio 9.0\VC' ) .
+                             } detect:[:path | path asFilename exists and:[(path asFilename construct:'bin/cl.exe') exists]]
+                               ifNone:nil.
+                ].
+            ].
+            (vcTop notNil and:[vcTop asFilename exists]) ifTrue:[
+                useVisualC := true.
+                STCCompilationIncludes := STCCompilationIncludes,' -I',vcTop,'include'.
+
+                (sdkTop := SDKTop) isNil ifTrue:[
+                    sdkTop := {
+                                (programFiles,'\Microsoft SDKs\Windows\v9.0A') .
+                                (programFiles,'\Microsoft SDKs\Windows\v8.0A') .
+                                (programFiles,'\Microsoft SDKs\Windows\v8.0A') .
+                                (programFiles,'\Microsoft SDKs\Windows\v7.0A') .
+                                (programFiles,'\Microsoft SDKs\Windows\v6.0A') .
+                             }  detect:[:path | path asFilename exists and:[(path asFilename construct:'include') exists]] ifNone:nil.
+                ].
+                (sdkTop notNil and:[sdkTop asFilename exists]) ifTrue:[
+                    STCCompilationIncludes := STCCompilationIncludes,' -I',sdkTop,'\include'.
+                ].
+                LibDirectory := topDirName,'\lib\vc'.
+                LinkArgs := '-L',topDirName,'\lib\vc'.
+                LinkArgs := LinkArgs,' -r -c -ap -Tpd -Gi -w-dup'.
+                CCPath := vcTop,'\bin\cl.exe'.
+                LinkCommand := 'ilink32'.
+                MakeCommand := 'vcmake'.
+                CCCompilationOptions := '/nologo /ZI  /w /GF /EHsc /FR.\objvc\'.
+            ] ifFalse:[
+                "/ add definitions for lcc, mingc etc.
+                "/ STCCompilationIncludes := STCCompilationIncludes,' -IC:\xxxxx\Include'.
+                ExternalAddress pointerSize == 4 ifTrue:[
+                    (mingwTop := MingwTop) isNil ifTrue:[
+                        mingwTop := {
+                                    (programFiles,'\mingw') .
+                                    (programFiles,'\mingw') .
+                                    ('c:\mingw32') .
+                                    ('c:\mingw') .
+                                 } detect:[:path | path asFilename exists and:[(path asFilename construct:'bin/gcc.exe') exists]]
+                                   ifNone:nil.
+                    ].
+                    (mingwTop notNil and:[mingwTop asFilename exists]) ifTrue:[
+                        useMingw32 := true.
+                        STCCompilationDefines := STCCompilationDefines,' -D__MINGW32__'.
+                        CCCompilationOptions := '-w32'.
+                    ].
+                ] ifFalse:[
+                    (mingwTop := MingwTop) isNil ifTrue:[
+                        mingwTop := {
+                                    (programFiles,'\mingw64') .
+                                    (programFiles,'\mingw') .
+                                    ('c:\mingw64') .
+                                    ('c:\mingw') .
+                                 } detect:[:path | path asFilename exists and:[(path asFilename construct:'bin/gcc.exe') exists]]
+                                   ifNone:nil.
+                    ].
+                    (mingwTop notNil and:[mingwTop asFilename exists]) ifTrue:[
+                        STCCompilationDefines := STCCompilationDefines,' -D__MINGW64__'.
+                        "/ CCCompilationOptions := '-w64'.
+                    ].
+                ].
+                (mingwTop notNil and:[mingwTop asFilename exists]) ifTrue:[
+                    STCCompilationDefines := STCCompilationDefines,' -D__MINGW__'.
+                    CCPath := mingwTop,'\bin\gcc.exe'.
+                    LinkCommand := 'gcc'.
+                    MakeCommand := 'mingwmake'.
+                    LibDirectory := topDirName,'\lib\mingw'.
+                    LinkArgs := '-L',topDirName,'\lib\mingw'.
+                    "/ LinkArgs := LinkArgs,' -r -c -ap -Tpd -Gi -w-dup'.
+                ].
+            ].
+        ].
+        STCCompilationOptions := '+optinline +inlineNew'.
+        (topDirName,'\stc\stc.exe') asFilename exists ifTrue:[
+            STCPath := (topDirName,'\stc\stc.exe').
+        ] ifFalse:[
+            STCPath := 'stc.exe'.
+        ].
+        LibPath := ''.
+        SearchedLibraries := #('import32.lib').
+        "/ SearchedLibraries := #('import32.lib' 'glu32.lib' 'opengl32.lib').
     ] ifFalse:[
-	STCCompilationIncludes := '-I',topDirName,'/include'.
-	STCCompilationDefines := ''.
-	STCCompilationOptions := '+optinline +inlineNew'.
-	STCPath := topDirName,'/stc/stc'.
-
-	archArg := picArg := ''.
-	(ExternalAddress pointerSize == 4) ifTrue:[
-	    archArg := ' -m32'
-	] ifFalse:[
-	    archArg := ' -m64'.            "gcc -m64 needs -fPIC to make a shared library"
-	    picArg := ' -fPIC'.
-	].
-	CCCompilationOptions := OperatingSystem getCPUDefine,
-				' -D', self usedCompilerDefine,
-				' ', OperatingSystem getOSDefine,
-				' ', '-O', archArg, picArg.
-	ParserFlags useClang ifTrue:[
-	    CCPath := 'clang'
-	] ifFalse:[
-	    ParserFlags useGnuC ifTrue:[
-		CCPath := 'gcc'
-	    ] ifFalse:[
-		CCPath := 'cc'
-	    ].
-	].
-	LinkArgs := archArg.
-	LinkSharedArgs := '-shared'.
-	LinkCommand := CCPath.
-	LibPath := ''.
-	SearchedLibraries := #().
-	MakeCommand := 'make'.
+        STCCompilationIncludes := '-I',topDirName,'/include'.
+        STCCompilationDefines := ''.
+        STCCompilationOptions := '+optinline +inlineNew'.
+        STCPath := topDirName,'/stc/stc'.
+
+        archArg := picArg := ''.
+        (ExternalAddress pointerSize == 4) ifTrue:[
+            archArg := ' -m32'
+        ] ifFalse:[
+            archArg := ' -m64'.            "gcc -m64 needs -fPIC to make a shared library"
+            picArg := ' -fPIC'.
+        ].
+        CCCompilationOptions := OperatingSystem getCPUDefine,
+                                ' -D', self usedCompilerDefine,
+                                ' ', OperatingSystem getOSDefine,
+                                ' ', '-O', archArg, picArg.
+        ParserFlags useClang ifTrue:[
+            CCPath := 'clang'
+        ] ifFalse:[
+            ParserFlags useGnuC ifTrue:[
+                CCPath := 'gcc'
+            ] ifFalse:[
+                CCPath := 'cc'
+            ].
+        ].
+        LinkArgs := archArg.
+        LinkCommand := CCPath.
+        LinkSharedArgs := '-shared'.
+
+        OperatingSystem isOSXlike ifTrue:[
+            LinkSharedArgs := '-shared -mmacosx-version-min=10.3 -arch x86_64 librun.so'.
+            CCCompilationOptions := CCCompilationOptions ,' -mmacosx-version-min=10.3' 
+        ].    
+        LibPath := ''.
+        SearchedLibraries := #().
+        MakeCommand := 'make'.
     ].
 
     Smalltalk infoPrinting ifTrue:[
-	'ParserFlags [info]:' infoPrintCR.
-	'  STC Setup:' infoPrintCR.
-	('    STCCompilationDefines: ',STCCompilationDefines asString) infoPrintCR.
-	('    CCPath: ',CCPath asString) infoPrintCR.
-	('    CCCompilationOptions: ',CCCompilationOptions asString) infoPrintCR.
-	('    LinkCommand: ',LinkCommand asString) infoPrintCR.
-	('    MakeCommand: ',MakeCommand asString) infoPrintCR.
-	('    LinkArgs: ',LinkArgs asString) infoPrintCR.
+        'ParserFlags [info]:' infoPrintCR.
+        '  STC Setup:' infoPrintCR.
+        ('    STCCompilationDefines: ',STCCompilationDefines asString) infoPrintCR.
+        ('    CCPath: ',CCPath asString) infoPrintCR.
+        ('    CCCompilationOptions: ',CCCompilationOptions asString) infoPrintCR.
+        ('    LinkCommand: ',LinkCommand asString) infoPrintCR.
+        ('    MakeCommand: ',MakeCommand asString) infoPrintCR.
+        ('    LinkArgs: ',LinkArgs asString) infoPrintCR.
     ].
 
     "