author | Claus Gittinger <cg@exept.de> |
Thu, 16 Jan 1997 16:30:20 +0100 | |
changeset 197 | 0c288e422494 |
parent 195 | 1cf850844da9 |
child 201 | 428fa2aee65f |
permissions | -rw-r--r-- |
25 | 1 |
"/ |
2 |
"/ $Header$ |
|
86 | 3 |
"/ |
25 | 4 |
"/ startup configuration for smalltalk |
5 |
"/ |
|
6 |
"/ - everything in here are plain smalltalk expressions; |
|
7 |
"/ - statements with in a group are separated by a period. |
|
8 |
"/ - Each group of statements has to be delimited by an exclamation |
|
9 |
"/ character. |
|
10 |
"/ - avoid exclas in comments (or double them) |
|
11 |
"/ - nested comments are not allowed - take care. |
|
12 |
"/ |
|
13 |
"/ remember: this is fileOut-format |
|
14 |
"/ |
|
15 |
"/ comments can be either: |
|
16 |
"/ - standard smalltalk comments (i.e. from dquote to dquote) |
|
17 |
"/ - ST/X end of line comments (i.e. dquote followed by /) |
|
18 |
"/ |
|
19 |
"/ "this is a comment" |
|
20 |
"/ "/ another comment |
|
21 |
"/ |
|
22 |
"/*************************************************************** |
|
23 |
"/ PLEASE: only add things here, if they are of general interrest |
|
24 |
"/ and NEITHER site specific NOT display specific. |
|
25 |
"/ |
|
26 |
"/ site specific things are to be added to "h_<hostname>.rc" |
|
27 |
"/ display specifics to "d_<displayName>.rc" |
|
28 |
"/ and private user stuff in "private.rc" |
|
29 |
"/*************************************************************** |
|
0 | 30 |
|
25 | 31 |
"/ |
53
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
32 |
"/ allow definition of the systemPath from an environment variable |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
33 |
"/ for example, to only try files in a users home and /usr/local/lib/smalltalk, |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
34 |
"/ add the following in your shell-profile: |
86 | 35 |
"/ export STX_SYSTEMPATH=$HOME:/usr/local/lib/smalltalk |
53
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
36 |
"/ notice, that shell variable names are NOT expanded again in STX_SYSTEMPATH |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
37 |
"/ Make certain that all relevant files are found along your path - you may see |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
38 |
"/ funny viewStyles, colors and stupid strings if wrong. |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
39 |
"/ |
197 | 40 |
|
53
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
41 |
|path| |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
42 |
(path := OperatingSystem getEnvironment:'STX_SYSTEMPATH') notNil ifTrue:[ |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
43 |
Smalltalk systemPath:(path asCollectionOfSubstringsSeparatedBy:$:) |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
44 |
]. |
86 | 45 |
! |
46 |
||
47 |
|args| |
|
48 |
||
49 |
args := Smalltalk commandLineArguments. |
|
126 | 50 |
((args size > 0) and:[args last = '--buildClasses']) ifTrue:[ |
86 | 51 |
'binary' asFilename isDirectory ifFalse:[ |
195 | 52 |
'smalltalk.rc [warning]: no binary directory for classes.' errorPrintCR. |
86 | 53 |
] ifTrue:[ |
54 |
"/ |
|
55 |
"/ load all lazy classes |
|
56 |
"/ |
|
57 |
Autoload subclasses do:[:aClass | |
|
58 |
Autoload autoloadFailedSignal handle:[:ex | |
|
195 | 59 |
'smalltalk.rc [warning]: autoload failed' errorPrintCR. |
86 | 60 |
ex return. |
61 |
] do:[ |
|
195 | 62 |
'smalltalk.rc [info]: loading ' infoPrint. aClass name infoPrint. ' ...' infoPrintCR. |
86 | 63 |
aClass autoload. |
64 |
] |
|
65 |
]. |
|
66 |
||
67 |
"/ |
|
68 |
"/ binary save all classes |
|
69 |
"/ |
|
70 |
Autoload loadedClasses do:[:cls | |
|
195 | 71 |
'smalltalk.rc [info]: saving binary of ' infoPrint. cls name infoPrint. ' ...' infoPrintCR. |
86 | 72 |
cls binaryFileOut. |
73 |
OperatingSystem executeCommand:'mv *.cls binary'. |
|
74 |
] |
|
75 |
]. |
|
76 |
Smalltalk exit |
|
77 |
]. |
|
78 |
! |
|
53
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
79 |
|
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
80 |
"/ |
25 | 81 |
"/ map Language variable setting to known and handled |
82 |
"/ values: |
|
53
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
83 |
"/ |
25 | 84 |
Language == #De ifTrue:[ |
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
85 |
Language := #german |
25 | 86 |
]. |
87 |
! |
|
8 | 88 |
|
25 | 89 |
"/ |
90 |
"/ just a quick check, if this ST/X installation seems to |
|
91 |
"/ be halfway complete (it happened to some people, that |
|
41 | 92 |
"/ their source/resource directories were not installed) |
25 | 93 |
"/ - better to warn early ... |
94 |
"/ |
|
5 | 95 |
|anyWrong missing| |
96 |
anyWrong := false. |
|
97 |
missing := ''. |
|
98 |
(Smalltalk getSystemFileName:'resources/SBrowser.rs') isNil ifTrue:[ |
|
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
99 |
'***********************************************************************' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
100 |
'***** ATTENTION: please check installation of your resource files' errorPrintCR. |
5 | 101 |
anyWrong := true. |
102 |
missing := '''resources'' '. |
|
103 |
]. |
|
104 |
(Smalltalk getSystemFileName:'source/Object.st') isNil ifTrue:[ |
|
42 | 105 |
"/ |
106 |
"/ there may still be a SourceCodeManager ... |
|
107 |
"/ |
|
108 |
SourceCodeManager isNil ifTrue:[ |
|
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
109 |
'***********************************************************************' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
110 |
'***** ATTENTION: please check installation of your source files' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
111 |
'***** ' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
112 |
'***** the browser/debugger may not be able to show sourcecode.' errorPrintCR. |
42 | 113 |
anyWrong := true. |
114 |
missing := missing , '''source'' '. |
|
115 |
] |
|
5 | 116 |
]. |
117 |
(Smalltalk getSystemFileName:'bitmaps/SBrowser.xbm') isNil ifTrue:[ |
|
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
118 |
'***********************************************************************' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
119 |
'***** ATTENTION: please check installation of your bitmap files' errorPrintCR. |
5 | 120 |
anyWrong := true. |
121 |
missing := missing , '''bitmaps'' '. |
|
122 |
]. |
|
7 | 123 |
(Smalltalk getSystemFileName:'resources/normal.style') isNil ifTrue:[ |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
124 |
'***********************************************************************' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
125 |
'***** ATTENTION: please check installation of your style files' errorPrintCR. |
7 | 126 |
anyWrong := true. |
127 |
missing := missing , '''resources'' '. |
|
128 |
]. |
|
129 |
||
5 | 130 |
anyWrong ifTrue:[ |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
131 |
'*****' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
132 |
'***** directory(s) named: ' errorPrint. missing errorPrint. 'incomplete/not existing' errorPrintCR. |
5 | 133 |
'***** your path is: ' errorPrint. |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
134 |
Smalltalk systemPath asArray storeString errorPrintCR. |
16 | 135 |
|
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
136 |
'*****' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
137 |
'***** Try: "make source bitmaps resources styles"' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
138 |
'***** or: "make symlinks" to fix this.' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
139 |
'***********************************************************************' errorPrintCR. |
5 | 140 |
] |
141 |
! |
|
142 |
||
25 | 143 |
"/ |
144 |
"/ check for display-classes being compiled into the system; |
|
145 |
"/ (and if display connection can be established) |
|
146 |
"/ if not, enter a simple read-eval-print loop |
|
147 |
"/ |
|
0 | 148 |
Display isNil ifTrue:[ |
5 | 149 |
DeviceWorkstation notNil ifTrue:[ |
195 | 150 |
'smalltalk.rc [warning]: No Display connection.' errorPrintCR. |
197 | 151 |
'smalltalk.rc [info]: Either set the DISPLAY environment variable,' infoPrintCR. |
152 |
'smalltalk.rc [info]: or start smalltalk with a -display argument.' infoPrintCR. |
|
5 | 153 |
] ifFalse:[ |
195 | 154 |
'smalltalk.rc [warning]: Configuration without display.' errorPrintCR. |
5 | 155 |
]. |
133 | 156 |
'' errorPrintCR. |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
157 |
'Textmode (enter smalltalk expressions terminated by single exclamation mark' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
158 |
' CTRL-D to leave line-by-line interpreter.)' errorPrintCR. |
0 | 159 |
Smalltalk readEvalPrint. |
160 |
Smalltalk exit |
|
10 | 161 |
]. |
0 | 162 |
|
25 | 163 |
"/ |
164 |
"/ this makes X-errors be handled immediately (so you see, |
|
165 |
"/ where it occured) but slows down the system soooo muuuucccchhh .. |
|
166 |
"/ if commented out, errors will be reported asynchronously. |
|
167 |
"/ (I enable this, when things go bad during startup) |
|
168 |
"/ |
|
10 | 169 |
"/ Display unBuffered. |
0 | 170 |
|
25 | 171 |
"/ |
172 |
"/ this starts the incremental GC earlier |
|
173 |
"/ (default is 500000) |
|
174 |
"/ the number given is the number of bytes which have to be allocated |
|
175 |
"/ since the last GC, to start the incremental GC running. |
|
176 |
"/ (see ObjectMemory>>documentation) |
|
177 |
"/ Claus: I moved this to the private.rc file |
|
178 |
"/ |
|
10 | 179 |
"/ ObjectMemory incrementalGCLimit:100000. |
0 | 180 |
|
25 | 181 |
"/ |
182 |
"/ this starts the incremental GC when freeSpace drops below a limit |
|
183 |
"/ (default is nil - i.e. dont look at freeSpace) |
|
184 |
"/ (see ObjectMemory>>documentation) |
|
185 |
"/ Claus: I moved this to the private.rc file |
|
186 |
"/ |
|
16 | 187 |
"/ ObjectMemory freeSpaceGCLimit:300000. |
188 |
||
25 | 189 |
"/ |
190 |
"/ lazy loading |
|
191 |
"/ (faster fileIn) - this is EXPERIMENTAL. |
|
169 | 192 |
"/ |
193 |
"/ - if turned on, an autoload operation will only create methodStubs |
|
194 |
"/ (uncompiled) which trap when called the first time. |
|
195 |
"/ The bytecode compiler will compile them when first executen. |
|
196 |
"/ |
|
197 |
"/ - if turned off, an autoload will load & compile the while class, |
|
198 |
"/ which makes autoloading slower, but avoids the initial delays |
|
199 |
"/ |
|
200 |
"/ This is much like just-in-time compilation, but on a higher level. |
|
25 | 201 |
"/ If there are any problems with lazy methods, disable the following |
152 | 202 |
"/ and let me (cg@exept.ssw.de) know what happened. |
25 | 203 |
"/ |
10 | 204 |
Autoload compileLazy:true. |
5 | 205 |
|
25 | 206 |
"/ |
207 |
"/ define the language (you can also set the LANG-shell variable) |
|
169 | 208 |
"/ (currently #english, #german and #french are supported). |
209 |
"/ some fragments for other languages (japanese ;-) exist. |
|
152 | 210 |
"/ Setting it here will override the LANG variable setting, |
25 | 211 |
"/ if neither set here nor in LANG, #english is the default. |
169 | 212 |
"/ see (and enhance) the resource files |
25 | 213 |
"/ Claus: supposed to be done in private.rc or via LANG variable |
214 |
"/ |
|
10 | 215 |
"/ Smalltalk language:#german. |
216 |
"/ Smalltalk language:#english. |
|
0 | 217 |
|
25 | 218 |
"/ |
219 |
"/ this handles all variant display stuff |
|
220 |
"/ (i.e. things which might change, when DISPLAY is set different) |
|
221 |
"/ |
|
195 | 222 |
"/ 'smalltalk.rc [info]: reading ''display.rc'' ...' infoPrintCR. |
10 | 223 |
Smalltalk fileIn:'display.rc'. |
0 | 224 |
|
25 | 225 |
"/ |
226 |
"/ this defines stuff relating to the host we are running on |
|
227 |
"/ |
|
195 | 228 |
"/ 'smalltalk.rc [info]: reading ''host.rc'' ...' infoPrintCR. |
10 | 229 |
Smalltalk fileIn:'host.rc'. |
0 | 230 |
|
25 | 231 |
"/ |
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
232 |
"/ Ask user to accept Licence. |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
233 |
"/ exit, if rejected. |
152 | 234 |
"/ You may find this annoying - but lawers say: "this is a must ..." ;-) |
235 |
"/ (it will not be shown when coming up via a snapshot image) |
|
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
236 |
"/ |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
237 |
Smalltalk addStartBlock:[ |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
238 |
LicenceBox autoload. |
169 | 239 |
|
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
240 |
LicenceBox licenceRejectSignal handle:[:ex| |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
241 |
Smalltalk exit |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
242 |
] do:[ |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
243 |
LicenceBox open. |
144 | 244 |
Smalltalk at:#LicenceBox put:nil. |
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
245 |
]. |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
246 |
]. |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
247 |
|
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
248 |
"/ |
41 | 249 |
"/ read private (per user) stuff |
25 | 250 |
"/ |
195 | 251 |
'smalltalk.rc [info]: reading ''private.rc'' ...' infoPrintCR. |
10 | 252 |
Smalltalk fileIn:'private.rc'. |
5 | 253 |
|
25 | 254 |
"/ |
169 | 255 |
"/ read saved configuration settings (if any) |
256 |
"/ |
|
195 | 257 |
"/ 'smalltalk.rc [info]: reading ''settings.stx'' ...' infoPrintCR. |
169 | 258 |
Smalltalk fileIn:'settings.stx'. |
259 |
||
260 |
"/ |
|
261 |
"/ set the package to some useful default |
|
262 |
"/ |
|
263 |
Project notNil ifTrue:[ |
|
264 |
Project setDefaultProject. |
|
265 |
Project current packageName:#'private'. |
|
266 |
]. |
|
267 |
||
268 |
"/ |
|
152 | 269 |
"/ if error occurs, and debugger has problems coming up, |
270 |
"/ uncomment the following ... |
|
25 | 271 |
"/ |
10 | 272 |
"/ Debugger := MiniDebugger. |
0 | 273 |
|
152 | 274 |
"/ |
275 |
"/ save an initial image; this will speedup the next startup |
|
276 |
"/ (since all autoload-stuff will already be initialized) |
|
277 |
"/ |
|
153 | 278 |
|
279 |
"/'st.img' asFilename exists ifFalse:[ |
|
195 | 280 |
"/ 'smalltalk.rc [info]: saving initial image for faster future startup ...' infoPrintCR. |
281 |
"/ Smalltalk addStartBlock:[ |
|
282 |
"/ ObjectMemory primSnapShotOn:'st.img' |
|
283 |
"/ ] |
|
153 | 284 |
"/]. |
86 | 285 |
! |