author | Claus Gittinger <cg@exept.de> |
Fri, 18 Apr 1997 18:40:36 +0200 | |
changeset 208 | 368a56100ffe |
parent 202 | a1cae27e4641 |
child 209 | 22793de5d56e |
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 |
"/ |
|
208 | 108 |
(Smalltalk at:#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. |
202 | 157 |
'Textmode (enter smalltalk expressions terminated by single exclamation mark;' errorPrintCR. |
158 |
OperatingSystem isUNIXlike ifTrue:[ |
|
201 | 159 |
' CTRL-D to leave line-by-line interpreter.)' errorPrintCR. |
160 |
] ifFalse:[ |
|
161 |
' CTRL-Z to leave line-by-line interpreter.)' errorPrintCR. |
|
162 |
]. |
|
0 | 163 |
Smalltalk readEvalPrint. |
164 |
Smalltalk exit |
|
10 | 165 |
]. |
0 | 166 |
|
25 | 167 |
"/ |
168 |
"/ this makes X-errors be handled immediately (so you see, |
|
169 |
"/ where it occured) but slows down the system soooo muuuucccchhh .. |
|
170 |
"/ if commented out, errors will be reported asynchronously. |
|
171 |
"/ (I enable this, when things go bad during startup) |
|
172 |
"/ |
|
10 | 173 |
"/ Display unBuffered. |
0 | 174 |
|
25 | 175 |
"/ |
176 |
"/ this starts the incremental GC earlier |
|
177 |
"/ (default is 500000) |
|
178 |
"/ the number given is the number of bytes which have to be allocated |
|
179 |
"/ since the last GC, to start the incremental GC running. |
|
180 |
"/ (see ObjectMemory>>documentation) |
|
181 |
"/ Claus: I moved this to the private.rc file |
|
182 |
"/ |
|
10 | 183 |
"/ ObjectMemory incrementalGCLimit:100000. |
0 | 184 |
|
25 | 185 |
"/ |
186 |
"/ this starts the incremental GC when freeSpace drops below a limit |
|
187 |
"/ (default is nil - i.e. dont look at freeSpace) |
|
188 |
"/ (see ObjectMemory>>documentation) |
|
189 |
"/ Claus: I moved this to the private.rc file |
|
190 |
"/ |
|
16 | 191 |
"/ ObjectMemory freeSpaceGCLimit:300000. |
192 |
||
25 | 193 |
"/ |
194 |
"/ lazy loading |
|
195 |
"/ (faster fileIn) - this is EXPERIMENTAL. |
|
169 | 196 |
"/ |
197 |
"/ - if turned on, an autoload operation will only create methodStubs |
|
198 |
"/ (uncompiled) which trap when called the first time. |
|
199 |
"/ The bytecode compiler will compile them when first executen. |
|
200 |
"/ |
|
201 |
"/ - if turned off, an autoload will load & compile the while class, |
|
202 |
"/ which makes autoloading slower, but avoids the initial delays |
|
203 |
"/ |
|
204 |
"/ This is much like just-in-time compilation, but on a higher level. |
|
25 | 205 |
"/ If there are any problems with lazy methods, disable the following |
152 | 206 |
"/ and let me (cg@exept.ssw.de) know what happened. |
25 | 207 |
"/ |
10 | 208 |
Autoload compileLazy:true. |
5 | 209 |
|
25 | 210 |
"/ |
211 |
"/ define the language (you can also set the LANG-shell variable) |
|
169 | 212 |
"/ (currently #english, #german and #french are supported). |
213 |
"/ some fragments for other languages (japanese ;-) exist. |
|
152 | 214 |
"/ Setting it here will override the LANG variable setting, |
25 | 215 |
"/ if neither set here nor in LANG, #english is the default. |
169 | 216 |
"/ see (and enhance) the resource files |
25 | 217 |
"/ Claus: supposed to be done in private.rc or via LANG variable |
218 |
"/ |
|
10 | 219 |
"/ Smalltalk language:#german. |
220 |
"/ Smalltalk language:#english. |
|
0 | 221 |
|
25 | 222 |
"/ |
223 |
"/ this handles all variant display stuff |
|
224 |
"/ (i.e. things which might change, when DISPLAY is set different) |
|
225 |
"/ |
|
195 | 226 |
"/ 'smalltalk.rc [info]: reading ''display.rc'' ...' infoPrintCR. |
10 | 227 |
Smalltalk fileIn:'display.rc'. |
0 | 228 |
|
25 | 229 |
"/ |
230 |
"/ this defines stuff relating to the host we are running on |
|
231 |
"/ |
|
195 | 232 |
"/ 'smalltalk.rc [info]: reading ''host.rc'' ...' infoPrintCR. |
10 | 233 |
Smalltalk fileIn:'host.rc'. |
0 | 234 |
|
25 | 235 |
"/ |
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
236 |
"/ Ask user to accept Licence. |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
237 |
"/ exit, if rejected. |
152 | 238 |
"/ You may find this annoying - but lawers say: "this is a must ..." ;-) |
239 |
"/ (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
|
240 |
"/ |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
241 |
Smalltalk addStartBlock:[ |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
242 |
LicenceBox autoload. |
169 | 243 |
|
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
244 |
LicenceBox licenceRejectSignal handle:[:ex| |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
245 |
Smalltalk exit |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
246 |
] do:[ |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
247 |
LicenceBox open. |
144 | 248 |
Smalltalk at:#LicenceBox put:nil. |
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
249 |
]. |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
250 |
]. |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
251 |
|
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
252 |
"/ |
41 | 253 |
"/ read private (per user) stuff |
25 | 254 |
"/ |
195 | 255 |
'smalltalk.rc [info]: reading ''private.rc'' ...' infoPrintCR. |
10 | 256 |
Smalltalk fileIn:'private.rc'. |
5 | 257 |
|
25 | 258 |
"/ |
169 | 259 |
"/ read saved configuration settings (if any) |
260 |
"/ |
|
195 | 261 |
"/ 'smalltalk.rc [info]: reading ''settings.stx'' ...' infoPrintCR. |
169 | 262 |
Smalltalk fileIn:'settings.stx'. |
263 |
||
264 |
"/ |
|
265 |
"/ set the package to some useful default |
|
266 |
"/ |
|
267 |
Project notNil ifTrue:[ |
|
268 |
Project setDefaultProject. |
|
269 |
Project current packageName:#'private'. |
|
270 |
]. |
|
271 |
||
272 |
"/ |
|
152 | 273 |
"/ if error occurs, and debugger has problems coming up, |
274 |
"/ uncomment the following ... |
|
25 | 275 |
"/ |
10 | 276 |
"/ Debugger := MiniDebugger. |
0 | 277 |
|
152 | 278 |
"/ |
279 |
"/ save an initial image; this will speedup the next startup |
|
280 |
"/ (since all autoload-stuff will already be initialized) |
|
281 |
"/ |
|
153 | 282 |
|
283 |
"/'st.img' asFilename exists ifFalse:[ |
|
195 | 284 |
"/ 'smalltalk.rc [info]: saving initial image for faster future startup ...' infoPrintCR. |
285 |
"/ Smalltalk addStartBlock:[ |
|
286 |
"/ ObjectMemory primSnapShotOn:'st.img' |
|
287 |
"/ ] |
|
153 | 288 |
"/]. |
86 | 289 |
! |