author | Claus Gittinger <cg@exept.de> |
Tue, 16 Sep 1997 06:01:00 +0200 | |
changeset 251 | 23ff5629ff8d |
parent 250 | 2d66cd491981 |
child 271 | b0e7b423063c |
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:[ |
|
42 | 108 |
"/ |
109 |
"/ there may still be a SourceCodeManager ... |
|
110 |
"/ |
|
208 | 111 |
(Smalltalk at:#SourceCodeManager) isNil ifTrue:[ |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
112 |
'***********************************************************************' errorPrintCR. |
251 | 113 |
'***** 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
|
114 |
'***** ' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
115 |
'***** the browser/debugger may not be able to show sourcecode.' errorPrintCR. |
251 | 116 |
'***** Also, autoloading may fail if sourceFiles are missing.' errorPrintCR. |
42 | 117 |
anyWrong := true. |
118 |
missing := missing , '''source'' '. |
|
119 |
] |
|
5 | 120 |
]. |
121 |
(Smalltalk getSystemFileName:'bitmaps/SBrowser.xbm') isNil ifTrue:[ |
|
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
122 |
'***********************************************************************' errorPrintCR. |
251 | 123 |
'***** ATTENTION: please check installation of your >>bitmap<< files' errorPrintCR. |
5 | 124 |
anyWrong := true. |
125 |
missing := missing , '''bitmaps'' '. |
|
126 |
]. |
|
7 | 127 |
(Smalltalk getSystemFileName:'resources/normal.style') isNil ifTrue:[ |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
128 |
'***********************************************************************' errorPrintCR. |
251 | 129 |
'***** ATTENTION: please check installation of your >>style<< files' errorPrintCR. |
250 | 130 |
'***** I will use a plain b&w viewStyle as a fallBack' errorPrintCR. |
7 | 131 |
anyWrong := true. |
132 |
missing := missing , '''resources'' '. |
|
133 |
]. |
|
134 |
||
5 | 135 |
anyWrong ifTrue:[ |
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 |
'***** directory(s) named: ' errorPrint. missing errorPrint. 'incomplete/not existing' errorPrintCR. |
251 | 138 |
'***** I could not find the missing directory along your path,' errorPrintCR. |
139 |
'***** which is:' errorPrintCR. |
|
140 |
Smalltalk systemPath do:[:dir | |
|
141 |
('***** ' , dir storeString) errorPrintCR. |
|
142 |
]. |
|
16 | 143 |
|
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
144 |
'*****' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
145 |
'***** Try: "make source bitmaps resources styles"' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
146 |
'***** or: "make symlinks" to fix this.' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
147 |
'***********************************************************************' errorPrintCR. |
5 | 148 |
] |
149 |
! |
|
150 |
||
25 | 151 |
"/ |
152 |
"/ check for display-classes being compiled into the system; |
|
153 |
"/ (and if display connection can be established) |
|
154 |
"/ if not, enter a simple read-eval-print loop |
|
155 |
"/ |
|
0 | 156 |
Display isNil ifTrue:[ |
5 | 157 |
DeviceWorkstation notNil ifTrue:[ |
195 | 158 |
'smalltalk.rc [warning]: No Display connection.' errorPrintCR. |
197 | 159 |
'smalltalk.rc [info]: Either set the DISPLAY environment variable,' infoPrintCR. |
160 |
'smalltalk.rc [info]: or start smalltalk with a -display argument.' infoPrintCR. |
|
5 | 161 |
] ifFalse:[ |
195 | 162 |
'smalltalk.rc [warning]: Configuration without display.' errorPrintCR. |
5 | 163 |
]. |
133 | 164 |
'' errorPrintCR. |
202 | 165 |
'Textmode (enter smalltalk expressions terminated by single exclamation mark;' errorPrintCR. |
166 |
OperatingSystem isUNIXlike ifTrue:[ |
|
209 | 167 |
' CTRL-D to leave line-by-line interpreter.)' errorPrintCR. |
201 | 168 |
] ifFalse:[ |
209 | 169 |
' CTRL-Z to leave line-by-line interpreter.)' errorPrintCR. |
201 | 170 |
]. |
0 | 171 |
Smalltalk readEvalPrint. |
172 |
Smalltalk exit |
|
10 | 173 |
]. |
0 | 174 |
|
25 | 175 |
"/ |
176 |
"/ this makes X-errors be handled immediately (so you see, |
|
177 |
"/ where it occured) but slows down the system soooo muuuucccchhh .. |
|
178 |
"/ if commented out, errors will be reported asynchronously. |
|
179 |
"/ (I enable this, when things go bad during startup) |
|
180 |
"/ |
|
10 | 181 |
"/ Display unBuffered. |
0 | 182 |
|
25 | 183 |
"/ |
184 |
"/ this starts the incremental GC earlier |
|
185 |
"/ (default is 500000) |
|
186 |
"/ the number given is the number of bytes which have to be allocated |
|
187 |
"/ since the last GC, to start the incremental GC running. |
|
188 |
"/ (see ObjectMemory>>documentation) |
|
189 |
"/ Claus: I moved this to the private.rc file |
|
190 |
"/ |
|
10 | 191 |
"/ ObjectMemory incrementalGCLimit:100000. |
0 | 192 |
|
25 | 193 |
"/ |
194 |
"/ this starts the incremental GC when freeSpace drops below a limit |
|
195 |
"/ (default is nil - i.e. dont look at freeSpace) |
|
196 |
"/ (see ObjectMemory>>documentation) |
|
197 |
"/ Claus: I moved this to the private.rc file |
|
198 |
"/ |
|
16 | 199 |
"/ ObjectMemory freeSpaceGCLimit:300000. |
200 |
||
25 | 201 |
"/ |
202 |
"/ lazy loading |
|
203 |
"/ (faster fileIn) - this is EXPERIMENTAL. |
|
169 | 204 |
"/ |
205 |
"/ - if turned on, an autoload operation will only create methodStubs |
|
206 |
"/ (uncompiled) which trap when called the first time. |
|
207 |
"/ The bytecode compiler will compile them when first executen. |
|
208 |
"/ |
|
209 |
"/ - if turned off, an autoload will load & compile the while class, |
|
210 |
"/ which makes autoloading slower, but avoids the initial delays |
|
211 |
"/ |
|
212 |
"/ This is much like just-in-time compilation, but on a higher level. |
|
25 | 213 |
"/ If there are any problems with lazy methods, disable the following |
152 | 214 |
"/ and let me (cg@exept.ssw.de) know what happened. |
25 | 215 |
"/ |
223 | 216 |
Autoload compileLazy:true. |
5 | 217 |
|
25 | 218 |
"/ |
219 |
"/ define the language (you can also set the LANG-shell variable) |
|
169 | 220 |
"/ (currently #english, #german and #french are supported). |
221 |
"/ some fragments for other languages (japanese ;-) exist. |
|
152 | 222 |
"/ Setting it here will override the LANG variable setting, |
25 | 223 |
"/ if neither set here nor in LANG, #english is the default. |
169 | 224 |
"/ see (and enhance) the resource files |
25 | 225 |
"/ Claus: supposed to be done in private.rc or via LANG variable |
226 |
"/ |
|
10 | 227 |
"/ Smalltalk language:#german. |
228 |
"/ Smalltalk language:#english. |
|
0 | 229 |
|
25 | 230 |
"/ |
231 |
"/ this handles all variant display stuff |
|
232 |
"/ (i.e. things which might change, when DISPLAY is set different) |
|
233 |
"/ |
|
195 | 234 |
"/ 'smalltalk.rc [info]: reading ''display.rc'' ...' infoPrintCR. |
10 | 235 |
Smalltalk fileIn:'display.rc'. |
0 | 236 |
|
25 | 237 |
"/ |
238 |
"/ this defines stuff relating to the host we are running on |
|
239 |
"/ |
|
195 | 240 |
"/ 'smalltalk.rc [info]: reading ''host.rc'' ...' infoPrintCR. |
10 | 241 |
Smalltalk fileIn:'host.rc'. |
0 | 242 |
|
25 | 243 |
"/ |
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
244 |
"/ Ask user to accept Licence. |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
245 |
"/ exit, if rejected. |
152 | 246 |
"/ You may find this annoying - but lawers say: "this is a must ..." ;-) |
247 |
"/ (it will not be shown when coming up via a snapshot image) |
|
220 | 248 |
|
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
249 |
Smalltalk addStartBlock:[ |
250 | 250 |
'smalltalk.rc [info]: show licence conditions ...' infoPrintCR. |
251 |
||
220 | 252 |
"/ MessageTally spyOn:[ |
253 |
"/ Class withoutUpdatingChangesDo:[ |
|
254 |
"/ 'patches [info]: installing autoloaded classes ...' infoPrintCR. |
|
255 |
"/ Smalltalk installAutoloadedClassesFrom:'include/abbrev.stc'. |
|
256 |
"/ ]. |
|
257 |
"/ ]. |
|
258 |
||
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
259 |
LicenceBox autoload. |
169 | 260 |
|
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
261 |
LicenceBox licenceRejectSignal handle:[:ex| |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
262 |
Smalltalk exit |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
263 |
] do:[ |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
264 |
LicenceBox open. |
144 | 265 |
Smalltalk at:#LicenceBox put:nil. |
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
266 |
]. |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
267 |
]. |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
268 |
|
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
269 |
"/ |
41 | 270 |
"/ read private (per user) stuff |
25 | 271 |
"/ |
195 | 272 |
'smalltalk.rc [info]: reading ''private.rc'' ...' infoPrintCR. |
10 | 273 |
Smalltalk fileIn:'private.rc'. |
5 | 274 |
|
25 | 275 |
"/ |
169 | 276 |
"/ read saved configuration settings (if any) |
277 |
"/ |
|
195 | 278 |
"/ 'smalltalk.rc [info]: reading ''settings.stx'' ...' infoPrintCR. |
169 | 279 |
Smalltalk fileIn:'settings.stx'. |
280 |
||
281 |
"/ |
|
282 |
"/ set the package to some useful default |
|
283 |
"/ |
|
284 |
Project notNil ifTrue:[ |
|
285 |
Project setDefaultProject. |
|
286 |
Project current packageName:#'private'. |
|
287 |
]. |
|
288 |
||
289 |
"/ |
|
152 | 290 |
"/ if error occurs, and debugger has problems coming up, |
291 |
"/ uncomment the following ... |
|
25 | 292 |
"/ |
10 | 293 |
"/ Debugger := MiniDebugger. |
0 | 294 |
|
152 | 295 |
"/ |
296 |
"/ save an initial image; this will speedup the next startup |
|
297 |
"/ (since all autoload-stuff will already be initialized) |
|
298 |
"/ |
|
153 | 299 |
|
226 | 300 |
"/ 'st.img' asFilename exists ifFalse:[ |
301 |
"/ |doneWithStartupStuff| |
|
302 |
"/ |
|
303 |
"/ doneWithStartupStuff := Semaphore new. |
|
304 |
"/ |
|
305 |
"/ Smalltalk addStartBlock:[ |
|
250 | 306 |
"/ [ |
307 |
"/ doneWithStartupStuff wait. |
|
226 | 308 |
"/ 'smalltalk.rc [info]: saving initial image for faster future startup ...' infoPrintCR. |
309 |
"/ ObjectMemory primSnapShotOn:'st.img' |
|
250 | 310 |
"/ ] forkAt:1 |
226 | 311 |
"/ ]. |
312 |
"/ |
|
313 |
"/ Smalltalk addStartBlock:[ |
|
250 | 314 |
"/ [ |
315 |
"/ Delay waitForSeconds:10. |
|
316 |
"/ doneWithStartupStuff signal |
|
317 |
"/ ] forkAt:1 |
|
226 | 318 |
"/ ]. |
319 |
"/ ]. |
|
86 | 320 |
! |