author | Claus Gittinger <cg@exept.de> |
Mon, 15 Jul 1996 17:07:08 +0200 | |
changeset 123 | a974136fe017 |
parent 121 | 0974ee733cf4 |
child 126 | 565643e43074 |
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 |
"/ |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
40 |
|path| |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
41 |
(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
|
42 |
Smalltalk systemPath:(path asCollectionOfSubstringsSeparatedBy:$:) |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
43 |
]. |
86 | 44 |
! |
45 |
||
46 |
|args| |
|
47 |
||
48 |
args := Smalltalk commandLineArguments. |
|
49 |
args last = '--buildClasses' ifTrue:[ |
|
50 |
'binary' asFilename isDirectory ifFalse:[ |
|
51 |
'no binary directory for classes.' printNL. |
|
52 |
] ifTrue:[ |
|
53 |
"/ |
|
54 |
"/ load all lazy classes |
|
55 |
"/ |
|
56 |
Autoload subclasses do:[:aClass | |
|
57 |
Autoload autoloadFailedSignal handle:[:ex | |
|
58 |
'autoload failed' printNL. |
|
59 |
ex return. |
|
60 |
] do:[ |
|
61 |
'loading ' print. aClass name print. ' ...' printNL. |
|
62 |
aClass autoload. |
|
63 |
] |
|
64 |
]. |
|
65 |
||
66 |
"/ |
|
67 |
"/ binary save all classes |
|
68 |
"/ |
|
69 |
Autoload loadedClasses do:[:cls | |
|
70 |
'saving binary of ' print. cls name print. ' ...' printNL. |
|
71 |
cls binaryFileOut. |
|
72 |
OperatingSystem executeCommand:'mv *.cls binary'. |
|
73 |
] |
|
74 |
]. |
|
75 |
Smalltalk exit |
|
76 |
]. |
|
77 |
! |
|
53
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
78 |
|
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
79 |
"/ |
25 | 80 |
"/ map Language variable setting to known and handled |
81 |
"/ values: |
|
53
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
82 |
"/ |
25 | 83 |
Language == #De ifTrue:[ |
84 |
Language := #german |
|
85 |
]. |
|
86 |
! |
|
8 | 87 |
|
25 | 88 |
"/ |
89 |
"/ just a quick check, if this ST/X installation seems to |
|
90 |
"/ be halfway complete (it happened to some people, that |
|
41 | 91 |
"/ their source/resource directories were not installed) |
25 | 92 |
"/ - better to warn early ... |
93 |
"/ |
|
5 | 94 |
|anyWrong missing| |
95 |
anyWrong := false. |
|
96 |
missing := ''. |
|
97 |
(Smalltalk getSystemFileName:'resources/SBrowser.rs') isNil ifTrue:[ |
|
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
98 |
'***********************************************************************' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
99 |
'***** ATTENTION: please check installation of your resource files' errorPrintCR. |
5 | 100 |
anyWrong := true. |
101 |
missing := '''resources'' '. |
|
102 |
]. |
|
103 |
(Smalltalk getSystemFileName:'source/Object.st') isNil ifTrue:[ |
|
42 | 104 |
"/ |
105 |
"/ there may still be a SourceCodeManager ... |
|
106 |
"/ |
|
107 |
SourceCodeManager isNil ifTrue:[ |
|
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
108 |
'***********************************************************************' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
109 |
'***** ATTENTION: please check installation of your source files' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
110 |
'***** ' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
111 |
'***** the browser/debugger may not be able to show sourcecode.' errorPrintCR. |
42 | 112 |
anyWrong := true. |
113 |
missing := missing , '''source'' '. |
|
114 |
] |
|
5 | 115 |
]. |
116 |
(Smalltalk getSystemFileName:'bitmaps/SBrowser.xbm') isNil ifTrue:[ |
|
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
117 |
'***********************************************************************' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
118 |
'***** ATTENTION: please check installation of your bitmap files' errorPrintCR. |
5 | 119 |
anyWrong := true. |
120 |
missing := missing , '''bitmaps'' '. |
|
121 |
]. |
|
7 | 122 |
(Smalltalk getSystemFileName:'resources/normal.style') isNil ifTrue:[ |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
123 |
'***********************************************************************' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
124 |
'***** ATTENTION: please check installation of your style files' errorPrintCR. |
7 | 125 |
anyWrong := true. |
126 |
missing := missing , '''resources'' '. |
|
127 |
]. |
|
128 |
||
5 | 129 |
anyWrong ifTrue:[ |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
130 |
'*****' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
131 |
'***** directory(s) named: ' errorPrint. missing errorPrint. 'incomplete/not existing' errorPrintCR. |
5 | 132 |
'***** your path is: ' errorPrint. |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
133 |
Smalltalk systemPath asArray storeString errorPrintCR. |
16 | 134 |
|
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
135 |
'*****' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
136 |
'***** Try: "make source bitmaps resources styles"' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
137 |
'***** or: "make symlinks" to fix this.' errorPrintCR. |
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
138 |
'***********************************************************************' errorPrintCR. |
5 | 139 |
] |
140 |
! |
|
141 |
||
25 | 142 |
"/ |
143 |
"/ check for display-classes being compiled into the system; |
|
144 |
"/ (and if display connection can be established) |
|
145 |
"/ if not, enter a simple read-eval-print loop |
|
146 |
"/ |
|
0 | 147 |
Display isNil ifTrue:[ |
5 | 148 |
DeviceWorkstation notNil ifTrue:[ |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
149 |
'No Display connection.' errorPrintCR. |
5 | 150 |
] ifFalse:[ |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
151 |
'Configuration without display.' errorPrintCR. |
5 | 152 |
]. |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
153 |
'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
|
154 |
' CTRL-D to leave line-by-line interpreter.)' errorPrintCR. |
0 | 155 |
Smalltalk readEvalPrint. |
156 |
Smalltalk exit |
|
10 | 157 |
]. |
0 | 158 |
|
25 | 159 |
"/ |
160 |
"/ this makes X-errors be handled immediately (so you see, |
|
161 |
"/ where it occured) but slows down the system soooo muuuucccchhh .. |
|
162 |
"/ if commented out, errors will be reported asynchronously. |
|
163 |
"/ (I enable this, when things go bad during startup) |
|
164 |
"/ |
|
10 | 165 |
"/ Display unBuffered. |
0 | 166 |
|
25 | 167 |
"/ |
168 |
"/ this starts the incremental GC earlier |
|
169 |
"/ (default is 500000) |
|
170 |
"/ the number given is the number of bytes which have to be allocated |
|
171 |
"/ since the last GC, to start the incremental GC running. |
|
172 |
"/ (see ObjectMemory>>documentation) |
|
173 |
"/ Claus: I moved this to the private.rc file |
|
174 |
"/ |
|
10 | 175 |
"/ ObjectMemory incrementalGCLimit:100000. |
0 | 176 |
|
25 | 177 |
"/ |
178 |
"/ this starts the incremental GC when freeSpace drops below a limit |
|
179 |
"/ (default is nil - i.e. dont look at freeSpace) |
|
180 |
"/ (see ObjectMemory>>documentation) |
|
181 |
"/ Claus: I moved this to the private.rc file |
|
182 |
"/ |
|
16 | 183 |
"/ ObjectMemory freeSpaceGCLimit:300000. |
184 |
||
25 | 185 |
"/ |
186 |
"/ lazy loading |
|
187 |
"/ (faster fileIn) - this is EXPERIMENTAL. |
|
188 |
"/ If there are any problems with lazy methods, disable the following |
|
189 |
"/ and let me (cg@ssw.de) know what happened. |
|
190 |
"/ |
|
10 | 191 |
Autoload compileLazy:true. |
5 | 192 |
|
25 | 193 |
"/ |
194 |
"/ define the language (you can also set the LANG-shell variable) |
|
195 |
"/ (currently only #english and #german are supported) |
|
196 |
"/ setting it here will override the LANG variable setting, |
|
197 |
"/ if neither set here nor in LANG, #english is the default. |
|
198 |
"/ (currently, strings are not available for other than english |
|
199 |
"/ and german; french will follow next - see resource files) |
|
200 |
"/ Claus: supposed to be done in private.rc or via LANG variable |
|
201 |
"/ |
|
10 | 202 |
"/ Smalltalk language:#german. |
203 |
"/ Smalltalk language:#english. |
|
0 | 204 |
|
25 | 205 |
"/ |
206 |
"/ this handles all variant display stuff |
|
207 |
"/ (i.e. things which might change, when DISPLAY is set different) |
|
208 |
"/ |
|
10 | 209 |
Smalltalk fileIn:'display.rc'. |
0 | 210 |
|
25 | 211 |
"/ |
212 |
"/ this defines stuff relating to the host we are running on |
|
213 |
"/ |
|
10 | 214 |
Smalltalk fileIn:'host.rc'. |
0 | 215 |
|
25 | 216 |
"/ |
217 |
"/ set the package to some useful default |
|
218 |
"/ |
|
24 | 219 |
Project notNil ifTrue:[ |
220 |
Project setDefaultProject. |
|
221 |
Project current packageName:#'private'. |
|
222 |
]. |
|
25 | 223 |
|
224 |
"/ |
|
41 | 225 |
"/ read private (per user) stuff |
25 | 226 |
"/ |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
227 |
'reading private.rc ...' infoPrintCR. |
10 | 228 |
Smalltalk fileIn:'private.rc'. |
5 | 229 |
|
25 | 230 |
|
231 |
"/ |
|
232 |
"/ start some views ... |
|
233 |
"/ you can add all stuff you'd like to come up by default |
|
234 |
"/ the first time. |
|
235 |
"/ NOTICE: you should do that in your 'private.rc'-file |
|
236 |
"/ |
|
0 | 237 |
|
95 | 238 |
(Smalltalk at:#NewLauncher) notNil ifTrue:[ |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
239 |
'starting main-menu ...' infoPrintCR. |
95 | 240 |
(Smalltalk at:#NewLauncher) open |
20 | 241 |
] ifFalse:[ |
242 |
"* |
|
243 |
* start a Transcript (if linked-in) |
|
244 |
*" |
|
245 |
TextCollector notNil ifTrue:[ |
|
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
246 |
'starting Transcript ...' infoPrintCR. |
20 | 247 |
TextCollector newTranscript. |
248 |
"/ Transcript lineLimit:2000. |
|
249 |
]. |
|
0 | 250 |
|
20 | 251 |
"* |
252 |
* start the Launcher (if linked-in) |
|
253 |
*" |
|
95 | 254 |
(Smalltalk at:#Launcher) notNil ifTrue:[ |
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
255 |
'starting main-menu ...' infoPrintCR. |
95 | 256 |
(Smalltalk at:#Launcher) open |
20 | 257 |
]. |
10 | 258 |
]. |
0 | 259 |
|
25 | 260 |
"/ |
261 |
"/ start a SystemBrowser |
|
262 |
"/ - I dont want one (using Launcher) |
|
263 |
"/ |
|
10 | 264 |
"/ SystemBrowser open. |
0 | 265 |
|
25 | 266 |
"/ |
267 |
"/ start a FileBrowser |
|
268 |
"/ - I dont want one (using Launcher) |
|
269 |
"/ |
|
10 | 270 |
"/ FileBrowser open. |
0 | 271 |
|
25 | 272 |
"/ |
273 |
"/ start a Workspace |
|
274 |
"/ - I dont want one (using Launcher) |
|
275 |
"/ |
|
10 | 276 |
"/ Workspace open. |
0 | 277 |
|
25 | 278 |
"/ |
279 |
"/ if error occurs, and debugger has problems coming up |
|
280 |
"/ |
|
10 | 281 |
"/ Debugger := MiniDebugger. |
0 | 282 |
|
25 | 283 |
"/ Processor activeProcess vmTrace:true. |
0 | 284 |
! |
86 | 285 |
|
286 |
"/'st.img' asFilename exists ifFalse:[ |
|
123
a974136fe017
startup infoPrinting suppressable (-q flag)
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
287 |
"/ 'saving initial image for faster future startup ...' infoPrintCR. |
86 | 288 |
"/ ObjectMemory primSnapShotOn:'st.img' |
289 |
"/]. |
|
290 |
! |