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