STCCompilerInterface.st
author Claus Gittinger <cg@exept.de>
Mon, 08 Aug 2011 23:03:12 +0200
changeset 2644 51666ff4ec9f
parent 2643 60d2bae2be58
child 2646 de9d7a6e6315
permissions -rw-r--r--
changed: #compileToObj
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
 COPYRIGHT (c) 2006 by eXept Software AG
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
              All Rights Reserved
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 This software is furnished under a license and may be used
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 only in accordance with the terms of that license and with the
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 inclusion of the above copyright notice.   This software may not
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 be provided or otherwise made available to, or used by, any
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 other person.  No title to or ownership of the software is
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
 hereby transferred.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"{ Package: 'stx:libcomp' }"
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
Object subclass:#STCCompilerInterface
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
    16
	instanceVariableNames:'originator parserFlags initName theNonMetaclassToCompileFor
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
    17
		classToCompileFor stFileName cFileName oFileName stcFlags cFlags
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
    18
		stcPath ccPath requestor methodCategory executionStatus package'
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	classVariableNames:'SequenceNumber Verbose'
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	poolDictionaries:''
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	category:'System-Compiler'
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!STCCompilerInterface class methodsFor:'documentation'!
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
copyright
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
"
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 COPYRIGHT (c) 1989 by Claus Gittinger
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 COPYRIGHT (c) 2006 by eXept Software AG
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
              All Rights Reserved
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 This software is furnished under a license and may be used
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 hereby transferred.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
!
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
documentation
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    a refactored complex method - originally found in ByteCodeCompiler.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
"
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
! !
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
!STCCompilerInterface class methodsFor:'accessing'!
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
stcPathOf:command 
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    "return the path to an stc command, or nil if not found."
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    |f d reqdSuffix cmd|
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    "/
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
    "/ care for executable suffix
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    "/
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
    cmd := command.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    OperatingSystem isMSDOSlike ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
        reqdSuffix := 'exe'
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    ] ifFalse:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
        OperatingSystem isVMSlike ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
            reqdSuffix := 'EXE'
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
        ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    reqdSuffix notNil ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
        (f := cmd asFilename) suffix isEmpty ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
            cmd := (f withSuffix:reqdSuffix) name
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
        ]
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
    "/
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    "/ for our convenience, also check in current
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    "/ and parent directories; even if PATH does not
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    "/ include them ...
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    "/
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    "/ look in current ...
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    d := Filename currentDirectory.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    (f := d construct:cmd) isExecutable ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
        ^ f pathName
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    "/ look in ../stc ...
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
    d := d construct:'..'.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    (f := (d construct:'stc') construct:cmd) isExecutable ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
        ^ f pathName
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    "/ look in ../../stc ...
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    d := d construct:'..'.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    (f := (d construct:'stc') construct:cmd) isExecutable ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
        ^ f pathName
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
    ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
    "/
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
    "/ ok, stc must be installed in some directory along the PATH
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    "/
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    ^ OperatingSystem pathOfCommand:command
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    "
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
     STCCompilerInterface stcPathOf:'stc'     
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
    "
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
    "Created: 13.9.1995 / 14:37:16 / claus"
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
! !
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
!STCCompilerInterface class methodsFor:'class initialization'!
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
initialize
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
    Verbose := false.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
! !
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
!STCCompilerInterface methodsFor:'accessing'!
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
2335
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   111
cFileName:something
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   112
    cFileName := something.
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   113
!
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   114
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
incrementalStcPath 
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
    "return the path to the stc command for incremental method compilation, 
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
     or nil if not found."
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
    |f cmd|
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    (cmd := parserFlags stcPath) isEmptyOrNil ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
        (f := self class stcPathOf:'stc') notNil ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
            cmd := f
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
        ] ifFalse:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
            cmd := self class stcPathOf:'demostc'
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
        ]
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    (cmd notNil and:[cmd includes:Character space]) ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
        cmd := '"' , cmd , '"'.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
    ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    ^ cmd
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    "Created: 13.9.1995 / 14:36:36 / claus"
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    "Modified: 13.9.1995 / 15:15:04 / claus"
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
!
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
originator:something
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    originator := something.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
!
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
parserFlags:something
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    parserFlags := something.
2335
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   143
!
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   144
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   145
stFileName:something
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   146
    stFileName := something.
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
! !
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
!STCCompilerInterface methodsFor:'machine code generation'!
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   151
compileToMachineCode:aString forClass:aClass selector:selector inCategory:categoryArg 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   152
                             notifying:requestorArg install:install skipIfSame:skipIfSame silent:silent
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
    "this is called to compile primitive code.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
     This is EXPERIMENTAL and going to be changed to raise an error,
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
     an redefined in subclasses which can do it (either by direct compilation, or by calling
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   156
     the external stc do do it)."
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
1941
941810becd2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   158
    |handle oldMethod newMethod ok moduleFileName|
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
    install ifFalse:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
        "/ cannot do it uninstalled. reason:
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
        "/ if it is loaded twice, the first version could be unloaded by
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
        "/ finalization, which would also unload the second version
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
        "/ (because the first unload would unload the second version too)
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
        ^ #CannotLoad
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
    ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
    parserFlags stcCompilation == #never ifTrue:[^ #CannotLoad].
1670
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   168
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   169
    classToCompileFor := aClass.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   170
    requestor := requestorArg.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   171
    methodCategory := categoryArg.
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   173
    self ensureModuleDirectoryExists.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   174
    self ensureExternalToolsArePresent ifFalse:[^ #CannotLoad].
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   176
    theNonMetaclassToCompileFor := classToCompileFor theNonMetaclass.
1941
941810becd2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   177
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   178
    self ensureSuperClassesAreLoadedOf:theNonMetaclassToCompileFor.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   179
    theNonMetaclassToCompileFor privateClassesSorted do:[:aPrivateClass |
1670
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   180
        self ensureSuperClassesAreLoadedOf:aPrivateClass.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   181
    ].
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   182
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   183
    (classToCompileFor isNil 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   184
    or:[parserFlags allowExtensionsToPrivateClasses 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   185
    or:[classToCompileFor owningClass isNil]]) ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   186
        (requestor respondsTo:#packageToInstall) ifFalse:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   187
            package := Class packageQuerySignal query.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   188
        ] ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   189
            package := requestor packageToInstall
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   190
        ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   191
    ] ifFalse:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   192
        package := classToCompileFor owningClass package
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
    ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    [
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   196
        self generateSTSource:aString.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   197
        self setupCompilationCommandArguments.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   198
        ok := self compileToC.
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
        ok ifTrue:[
2491
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   200
            parserFlags stcKeepSIntermediate ifTrue:[ self compileToS ].
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
            "/ now compile to machine code
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   202
            ok := self compileToObj.
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
        ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
        ok ifFalse:[
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   206
            self reportCompilationError.
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
            ^ #Error
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
        ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
        originator activityNotification:''.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
        OperatingSystem removeFile:'errorOutput'.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
        "
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
         if required, make a shared or otherwise loadable object file for it
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
        "
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
        originator activityNotification:'linking'.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
        oFileName := ObjectFileLoader createLoadableObjectFor:initName.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
        oFileName isNil ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
            "/ something went wrong
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
            originator parseError:('link error: ' , ObjectFileLoader lastError) position:1.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
            ^ #CannotLoad
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
        ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
        oFileName asFilename exists ifFalse:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
            originator parseError:'link failed - cannot create machine code' position:1.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
            ^ #CannotLoad
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
        ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
        "
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
         move it into the modules directory
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
        "
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
        moduleFileName := (parserFlags stcModulePath asFilename construct:(initName , '.' , (oFileName asFilename suffix))) name.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
        oFileName asFilename moveTo:moduleFileName.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
        (moduleFileName asFilename exists 
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
        and:[moduleFileName asFilename isReadable]) ifFalse:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
            originator parseError:'link failed - cannot move shared library module to ''modules'' directory' position:1.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
            ^ #CannotLoad
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
        ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   240
        oldMethod := classToCompileFor compiledMethodAt:selector.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   241
        oldMethod notNil ifTrue:[package := oldMethod package].
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
        "
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
         load the method objectfile
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
        "
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
        originator activityNotification:'loading'.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
        handle := ObjectFileLoader loadMethodObjectFile:moduleFileName.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
        handle isNil ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
            OperatingSystem removeFile:moduleFileName.
2185
cb311d08a486 changed #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2068
diff changeset
   251
            "catch, so that #CannotLoad processing is done"
2350
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   252
            Parser parseErrorSignal catch:[
2185
cb311d08a486 changed #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2068
diff changeset
   253
                originator parseError:'dynamic load of machine code failed' position:1.
cb311d08a486 changed #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2068
diff changeset
   254
            ].
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
            ^ #CannotLoad
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
        ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
        "
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
         did it work ?
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
        "
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   261
        newMethod := classToCompileFor compiledMethodAt:selector.
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
        "/ if install is false, we have to undo the install (which is always done, when loading machine code)
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
        install ifFalse:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
            oldMethod isNil ifTrue:[
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   266
                classToCompileFor removeSelector:selector
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
            ] ifFalse:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
                newMethod setPackage:oldMethod package.
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   269
                classToCompileFor addSelector:selector withMethod:oldMethod.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   270
                oldMethod setPackage:package.
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
            ]
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
        ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
        newMethod notNil ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
            handle method ~~ newMethod ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
                'Compiler [warning]: loaded method installed itself in another class' errorPrintCR.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
            ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
            newMethod source:aString string.
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   280
            newMethod setPackage:package.
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
"/            Project notNil ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
"/                newMethod package:(Project currentPackageName)
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
"/            ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   285
    "/        classToCompileFor updateRevisionString.
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
            install ifTrue:[
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   287
                classToCompileFor addChangeRecordForMethod:newMethod fromOld:oldMethod.
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
                "/ kludge-sigh: must send change messages manually here (stc-loaded code does not do it)
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
                "/ see addMethod:... in ClassDescription
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   291
                classToCompileFor changed:#methodDictionary with:(Array with:selector with:oldMethod).
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   292
                Smalltalk changed:#methodInClass with:(Array with:classToCompileFor with:selector with:oldMethod).
2350
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   293
            ] ifFalse:[
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   294
                oldMethod := nil.
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
            ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
1986
57913c678602 comment
Stefan Vogel <sv@exept.de>
parents: 1941
diff changeset
   297
            silent ifFalse:[
1941
941810becd2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   298
                Transcript showCR:('    compiled: ', aClass name,' ',selector,' - machine code')
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
            ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
            ObjectMemory flushCaches.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
            handle method:newMethod.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
2350
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   304
            "/ check for obsolete compiled method code and unload the
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   305
            "/ corresponding ObjectFileHandle.
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   306
            "/ The old method with its source code is usually kept in the method history.
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   307
            "/ and will be recompiled on an undo
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
            ObjectFileLoader loadedObjectHandlesDo:[:anotherHandle |
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
                anotherHandle isMethodHandle ifTrue:[
2350
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   311
                    anotherHandle method == oldMethod ifTrue:[
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   312
                        "break association betwen old method, code and handle"
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   313
                        anotherHandle removeConnectedObjects.
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   314
                    ].
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   315
                    anotherHandle isObsolete ifTrue:[
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   316
                        anotherHandle unload.
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   317
                        anotherHandle removeUnusedObjectFile.
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   318
                    ].
16caba266df4 changed: #compileToMachineCode:forClass:selector:inCategory:notifying:install:skipIfSame:silent:
Stefan Vogel <sv@exept.de>
parents: 2336
diff changeset
   319
                ].
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
            ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
            ^ newMethod.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
        ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
        OperatingSystem removeFile:moduleFileName.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
        originator parseError:'dynamic load failed' position:1.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
        ^ #CannotLoad
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
    ] ensure:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
        parserFlags stcKeepSTIntermediate ifFalse:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
            OperatingSystem removeFile:stFileName.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
            OperatingSystem removeFile:'errorOutput'.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
        ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
        parserFlags stcKeepOIntermediate == true ifFalse:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
            (oFileName notNil and:[oFileName asFilename exists]) ifTrue:[oFileName asFilename delete].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
        ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   335
        parserFlags stcKeepCIntermediate == true ifFalse:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
            (cFileName notNil and:[cFileName asFilename exists]) ifTrue:[cFileName asFilename delete].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
        ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
        OperatingSystem isMSDOSlike ifTrue:[
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
"/            (mapFileName notNil and:[mapFileName asFilename exists]) ifTrue:[mapFileName asFilename delete].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
"/            (libFileName notNil and:[libFileName asFilename exists]) ifTrue:[libFileName asFilename delete].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
        ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
    ].
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
    "
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
     |m|
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
     Object subclass:#Test
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
            instanceVariableNames:''
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
            classVariableNames:''
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
            poolDictionaries:''
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
            category:'tests'.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
     m := ByteCodeCompiler
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
            compile:'foo ^ ''hello'''
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
            forClass:Test
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
            inCategory:'tests'
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   356
            notifying:nil
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   357
            install:false
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   358
            skipIfSame:false.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
     m inspect
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
    "
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
    "
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   362
     |m|
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   363
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   364
     Object subclass:#Test
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   365
            instanceVariableNames:''
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   366
            classVariableNames:''
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
            poolDictionaries:''
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
            category:'tests'.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
     m := ByteCodeCompiler
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   370
            compileToMachineCode:'foo %{ RETURN (_MKSMALLINT(1)); %}'
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   371
            forClass:Test
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
            inCategory:'tests'
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
            notifying:nil
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
            install:false
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
            skipIfSame:false
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   376
            silent:false.
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
     m inspect
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   378
    "
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   380
    "Modified: / 14-09-1995 / 22:33:04 / claus"
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   381
    "Modified: / 19-03-1999 / 08:31:42 / stefan"
1941
941810becd2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   382
    "Modified: / 07-11-2006 / 14:21:46 / cg"
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   383
! !
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   384
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   385
!STCCompilerInterface methodsFor:'machine code generation-helpers'!
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   386
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   387
compileToC
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   388
    "compile st to C using stc"
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   389
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   390
    |command errorStream ok|
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   391
2643
60d2bae2be58 comment/format in: #generateSTSource:
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   392
    command := stcPath , ' ' , stcFlags , ' -C ' , (stFileName asFilename pathName).
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   393
    errorStream := 'errorOutput' asFilename writeStream.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   394
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   395
    Verbose == true ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   396
        'executing: ' infoPrint. command infoPrintCR.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   397
    ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   398
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   399
    originator activityNotification:'compiling (stc)'.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   400
    ok := OperatingSystem 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   401
                executeCommand:command 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   402
                inputFrom:nil
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   403
                outputTo:errorStream
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   404
                errorTo:errorStream
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   405
                onError:[:stat| 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   406
                            executionStatus := stat.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   407
                            false
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   408
                        ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   409
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   410
    errorStream close.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   411
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   412
    cFileName asFilename exists ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   413
        ok ifFalse:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   414
            'Compiler [info]: oops - system says stc failed - but c-file is there ...' infoPrintCR.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   415
            ok := true
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   416
        ]
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   417
    ] ifFalse:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   418
        ok ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   419
            'Compiler [info]: oops - system says stc ok - but no c-file is there ...' infoPrintCR.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   420
        ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   421
        ok := false
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   422
    ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   423
    ^ ok
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   424
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   425
    "Created: / 07-11-2006 / 12:11:24 / cg"
2643
60d2bae2be58 comment/format in: #generateSTSource:
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   426
    "Modified: / 08-08-2011 / 22:12:01 / cg"
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   427
!
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   428
2336
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   429
compileToExe
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   430
    "compile C to exe, using cc"
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   431
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   432
    |command errorStream ok|
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   433
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   434
    errorStream := 'errorOutput' asFilename newReadWriteStream.
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   435
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   436
    command := ccPath , ' ' , cFlags , ' -D__INCREMENTAL_COMPILE__ ' , cFileName.
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   437
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   438
    Verbose == true ifTrue:[
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   439
        'executing: ' infoPrint. command infoPrintCR.
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   440
    ].
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   441
    originator activityNotification:'compiling (' , ccPath , ')'.
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   442
    ok := OperatingSystem 
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   443
                executeCommand:command 
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   444
                inputFrom:nil
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   445
                outputTo:errorStream
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   446
                errorTo:errorStream
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   447
                onError:[:stat| 
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   448
                            executionStatus := stat.
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   449
                            false
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   450
                ].
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   451
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   452
    ok ifFalse:[
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   453
        errorStream reset.
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   454
        errorStream copyToEndInto:Transcript.
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   455
    ].
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   456
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   457
    errorStream close.
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   458
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   459
    ^ ok
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   460
!
adaeb8836c48 added: #compileToExe
Claus Gittinger <cg@exept.de>
parents: 2335
diff changeset
   461
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   462
compileToObj
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   463
    "compile C to obj, using cc"
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   464
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   465
    |command errorStream ok|
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   466
2195
2996fe27c2f8 Add primitive functions when compiling
Stefan Vogel <sv@exept.de>
parents: 2185
diff changeset
   467
    errorStream := 'errorOutput' asFilename newReadWriteStream.
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   468
2644
51666ff4ec9f changed: #compileToObj
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
   469
    ccPath includesSeparator ifTrue:[
51666ff4ec9f changed: #compileToObj
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
   470
        command := '"',ccPath , '"' 
51666ff4ec9f changed: #compileToObj
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
   471
    ] ifFalse:[
51666ff4ec9f changed: #compileToObj
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
   472
        command := ccPath
51666ff4ec9f changed: #compileToObj
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
   473
    ].
51666ff4ec9f changed: #compileToObj
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
   474
    command := command , ' ' , cFlags , ' -D__INCREMENTAL_COMPILE__ -c ' , cFileName.
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   475
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   476
    Verbose == true ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   477
        'executing: ' infoPrint. command infoPrintCR.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   478
    ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   479
    originator activityNotification:'compiling (' , ccPath , ')'.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   480
    ok := OperatingSystem 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   481
                executeCommand:command 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   482
                inputFrom:nil
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   483
                outputTo:errorStream
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   484
                errorTo:errorStream
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   485
                onError:[:stat| 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   486
                            executionStatus := stat.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   487
                            false
2195
2996fe27c2f8 Add primitive functions when compiling
Stefan Vogel <sv@exept.de>
parents: 2185
diff changeset
   488
                ].
2996fe27c2f8 Add primitive functions when compiling
Stefan Vogel <sv@exept.de>
parents: 2185
diff changeset
   489
2996fe27c2f8 Add primitive functions when compiling
Stefan Vogel <sv@exept.de>
parents: 2185
diff changeset
   490
    ok ifFalse:[
2996fe27c2f8 Add primitive functions when compiling
Stefan Vogel <sv@exept.de>
parents: 2185
diff changeset
   491
        errorStream reset.
2996fe27c2f8 Add primitive functions when compiling
Stefan Vogel <sv@exept.de>
parents: 2185
diff changeset
   492
        errorStream copyToEndInto:Transcript.
2996fe27c2f8 Add primitive functions when compiling
Stefan Vogel <sv@exept.de>
parents: 2185
diff changeset
   493
    ].
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   494
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   495
    errorStream close.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   496
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   497
    oFileName asFilename exists ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   498
        ok ifFalse:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   499
            'Compiler [info]: system says compile failed - but o-file is there ...' infoPrintCR.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   500
            ok := true
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   501
        ]
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   502
    ] ifFalse:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   503
        ok ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   504
            'Compiler [info]: system says compile ok - but no o-file is there ...' infoPrintCR.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   505
        ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   506
        ok := false
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   507
    ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   508
    ^ ok
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   509
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   510
    "Created: / 07-11-2006 / 12:14:51 / cg"
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   511
!
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   512
2491
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   513
compileToS
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   514
    "compile C to assembler, using cc"
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   515
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   516
    |command errorStream ok|
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   517
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   518
    errorStream := 'errorOutput' asFilename newReadWriteStream.
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   519
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   520
    command := ccPath , ' ' , cFlags , ' -D__INCREMENTAL_COMPILE__ -S ' , cFileName.
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   521
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   522
    Verbose == true ifTrue:[
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   523
        'executing: ' infoPrint. command infoPrintCR.
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   524
    ].
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   525
    originator activityNotification:'compiling (' , ccPath , ')'.
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   526
    ok := OperatingSystem 
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   527
                executeCommand:command 
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   528
                inputFrom:nil
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   529
                outputTo:errorStream
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   530
                errorTo:errorStream
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   531
                onError:[:stat| 
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   532
                            executionStatus := stat.
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   533
                            false
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   534
                ].
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   535
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   536
    ok ifFalse:[
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   537
        errorStream reset.
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   538
        errorStream copyToEndInto:Transcript.
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   539
    ].
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   540
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   541
    errorStream close.
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   542
    ^ ok
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   543
!
2d549088a8ea added: #compileToS
Michael Beyl <mb@exept.de>
parents: 2467
diff changeset
   544
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   545
ensureExternalToolsArePresent
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   546
    (stcPath := self incrementalStcPath) isNil ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   547
        originator parseError:'no stc compiler available - cannot create machine code' position:1.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   548
        ^ false
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   549
    ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   550
    (ccPath := parserFlags ccPath) isNil ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   551
        originator parseError:'no cc compiler available - cannot create machine code' position:1.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   552
        ^ false
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   553
    ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   554
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   555
    (ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]) ifFalse:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   556
        originator parseError:'no dynamic loader configured - cannot create machine code' position:1.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   557
        ^ false
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   558
    ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   559
    ^ true
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   560
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   561
    "Created: / 07-11-2006 / 12:31:48 / cg"
1670
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   562
!
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   563
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   564
ensureModuleDirectoryExists
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   565
    |mP t s|
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   566
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   567
    (mP := parserFlags stcModulePath asFilename) exists ifFalse:[
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   568
        mP makeDirectory
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   569
    ].
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   570
    (mP isDirectory and:[ mP isReadable and:[ mP isWritable ] ]) ifFalse:[
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   571
        Parser::ParseError raiseErrorString:('No access to temporary module directory: ' , mP pathName).
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   572
    ].
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   573
    "/ create a small README there ...
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   574
    
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   575
    (t := mP construct:'README') exists ifFalse:[
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   576
        s := t writeStream.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   577
        s 
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   578
            nextPutAll:'This temporary ST/X directory contains machine code for
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   579
accepted methods with embedded C-code 
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   580
(i.e. dynamic compiled code for inline-C methods).
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   581
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   582
Files here are not automatically removed, since ST/X 
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   583
cannot determine if any (other) snapshot image still 
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   584
requires a file here.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   585
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   586
Please be careful when removing files here - a snapshot
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   587
image which was saved with accepted embedded C-code
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   588
may not be able to restart correctly if you remove a
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   589
required file.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   590
Also, when you export a snapshot image for execution
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   591
on another machine, make certain that the required
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   592
module-files are also present there.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   593
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   594
You should periodically clean dead entries here.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   595
i.e. remove files, when you are certain that none
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   596
of your snapshot images refers to any module here.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   597
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   598
See the launchers File-Modules dialog for a list of
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   599
modules which are still required by your running image.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   600
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   601
With kind regards - your ST/X.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   602
'.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   603
        s close.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   604
    ].
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   605
!
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   606
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   607
ensureSuperClassesAreLoadedOf:aClass
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   608
    |supers|
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   609
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   610
    supers := aClass allSuperclasses.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   611
    supers reverseDo:[:cls|
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   612
        cls isLoaded ifFalse:[
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   613
            Parser::ParseError raiseErrorString:'Cannot stc-compile (Some superclass is unloaded)'.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   614
        ]
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   615
    ].
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   616
!
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   617
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   618
fileOutAllDefinitionsOf:aClass to:aStream rememberIn:definedClasses
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   619
    |defineAction|
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   620
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   621
    defineAction := 
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   622
        [:cls|
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   623
            (definedClasses includes:cls) ifFalse:[
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   624
                cls 
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   625
                    basicFileOutDefinitionOn:aStream 
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   626
                    withNameSpace:false withPackage:false
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   627
                    syntaxHilighting:false.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   628
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   629
                aStream nextPut:(aStream class chunkSeparator); cr.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   630
                definedClasses add:cls.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   631
            ].
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   632
        ].
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   633
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   634
    aClass allSuperclasses reverseDo:defineAction.
08e3e0723a60 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   635
    defineAction value:aClass.
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   636
!
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   637
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   638
generateSTSource:aString 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   639
    |stream definedClasses sep className|
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   640
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   641
    "/ generate a unique name, consisting of my processID and a sequence number
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   642
    "/ the processId is added to allow filein of modules from different
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   643
    "/ lifes
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   644
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   645
    SequenceNumber := (SequenceNumber ? 0) + 1.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   646
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   647
    initName := 'm_' , OperatingSystem getProcessId printString, '_' , SequenceNumber printString.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   648
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   649
    stFileName := (Filename currentDirectory construct:(initName , '.st')) name. 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   650
    [
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   651
        stream := stFileName asFilename writeStream.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   652
    ] on:FileStream openErrorSignal do:[:ex|
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   653
        originator parseError:'cannot create temporary sourcefile for compilation'.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   654
        ^ #CannotLoad
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   655
    ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   656
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   657
    definedClasses := IdentitySet new.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   658
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   659
    sep := stream class chunkSeparator.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   660
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   661
    Class fileOutNameSpaceQuerySignal answer:true
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   662
    do:[
2467
a7ed431694a2 changed: #generateSTSource:
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   663
        theNonMetaclassToCompileFor realSharedPoolNames do:[:eachPoolname |
2067
6204fefb44a3 must also file-out the definition of sharedPools
Claus Gittinger <cg@exept.de>
parents: 2026
diff changeset
   664
            |pool|
6204fefb44a3 must also file-out the definition of sharedPools
Claus Gittinger <cg@exept.de>
parents: 2026
diff changeset
   665
6204fefb44a3 must also file-out the definition of sharedPools
Claus Gittinger <cg@exept.de>
parents: 2026
diff changeset
   666
            pool := Smalltalk at:eachPoolname.
6204fefb44a3 must also file-out the definition of sharedPools
Claus Gittinger <cg@exept.de>
parents: 2026
diff changeset
   667
            self 
6204fefb44a3 must also file-out the definition of sharedPools
Claus Gittinger <cg@exept.de>
parents: 2026
diff changeset
   668
                fileOutAllDefinitionsOf:pool 
6204fefb44a3 must also file-out the definition of sharedPools
Claus Gittinger <cg@exept.de>
parents: 2026
diff changeset
   669
                to:stream 
6204fefb44a3 must also file-out the definition of sharedPools
Claus Gittinger <cg@exept.de>
parents: 2026
diff changeset
   670
                rememberIn:definedClasses.
6204fefb44a3 must also file-out the definition of sharedPools
Claus Gittinger <cg@exept.de>
parents: 2026
diff changeset
   671
        ].
6204fefb44a3 must also file-out the definition of sharedPools
Claus Gittinger <cg@exept.de>
parents: 2026
diff changeset
   672
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   673
        self 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   674
            fileOutAllDefinitionsOf:theNonMetaclassToCompileFor 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   675
            to:stream 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   676
            rememberIn:definedClasses.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   677
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   678
        theNonMetaclassToCompileFor privateClassesSorted do:[:aPrivateClass |
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   679
            self 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   680
                fileOutAllDefinitionsOf:aPrivateClass 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   681
                to:stream 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   682
                rememberIn:definedClasses.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   683
        ].
2195
2996fe27c2f8 Add primitive functions when compiling
Stefan Vogel <sv@exept.de>
parents: 2185
diff changeset
   684
"/        theNonMetaclassToCompileFor fileOutPrimitiveDefinitionsOn:stream.
2026
652850012b15 remove dead code
Stefan Vogel <sv@exept.de>
parents: 1986
diff changeset
   685
"/ If a method uses a static primitive function... - but this doesn't work
2195
2996fe27c2f8 Add primitive functions when compiling
Stefan Vogel <sv@exept.de>
parents: 2185
diff changeset
   686
"/ Yes it does work, but primitive functions have to be strictly static!!
2996fe27c2f8 Add primitive functions when compiling
Stefan Vogel <sv@exept.de>
parents: 2185
diff changeset
   687
        theNonMetaclassToCompileFor fileOutPrimitiveSpecsOn:stream.
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   688
    ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   689
2026
652850012b15 remove dead code
Stefan Vogel <sv@exept.de>
parents: 1986
diff changeset
   690
"/    stream cr.
652850012b15 remove dead code
Stefan Vogel <sv@exept.de>
parents: 1986
diff changeset
   691
"/    stream nextPutLine:'"{ Package: ''' , package , ''' }"'.
652850012b15 remove dead code
Stefan Vogel <sv@exept.de>
parents: 1986
diff changeset
   692
"/    stream cr.
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   693
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   694
    stream nextPut:sep.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   695
    className := theNonMetaclassToCompileFor name.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   696
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   697
    stream nextPutAll:className.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   698
    classToCompileFor isMeta ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   699
        stream nextPutAll:' class'.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   700
    ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   701
    stream nextPutAll:' methodsFor:'''; nextPutAll:methodCategory; nextPutAll:''''.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   702
    stream nextPut:sep; cr.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   703
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   704
    stream nextPutLine:'"{ Line: 0 }"'; 
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   705
           nextChunkPut:aString;
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   706
           space; nextPut:sep.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   707
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   708
    stream close.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   709
2467
a7ed431694a2 changed: #generateSTSource:
Claus Gittinger <cg@exept.de>
parents: 2461
diff changeset
   710
    "Modified: / 18-01-2011 / 18:02:39 / cg"
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   711
!
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   712
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   713
reportCompilationError
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   714
    |eMsg errorMessages lNr|
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   715
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   716
    (executionStatus notNil and:[executionStatus couldNotExecute]) ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   717
        eMsg := 'oops, no STC - cannot create machine code'
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   718
    ] ifFalse:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   719
        errorMessages := 'errorOutput' asFilename contents.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   720
        OperatingSystem removeFile:'errorOutput'.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   721
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   722
        errorMessages notNil ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   723
            errorMessages := errorMessages reject:[:line | line includesString:'Warning:'].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   724
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   725
            errorMessages size > 20 ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   726
                errorMessages := errorMessages select:[:line | line asLowercase startsWith:'error'].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   727
                errorMessages size > 20 ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   728
                    errorMessages := (errorMessages copyTo:20) copyWith:'... more messages skipped'
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   729
                ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   730
            ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   731
"/                    errorMessages := errorMessages collect:[:line |
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   732
"/                        (line startsWith:(stFileName , ':')) ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   733
"/                            'Line: ' , (line copyFrom:(stFileName size + 2))
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   734
"/                        ] ifFalse:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   735
"/                            line
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   736
"/                        ]
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   737
"/                      ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   738
        ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   739
        errorMessages isNil ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   740
            errorMessages := #('')
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   741
        ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   742
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   743
        "/ try to extract a line number"
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   744
        (errorMessages contains:[:line | line includesString:'Borland']) ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   745
            |i i2 s|
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   746
            i := errorMessages findFirst:[:l | l startsWith:(cFileName,':')].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   747
            i ~~ 0 ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   748
                ((errorMessages at:i+1) startsWith:'Error') ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   749
                    i2 := (errorMessages at:i+1) indexOfSubCollection:(stFileName).
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   750
                    i2 ~~ 0 ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   751
                        s := (errorMessages at:i+1) copyFrom:(i2+stFileName size+1).
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   752
                        s := s readStream.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   753
                        lNr := Integer readFrom:s.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   754
                        s skipSeparators.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   755
                    ].    
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   756
                ]
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   757
            ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   758
        ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   759
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   760
        errorMessages isEmpty ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   761
            eMsg := 'Error during compilation:\\Unspecified error (no output)' withCRs
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   762
        ] ifFalse:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   763
            eMsg := 'Error during compilation:\\' withCRs ,
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   764
                    (errorMessages asStringCollection asString).
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   765
        ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   766
    ].
2461
89458faaeeb3 changed: #reportCompilationError
Stefan Vogel <sv@exept.de>
parents: 2350
diff changeset
   767
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   768
    originator activityNotification:''.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   769
2461
89458faaeeb3 changed: #reportCompilationError
Stefan Vogel <sv@exept.de>
parents: 2350
diff changeset
   770
    Parser::ParseError new
89458faaeeb3 changed: #reportCompilationError
Stefan Vogel <sv@exept.de>
parents: 2350
diff changeset
   771
        lineNumber:lNr;
89458faaeeb3 changed: #reportCompilationError
Stefan Vogel <sv@exept.de>
parents: 2350
diff changeset
   772
        errorMessage:eMsg;
89458faaeeb3 changed: #reportCompilationError
Stefan Vogel <sv@exept.de>
parents: 2350
diff changeset
   773
        raise.
89458faaeeb3 changed: #reportCompilationError
Stefan Vogel <sv@exept.de>
parents: 2350
diff changeset
   774
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   775
    "Created: / 07-11-2006 / 12:29:04 / cg"
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   776
!
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   777
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   778
setupCompilationCommandArguments
2335
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   779
    |stFn mapFileName libFileName def libDir incDir incDirArg defs incl opts|
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   780
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   781
    parserFlags isNil ifTrue:[ parserFlags := ParserFlags new].
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   782
1941
941810becd2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   783
    stFn := stFileName asFilename.
941810becd2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   784
    oFileName := stFn nameWithoutSuffix , (ObjectFileLoader objectFileExtension).
941810becd2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   785
    cFileName := (stFn withSuffix:'c') name. 
941810becd2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   786
    mapFileName := (stFn withSuffix:'map') name. 
941810becd2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   787
    libFileName := (stFn withSuffix:'lib') name. 
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   788
    oFileName asFilename delete.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   789
    cFileName asFilename delete.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   790
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   791
    "/ stcFlags := '-commonSymbols +sharedLibCode +newIncremental -E:errorOutput -N' , initName .
2335
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   792
    stcFlags := '+newIncremental -E:errorOutput'.
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   793
    initName notNil ifTrue:[
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   794
        stcFlags := stcFlags,' -N' , initName .
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   795
    ].
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   796
    cFlags := OperatingSystem getOSDefine.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   797
    cFlags isNil ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   798
        cFlags := ''
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   799
    ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   800
    (def := OperatingSystem getCPUDefine) notNil ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   801
        cFlags := cFlags , ' ' , def
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   802
    ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   803
2335
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   804
    (defs := parserFlags stcCompilationDefines) notNil ifTrue:[
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   805
        cFlags := cFlags , ' ' , defs
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   806
    ].
2335
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   807
    (incl := parserFlags stcCompilationIncludes) notNil ifTrue:[
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   808
        stcFlags := incl , ' ' , stcFlags.
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   809
        cFlags := cFlags , ' ' , incl.
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   810
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   811
        "/ if STX_LIBDIR is defined, and not in passed argument,
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   812
        "/ add it here.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   813
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   814
        libDir := OperatingSystem getEnvironment:'STX_LIBDIR'.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   815
        (libDir notNil and:[libDir asFilename exists]) ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   816
            incDir := libDir asFilename construct:'include'.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   817
            incDir exists ifTrue:[
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   818
                incDirArg := '-I' , incDir pathName.
2335
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   819
                (incl asCollectionOfWords includes:incDirArg) ifFalse:[
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   820
                    stcFlags := stcFlags , ' ' , incDirArg.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   821
                    cFlags := cFlags , ' ' , incDirArg.
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   822
                ]
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   823
            ]
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   824
        ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   825
    ].
2335
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   826
    (opts := parserFlags stcCompilationOptions) notNil ifTrue:[
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   827
        stcFlags := opts , ' ' , stcFlags
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   828
    ].
2335
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   829
    (opts := parserFlags ccCompilationOptions) notNil ifTrue:[
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   830
        cFlags := cFlags , ' ' , opts
1939
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   831
    ].
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   832
babab41fc8e8 code cleanup
Claus Gittinger <cg@exept.de>
parents: 1899
diff changeset
   833
    "Created: / 07-11-2006 / 12:24:47 / cg"
1941
941810becd2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1939
diff changeset
   834
    "Modified: / 07-11-2006 / 13:58:54 / cg"
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   835
! !
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   836
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   837
!STCCompilerInterface class methodsFor:'documentation'!
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   838
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   839
version
2644
51666ff4ec9f changed: #compileToObj
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
   840
    ^ '$Header: /cvs/stx/stx/libcomp/STCCompilerInterface.st,v 1.20 2011-08-08 21:03:12 cg Exp $'
2335
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   841
!
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   842
70a690b780f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   843
version_CVS
2644
51666ff4ec9f changed: #compileToObj
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
   844
    ^ '$Header: /cvs/stx/stx/libcomp/STCCompilerInterface.st,v 1.20 2011-08-08 21:03:12 cg Exp $'
1669
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   845
! !
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   846
fc13f4636125 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   847
STCCompilerInterface initialize!