ParserFlags.st
branchjv
changeset 3700 264d6604a9f3
parent 3687 c71140c6d0a0
child 3707 4593eb11f9f5
--- a/ParserFlags.st	Mon Jan 04 21:17:25 2016 +0000
+++ b/ParserFlags.st	Wed Jan 06 23:03:26 2016 +0100
@@ -1495,7 +1495,7 @@
 !ParserFlags class methodsFor:'class initialization'!
 
 initialize
-    | executablePath |
+    | executablePath topDirectory stcExe |
 
     Warnings := true.
     WarnUndeclared := true.
@@ -1588,19 +1588,21 @@
     DefineForMINGW64 := '__MINGW64__'.
     DefineForCLANG := '__clang__'.
 
+    stcExe := OperatingSystem isMSWINDOWSlike ifTrue:['stc.exe'] ifFalse:['stc'].
+
     (executablePath := OperatingSystem pathOfSTXExecutable) notNil ifTrue:[
-        executablePath := executablePath asFilename directory.
-        (((executablePath / 'include') exists and:[(executablePath / 'stc') exists])
+        topDirectory := executablePath asFilename directory.
+        (((topDirectory / 'include') exists and:[(topDirectory / 'stc') exists or:[(topDirectory / 'bin' / stcExe) exists]])
           or:[
-            executablePath := executablePath directory.
-            ((executablePath / 'include') exists and:[(executablePath / 'stc') exists])
+            topDirectory := topDirectory directory.
+            ((topDirectory / 'include') exists and:[(topDirectory / 'stc') exists or:[(topDirectory / 'bin' / stcExe) exists]])
               or:[
-                executablePath := executablePath directory.
-                ((executablePath / 'include') exists and:[(executablePath / 'stc') exists])
+                topDirectory := topDirectory directory.
+                ((topDirectory / 'include') exists and:[(topDirectory / 'stc') exists or:[(topDirectory / 'bin' / stcExe) exists]])
               ]
            ]
         ) ifTrue:[
-            self initializeSTCFlagsForTopDirectory: executablePath.
+            self initializeSTCFlagsForTopDirectory: topDirectory.
         ]
     ].
 
@@ -1624,22 +1626,16 @@
 
     "Modified: / 09-08-2006 / 18:47:18 / fm"
     "Modified: / 31-01-2012 / 12:06:32 / cg"
-    "Modified: / 09-12-2015 / 22:24:10 / jv"
+    "Modified: / 06-01-2016 / 22:25:30 / jv"
 !
 
 initializeSTCFlagsForGCC
     self ccPath: 'gcc'.
     self linkCommand: 'gcc'.
-    ExternalAddress pointerSize == 4 ifTrue:[ 
-        self linkArgs: '-m32'.
-        self linkSharedArgs: '-shared -m32'
-    ] ifFalse:[ 
-        self linkArgs: '-m64'.
-        self linkSharedArgs: '-shared -m64'
-    ].
+    self linkArgs: ''.
+    self linkSharedArgs: '-shared'
 
     "Created: / 09-12-2015 / 22:10:52 / jv"
-    "Modified: / 10-12-2015 / 09:33:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 initializeSTCFlagsForMINGW32
@@ -1679,7 +1675,7 @@
      notice: for now, can only initialize for borland+windows or linux;
      visualC setup still fails."
 
-    |topDir topDirName|
+    |topDir topDirName stcExe stcPath |
 
     topDir := topDirArg.
     OperatingSystem isMSWINDOWSlike ifTrue:[
@@ -1697,30 +1693,28 @@
         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.
-    ].
-
-    OperatingSystem isMSWINDOWSlike ifTrue:[
-        STCCompilationOptions := '+optinline +inlineNew'.
-        (topDirName,'\stc\stc.exe') asFilename exists ifTrue:[
-            STCPath := (topDirName,'\stc\stc.exe').
+    stcExe := OperatingSystem isMSWINDOWSlike ifTrue:['stc.exe'] ifFalse:['stc'].
+
+    (stcPath := topDir / 'stc' / stcExe) exists ifTrue:[
+        "/ build-tree environment
+        STCPath := stcPath pathName.        
+    ] ifFalse:[
+        (stcPath := topDir / 'bin' / stcExe) exists ifTrue:[
+            "/ Packaged environment
+            STCPath := stcPath pathName.        
         ] ifFalse:[
-            STCPath := 'stc.exe'.
-        ].
-        LibPath := ''.
-        SearchedLibraries := #().
-        MakeCommand := 'make'
-    ] ifFalse:[
-        STCCompilationOptions := '+optinline +inlineNew'.
-        STCPath := topDirName,'/stc/stc'.
-        LibPath := ''.
-        SearchedLibraries := #().
-        MakeCommand := 'make'.
+            Logger warning: 'stc not found in "%1"' with: topDirName.
+            Logger warning: 'stc-compiling (primitive code) will not work in the browser'. 
+            STCCompilation := #never.
+        ]
     ].
 
+
+    STCCompilationOptions := '+optinline +inlineNew'.
+    LibPath := ''.
+    SearchedLibraries := #().
+    MakeCommand := 'make'
+    .
     "
      ParserFlags initializeSTCFlagsForTopDirectory:'../..'
     "
@@ -1728,7 +1722,7 @@
     "Modified: / 09-08-2006 / 18:47:18 / fm"
     "Created: / 06-08-2011 / 19:47:47 / cg"
     "Modified: / 09-12-2015 / 17:03:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 09-12-2015 / 22:28:59 / jv"
+    "Modified: / 06-01-2016 / 22:45:09 / jv"
 !
 
 old_initializeSTCFlagsForTopDirectory:topDirArg