author | Claus Gittinger <cg@exept.de> |
Mon, 05 Feb 1996 01:52:45 +0100 | |
changeset 80 | 0193c15d9898 |
parent 53 | 00437bd1cfe7 |
child 86 | 7cb0bbfd6431 |
permissions | -rw-r--r-- |
25 | 1 |
"/ |
2 |
"/ $Header$ |
|
3 |
"/ startup configuration for smalltalk |
|
4 |
"/ |
|
5 |
"/ - everything in here are plain smalltalk expressions; |
|
6 |
"/ - statements with in a group are separated by a period. |
|
7 |
"/ - Each group of statements has to be delimited by an exclamation |
|
8 |
"/ character. |
|
9 |
"/ - avoid exclas in comments (or double them) |
|
10 |
"/ - nested comments are not allowed - take care. |
|
11 |
"/ |
|
12 |
"/ remember: this is fileOut-format |
|
13 |
"/ |
|
14 |
"/ comments can be either: |
|
15 |
"/ - standard smalltalk comments (i.e. from dquote to dquote) |
|
16 |
"/ - ST/X end of line comments (i.e. dquote followed by /) |
|
17 |
"/ |
|
18 |
"/ "this is a comment" |
|
19 |
"/ "/ another comment |
|
20 |
"/ |
|
21 |
"/*************************************************************** |
|
22 |
"/ PLEASE: only add things here, if they are of general interrest |
|
23 |
"/ and NEITHER site specific NOT display specific. |
|
24 |
"/ |
|
25 |
"/ site specific things are to be added to "h_<hostname>.rc" |
|
26 |
"/ display specifics to "d_<displayName>.rc" |
|
27 |
"/ and private user stuff in "private.rc" |
|
28 |
"/*************************************************************** |
|
0 | 29 |
|
25 | 30 |
"/ |
53
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
31 |
"/ 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
|
32 |
"/ 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
|
33 |
"/ add the following in your shell-profile: |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
34 |
"/ export STX_SYSTEMPATH=$HOME:/usr/local/lib/smalltalk |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
35 |
"/ 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
|
36 |
"/ 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
|
37 |
"/ 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
|
38 |
"/ |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
39 |
|path| |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
40 |
(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
|
41 |
Smalltalk systemPath:(path asCollectionOfSubstringsSeparatedBy:$:) |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
42 |
]. |
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
43 |
|
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
44 |
"/ |
25 | 45 |
"/ map Language variable setting to known and handled |
46 |
"/ values: |
|
53
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
47 |
"/ |
25 | 48 |
Language == #De ifTrue:[ |
49 |
Language := #german |
|
50 |
]. |
|
51 |
! |
|
8 | 52 |
|
25 | 53 |
"/ |
54 |
"/ just a quick check, if this ST/X installation seems to |
|
55 |
"/ be halfway complete (it happened to some people, that |
|
41 | 56 |
"/ their source/resource directories were not installed) |
25 | 57 |
"/ - better to warn early ... |
58 |
"/ |
|
5 | 59 |
|anyWrong missing| |
60 |
anyWrong := false. |
|
61 |
missing := ''. |
|
62 |
(Smalltalk getSystemFileName:'resources/SBrowser.rs') isNil ifTrue:[ |
|
63 |
'***********************************************************************' errorPrintNL. |
|
64 |
'***** ATTENTION: please check installation of your resource files' errorPrintNL. |
|
65 |
anyWrong := true. |
|
66 |
missing := '''resources'' '. |
|
67 |
]. |
|
68 |
(Smalltalk getSystemFileName:'source/Object.st') isNil ifTrue:[ |
|
42 | 69 |
"/ |
70 |
"/ there may still be a SourceCodeManager ... |
|
71 |
"/ |
|
72 |
SourceCodeManager isNil ifTrue:[ |
|
73 |
'***********************************************************************' errorPrintNL. |
|
74 |
'***** ATTENTION: please check installation of your source files' errorPrintNL. |
|
75 |
'***** ' errorPrintNL. |
|
76 |
'***** the browser/debugger may not be able to show sourcecode.' errorPrintNL. |
|
77 |
anyWrong := true. |
|
78 |
missing := missing , '''source'' '. |
|
79 |
] |
|
5 | 80 |
]. |
81 |
(Smalltalk getSystemFileName:'bitmaps/SBrowser.xbm') isNil ifTrue:[ |
|
82 |
'***********************************************************************' errorPrintNL. |
|
83 |
'***** ATTENTION: please check installation of your bitmap files' errorPrintNL. |
|
84 |
anyWrong := true. |
|
85 |
missing := missing , '''bitmaps'' '. |
|
86 |
]. |
|
7 | 87 |
(Smalltalk getSystemFileName:'resources/normal.style') isNil ifTrue:[ |
88 |
'***********************************************************************' errorPrintNL. |
|
89 |
'***** ATTENTION: please check installation of your style files' errorPrintNL. |
|
90 |
anyWrong := true. |
|
91 |
missing := missing , '''resources'' '. |
|
92 |
]. |
|
93 |
||
5 | 94 |
anyWrong ifTrue:[ |
95 |
'*****' errorPrintNL. |
|
96 |
'***** directory(s) named: ' errorPrint. missing errorPrint. 'incomplete/not existing' errorPrintNL. |
|
97 |
'***** your path is: ' errorPrint. |
|
98 |
Smalltalk systemPath asArray storeString errorPrintNL. |
|
16 | 99 |
|
5 | 100 |
'*****' errorPrintNL. |
16 | 101 |
'***** Try: "make source bitmaps resources styles"' errorPrintNL. |
102 |
'***** or: "make symlinks" to fix this.' errorPrintNL. |
|
5 | 103 |
'***********************************************************************' errorPrintNL. |
104 |
] |
|
105 |
! |
|
106 |
||
25 | 107 |
"/ |
108 |
"/ check for display-classes being compiled into the system; |
|
109 |
"/ (and if display connection can be established) |
|
110 |
"/ if not, enter a simple read-eval-print loop |
|
111 |
"/ |
|
0 | 112 |
Display isNil ifTrue:[ |
5 | 113 |
DeviceWorkstation notNil ifTrue:[ |
26 | 114 |
'No Display connection.' errorPrintNL. |
5 | 115 |
] ifFalse:[ |
26 | 116 |
'Configuration without display.' errorPrintNL. |
5 | 117 |
]. |
26 | 118 |
'Textmode (enter smalltalk expressions terminated by single exclamation mark' errorPrintNL. |
119 |
' CTRL-D to leave line-by-line interpreter.)' errorPrintNL. |
|
0 | 120 |
Smalltalk readEvalPrint. |
121 |
Smalltalk exit |
|
10 | 122 |
]. |
0 | 123 |
|
25 | 124 |
"/ |
125 |
"/ this makes X-errors be handled immediately (so you see, |
|
126 |
"/ where it occured) but slows down the system soooo muuuucccchhh .. |
|
127 |
"/ if commented out, errors will be reported asynchronously. |
|
128 |
"/ (I enable this, when things go bad during startup) |
|
129 |
"/ |
|
10 | 130 |
"/ Display unBuffered. |
0 | 131 |
|
25 | 132 |
"/ |
133 |
"/ this starts the incremental GC earlier |
|
134 |
"/ (default is 500000) |
|
135 |
"/ the number given is the number of bytes which have to be allocated |
|
136 |
"/ since the last GC, to start the incremental GC running. |
|
137 |
"/ (see ObjectMemory>>documentation) |
|
138 |
"/ Claus: I moved this to the private.rc file |
|
139 |
"/ |
|
10 | 140 |
"/ ObjectMemory incrementalGCLimit:100000. |
0 | 141 |
|
25 | 142 |
"/ |
143 |
"/ this starts the incremental GC when freeSpace drops below a limit |
|
144 |
"/ (default is nil - i.e. dont look at freeSpace) |
|
145 |
"/ (see ObjectMemory>>documentation) |
|
146 |
"/ Claus: I moved this to the private.rc file |
|
147 |
"/ |
|
16 | 148 |
"/ ObjectMemory freeSpaceGCLimit:300000. |
149 |
||
25 | 150 |
"/ |
151 |
"/ lazy loading |
|
152 |
"/ (faster fileIn) - this is EXPERIMENTAL. |
|
153 |
"/ If there are any problems with lazy methods, disable the following |
|
154 |
"/ and let me (cg@ssw.de) know what happened. |
|
155 |
"/ |
|
10 | 156 |
Autoload compileLazy:true. |
5 | 157 |
|
25 | 158 |
"/ |
159 |
"/ define the language (you can also set the LANG-shell variable) |
|
160 |
"/ (currently only #english and #german are supported) |
|
161 |
"/ setting it here will override the LANG variable setting, |
|
162 |
"/ if neither set here nor in LANG, #english is the default. |
|
163 |
"/ (currently, strings are not available for other than english |
|
164 |
"/ and german; french will follow next - see resource files) |
|
165 |
"/ Claus: supposed to be done in private.rc or via LANG variable |
|
166 |
"/ |
|
10 | 167 |
"/ Smalltalk language:#german. |
168 |
"/ Smalltalk language:#english. |
|
0 | 169 |
|
25 | 170 |
"/ |
171 |
"/ this handles all variant display stuff |
|
172 |
"/ (i.e. things which might change, when DISPLAY is set different) |
|
173 |
"/ |
|
10 | 174 |
Smalltalk fileIn:'display.rc'. |
0 | 175 |
|
25 | 176 |
"/ |
177 |
"/ this defines stuff relating to the host we are running on |
|
178 |
"/ |
|
10 | 179 |
Smalltalk fileIn:'host.rc'. |
0 | 180 |
|
25 | 181 |
"/ |
182 |
"/ set the package to some useful default |
|
183 |
"/ |
|
24 | 184 |
Project notNil ifTrue:[ |
185 |
Project setDefaultProject. |
|
186 |
Project current packageName:#'private'. |
|
187 |
]. |
|
25 | 188 |
|
189 |
"/ |
|
41 | 190 |
"/ read private (per user) stuff |
25 | 191 |
"/ |
24 | 192 |
Transcript showCr:'reading private.rc ...'. |
10 | 193 |
Smalltalk fileIn:'private.rc'. |
5 | 194 |
|
41 | 195 |
"/ |
196 |
"/ if no style was set (in private.rc), use some default |
|
197 |
"/ |
|
25 | 198 |
View defaultStyle isNil ifTrue:[ |
199 |
Transcript showCr:'no style set in rc files - using default'. |
|
41 | 200 |
Display hasGreyscales ifTrue:[ |
201 |
View defaultStyle:#motif. |
|
202 |
] ifFalse:[ |
|
203 |
View defaultStyle:#normal |
|
204 |
] |
|
25 | 205 |
]. |
206 |
||
207 |
"/ |
|
208 |
"/ start some views ... |
|
209 |
"/ you can add all stuff you'd like to come up by default |
|
210 |
"/ the first time. |
|
211 |
"/ NOTICE: you should do that in your 'private.rc'-file |
|
212 |
"/ |
|
0 | 213 |
|
20 | 214 |
NewLauncher notNil ifTrue:[ |
215 |
'starting main-menu ...' errorPrintNL. |
|
216 |
NewLauncher open |
|
217 |
] ifFalse:[ |
|
218 |
"* |
|
219 |
* start a Transcript (if linked-in) |
|
220 |
*" |
|
221 |
TextCollector notNil ifTrue:[ |
|
222 |
'starting Transcript ...' errorPrintNL. |
|
223 |
TextCollector newTranscript. |
|
224 |
"/ Transcript lineLimit:2000. |
|
225 |
]. |
|
0 | 226 |
|
20 | 227 |
"* |
228 |
* start the Launcher (if linked-in) |
|
229 |
*" |
|
230 |
Launcher notNil ifTrue:[ |
|
231 |
'starting main-menu ...' errorPrintNL. |
|
232 |
Launcher open |
|
233 |
]. |
|
10 | 234 |
]. |
0 | 235 |
|
25 | 236 |
"/ |
237 |
"/ start a SystemBrowser |
|
238 |
"/ - I dont want one (using Launcher) |
|
239 |
"/ |
|
10 | 240 |
"/ SystemBrowser open. |
0 | 241 |
|
25 | 242 |
"/ |
243 |
"/ start a FileBrowser |
|
244 |
"/ - I dont want one (using Launcher) |
|
245 |
"/ |
|
10 | 246 |
"/ FileBrowser open. |
0 | 247 |
|
25 | 248 |
"/ |
249 |
"/ start a Workspace |
|
250 |
"/ - I dont want one (using Launcher) |
|
251 |
"/ |
|
10 | 252 |
"/ Workspace open. |
0 | 253 |
|
25 | 254 |
"/ |
255 |
"/ if error occurs, and debugger has problems coming up |
|
256 |
"/ |
|
10 | 257 |
"/ Debugger := MiniDebugger. |
0 | 258 |
|
25 | 259 |
"/ |
260 |
"/ remember the type of display we started on, to check for |
|
261 |
"/ a need to change things when we are restarted on another display. |
|
262 |
"/ see smalltalk_r.rc for what this is for ... |
|
263 |
"/ |
|
0 | 264 |
Smalltalk at:#'_ImageDisplayDepth' put:Display depth. |
265 |
Smalltalk at:#'_ImageDisplayHasColors' put:Display hasColors. |
|
266 |
Smalltalk at:#'_ImageDisplayHasGreyscales' put:Display hasGreyscales. |
|
25 | 267 |
|
268 |
"/ Processor activeProcess vmTrace:true. |
|
0 | 269 |
! |