STC interface clenaup: cleaned up C flags initialization
When initializing C compiled flags (i.e., ParserFlags ccOptions) do not
include flags always passed (see STCCompilerInterface>>setupCompilationCommandArguments.
--- a/ParserFlags.st Thu Dec 10 06:39:46 2015 +0100
+++ b/ParserFlags.st Sat Dec 05 07:19:07 2015 +0000
@@ -1727,10 +1727,7 @@
(ExternalAddress pointerSize == 4) ifTrue:[
m32 := ' -m32'
].
- CCCompilationOptions := OperatingSystem getCPUDefine,
- ' -D', self usedCompilerDefine,
- ' ', OperatingSystem getOSDefine,
- ' ', '-O', m32.
+ CCCompilationOptions := ''.
ParserFlags useClang ifTrue:[
CCPath := 'clang'
] ifFalse:[
@@ -1754,6 +1751,7 @@
"Modified: / 09-08-2006 / 18:47:18 / fm"
"Created: / 06-08-2011 / 19:47:47 / cg"
+ "Modified: / 04-12-2015 / 18:48:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!ParserFlags methodsFor:'accessing'!
@@ -2678,6 +2676,11 @@
version_CVS
^ '$Header$'
+!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
! !
--- a/STCCompilerInterface.st Thu Dec 10 06:39:46 2015 +0100
+++ b/STCCompilerInterface.st Sat Dec 05 07:19:07 2015 +0000
@@ -48,6 +48,15 @@
!STCCompilerInterface class methodsFor:'accessing'!
+builtinCFlags
+ "Return C compiler flags that are always passed to the C compiler
+ when a (ST)C file is compiled."
+
+ ^ OperatingSystem getCPUDefine , ' ', OperatingSystem getOSDefine
+
+ "Created: / 04-12-2015 / 16:41:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
stcPathOf:command
"return the path to an stc command, or nil if not found."
@@ -112,6 +121,13 @@
"if on, trace command execution on the Transcript"
Verbose := aBoolean
+
+ "
+ STCCompilerInterface verbose: true.
+ STCCompilerInterface verbose: false.
+ "
+
+ "Modified (comment): / 04-12-2015 / 16:44:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!STCCompilerInterface class methodsFor:'class initialization'!
@@ -877,7 +893,7 @@
!
setupCompilationCommandArguments
- |stFn mapFileName libFileName def libDir incDir incDirArg defs incl opts|
+ |stFn libDir incDir incDirArg defs incl opts|
parserFlags isNil ifTrue:[ parserFlags := ParserFlags new].
@@ -887,8 +903,6 @@
"/ ParserFlags useBorlandC ifTrue:[
"/ cFileName := (stFn withSuffix:'sc') name.
"/ ].
- mapFileName := (stFn withSuffix:'map') name.
- libFileName := (stFn withSuffix:'lib') name.
oFileName asFilename delete.
cFileName asFilename delete.
@@ -897,13 +911,7 @@
initName notEmptyOrNil ifTrue:[
stcFlags := stcFlags,' -N' , initName .
].
- cFlags := OperatingSystem getOSDefine.
- cFlags isNil ifTrue:[
- cFlags := ''
- ].
- (def := OperatingSystem getCPUDefine) notEmptyOrNil ifTrue:[
- cFlags := cFlags , ' ' , def
- ].
+ cFlags := self class builtinCFlags.
(defs := parserFlags stcCompilationDefines) notEmptyOrNil ifTrue:[
cFlags := cFlags , ' ' , defs
@@ -936,6 +944,7 @@
"Created: / 07-11-2006 / 12:24:47 / cg"
"Modified: / 07-11-2006 / 13:58:54 / cg"
+ "Modified: / 04-12-2015 / 16:42:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!STCCompilerInterface class methodsFor:'documentation'!