author | HG Automerge |
Thu, 24 Nov 2016 22:00:02 +0000 | |
branch | jv |
changeset 1481 | 4a4686007f8f |
parent 1447 | 0b149293564f |
parent 1467 | befae5d031b8 |
child 1484 | cef397199379 |
permissions | -rw-r--r-- |
609 | 1 |
"/ Encoding: iso8859-1 |
25 | 2 |
"/ |
3 |
"/ $Header$ |
|
86 | 4 |
"/ |
399 | 5 |
"/ MIMEType: application/x-smalltalk-source |
6 |
"/ |
|
209 | 7 |
"/ ST/X startup configuration & command file: |
8 |
"/ |
|
25 | 9 |
"/ startup configuration for smalltalk |
10 |
"/ |
|
11 |
"/ - everything in here are plain smalltalk expressions; |
|
12 |
"/ - statements with in a group are separated by a period. |
|
13 |
"/ - Each group of statements has to be delimited by an exclamation |
|
14 |
"/ character. |
|
15 |
"/ - avoid exclas in comments (or double them) |
|
16 |
"/ - nested comments are not allowed - take care. |
|
17 |
"/ |
|
18 |
"/ remember: this is fileOut-format |
|
19 |
"/ |
|
20 |
"/ comments can be either: |
|
21 |
"/ - standard smalltalk comments (i.e. from dquote to dquote) |
|
22 |
"/ - ST/X end of line comments (i.e. dquote followed by /) |
|
23 |
"/ |
|
24 |
"/ "this is a comment" |
|
25 |
"/ "/ another comment |
|
26 |
"/ |
|
27 |
"/*************************************************************** |
|
28 |
"/ PLEASE: only add things here, if they are of general interrest |
|
29 |
"/ and NEITHER site specific NOT display specific. |
|
30 |
"/ |
|
31 |
"/ site specific things are to be added to "h_<hostname>.rc" |
|
32 |
"/ display specifics to "d_<displayName>.rc" |
|
33 |
"/ and private user stuff in "private.rc" |
|
34 |
"/*************************************************************** |
|
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
35 |
|cpu enableJIT| |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
36 |
|
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
37 |
"/ |
1299 | 38 |
"/ the JIT translator is (was) known to work with the following |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
39 |
"/ architectures: |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
40 |
"/ ix86 (linux, win32, unixware) |
1341
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
41 |
"/ sgi-mips (irix) [no longer supported] |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
42 |
"/ alpha (osf) [no longer supported] |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
43 |
"/ sparc (solaris) [only tested with v7 & v8 & v9 cpus] |
1299 | 44 |
"/ rs6k (aix) [not very well tested] |
45 |
"/ mc68k [no longer supported] |
|
46 |
"/ mc88k [no longer supported] |
|
47 |
"/ pa-risk [no longer supported] |
|
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
48 |
"/ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
49 |
enableJIT := false. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
50 |
|
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
51 |
cpu := OperatingSystem getCPUType. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
52 |
(#( |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
53 |
'i386' |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
54 |
'sparc' |
1341
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
55 |
"/ 'mips' |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
56 |
"/ 'alpha' |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
57 |
) includes:cpu) ifTrue:[ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
58 |
enableJIT := true. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
59 |
|
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
60 |
cpu = 'sparc' ifTrue:[ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
61 |
"/ for now, disable if we detect running on a sparcV10; |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
62 |
"/ Reason: |
1341
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
63 |
"/ we do not have v10 machines here at exept , |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
64 |
"/ and therefore have no way of checking if it runs on v10. |
1341
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
65 |
"/ I don't want ST/X to crash on your side in that case ... |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
66 |
"/ ... better run a bit slower than not running at all. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
67 |
"/ Please let us know if it runs and we will remove the code below |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
68 |
"/ (which you should do as well). |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
69 |
|
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
70 |
((OperatingSystem getSystemInfo at:#instructionSets) includesString:'sparcv10') ifTrue:[ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
71 |
'smalltalk.rc [warning]: disable JIT for sparcV10 - not yet validated' infoPrintCR. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
72 |
enableJIT := false |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
73 |
] |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
74 |
] |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
75 |
]. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
76 |
|
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
77 |
enableJIT ifTrue:[ |
656 | 78 |
"/ 'smalltalk.rc [info]: turn on JIT...' infoPrintCR. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
79 |
ObjectMemory justInTimeCompilation:true. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
80 |
]. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
81 |
|
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
82 |
"/ OperatingSystem disableSignal:14. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
83 |
|
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
84 |
ObjectMemory infoPrinting:false. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
85 |
"/ Smalltalk loadBinaries:true. |
1341
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
86 |
"/ Compiler allowUnderscoreInIdentifier:true. |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
87 |
"/ Compiler warnUnderscoreInIdentifier:false. |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
88 |
"/ Compiler warnSTXSpecials:false. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
89 |
! |
0 | 90 |
|
25 | 91 |
"/ |
53
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
92 |
"/ 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
|
93 |
"/ 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
|
94 |
"/ add the following in your shell-profile: |
86 | 95 |
"/ 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
|
96 |
"/ 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
|
97 |
"/ 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
|
98 |
"/ 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
|
99 |
"/ |
197 | 100 |
|
781 | 101 |
|path pathOfSTXExecutable pathOfCurrentDir| |
287
8151d262bd27
check for gnu-smalltalk sources along my path;
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
102 |
|
704 | 103 |
"/ 'systemPath before: ' infoPrint. Smalltalk systemPath infoPrintCR. |
104 |
"/ 'exec: ' infoPrint. OperatingSystem nameOfSTXExecutable infoPrintCR. |
|
105 |
"/ 'execPath: ' infoPrint. OperatingSystem pathOfSTXExecutable infoPrintCR. |
|
680 | 106 |
|
782 | 107 |
pathOfSTXExecutable := OperatingSystem pathOfSTXExecutable. |
108 |
pathOfSTXExecutable notNil ifTrue:[ |
|
109 |
pathOfSTXExecutable := pathOfSTXExecutable asFilename directory. |
|
110 |
]. |
|
781 | 111 |
pathOfCurrentDir := Filename currentDirectory asAbsoluteFilename. |
672 | 112 |
|
53
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
113 |
(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
|
114 |
Smalltalk systemPath:(path asCollectionOfSubstringsSeparatedBy:$:) |
287
8151d262bd27
check for gnu-smalltalk sources along my path;
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
115 |
] ifFalse:[ |
8151d262bd27
check for gnu-smalltalk sources along my path;
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
116 |
"/ look for gnu-smalltalk class files along my PATH. |
8151d262bd27
check for gnu-smalltalk sources along my path;
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
117 |
"/ if found, remove that directory from the PATH to avoid |
8151d262bd27
check for gnu-smalltalk sources along my path;
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
118 |
"/ autoloading wrong classes. |
8151d262bd27
check for gnu-smalltalk sources along my path;
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
119 |
(path := Smalltalk getSystemFileName:'initialize.st') notNil ifTrue:[ |
8151d262bd27
check for gnu-smalltalk sources along my path;
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
120 |
path := path asFilename directoryName. |
308
6e6d557009c7
dont loose windows keyboard setup after image restart
Claus Gittinger <cg@exept.de>
parents:
287
diff
changeset
|
121 |
('smalltalk.rc [info]: found gnu-smalltalk sources in ' , path , '; removed from systemPath.') infoPrintCR. |
287
8151d262bd27
check for gnu-smalltalk sources along my path;
Claus Gittinger <cg@exept.de>
parents:
272
diff
changeset
|
122 |
Smalltalk systemPath:(Smalltalk systemPath remove:path; yourself). |
672 | 123 |
]. |
782 | 124 |
pathOfSTXExecutable notNil ifTrue:[ |
125 |
(Smalltalk systemPath includes:pathOfSTXExecutable name) ifFalse:[ |
|
126 |
Smalltalk systemPath addFirst:pathOfSTXExecutable name. |
|
127 |
] |
|
677 | 128 |
]. |
781 | 129 |
(Smalltalk systemPath includes:pathOfCurrentDir name) ifFalse:[ |
130 |
Smalltalk systemPath addFirst:pathOfCurrentDir name. |
|
131 |
]. |
|
672 | 132 |
|
677 | 133 |
"/ the current directory should always be first... |
134 |
(Smalltalk systemPath includes:'.') ifTrue:[ |
|
135 |
Smalltalk systemPath remove:'.'. |
|
136 |
]. |
|
1384 | 137 |
(Smalltalk systemPath includes:Filename currentDirectory pathName) ifTrue:[ |
138 |
Smalltalk systemPath remove:Filename currentDirectory pathName. |
|
677 | 139 |
]. |
1384 | 140 |
Smalltalk systemPath addFirst:Filename currentDirectory pathName. |
53
00437bd1cfe7
allow systemPath to be set via a shell variable
Claus Gittinger <cg@exept.de>
parents:
42
diff
changeset
|
141 |
]. |
409 | 142 |
|
689 | 143 |
"/ 'systemPath: ' errorPrint. Smalltalk systemPath errorPrintCR. |
672 | 144 |
|
409 | 145 |
Smalltalk flushPathCaches. |
1447
0b149293564f
Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1446
diff
changeset
|
146 |
|
0b149293564f
Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1446
diff
changeset
|
147 |
SmalltalkStartup main: Smalltalk commandLineArguments ? #(). |
0b149293564f
Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1446
diff
changeset
|
148 |
|
86 | 149 |
! |
150 |
||
1276
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
151 |
"/ look fore one ore more --loadPackage arguments |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
152 |
"/ load the packages |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
153 |
|args idx| |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
154 |
|
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
155 |
args := Smalltalk commandLineArguments ? #(). |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
156 |
[ |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
157 |
idx := args indexOf:'-L'. |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
158 |
idx == 0 ifTrue:[ |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
159 |
idx := args indexOf:'--loadPackage'. |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
160 |
]. |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
161 |
idx ~~ 0 |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
162 |
] whileTrue:[ |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
163 |
Smalltalk loadPackage:(args at:idx+1). |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
164 |
args removeAtIndex:idx+1; removeAtIndex:idx. |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
165 |
]. |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
166 |
! |
80b650ffab1c
New option --loadPackage <packageName> - may oocur multiple times
Stefan Vogel <sv@exept.de>
parents:
1248
diff
changeset
|
167 |
|
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
168 |
|args buildClasses openDisplay prevCatchSetting| |
86 | 169 |
|
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
170 |
args := Smalltalk commandLineArguments ? #(). |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
171 |
|
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
172 |
buildClasses := false. |
126 | 173 |
((args size > 0) and:[args last = '--buildClasses']) ifTrue:[ |
86 | 174 |
'binary' asFilename isDirectory ifFalse:[ |
195 | 175 |
'smalltalk.rc [warning]: no binary directory for classes.' errorPrintCR. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
176 |
Smalltalk exit. |
86 | 177 |
]. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
178 |
buildClasses := true. |
432 | 179 |
]. |
180 |
||
8 | 181 |
|
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
182 |
"/ check for display-classes being required and compiled into the system; |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
183 |
"/ if not, load the display classes. |
25 | 184 |
"/ |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
185 |
openDisplay := false. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
186 |
(Smalltalk isHeadless or:[args includes:'--noDisplay']) ifFalse:[ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
187 |
(Smalltalk at:#DeviceWorkstation) isNil ifTrue:[ |
637 | 188 |
"no view classes compiled into the system. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
189 |
Minimum smalltalk does only contain libbasic, libcomp and librun. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
190 |
FileIn view stuff" |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
191 |
|
656 | 192 |
'smalltalk.rc [info]: installing required class libraries...' infoPrintCR. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
193 |
(Smalltalk isClassLibraryLoaded:'libbasic2') ifFalse:[ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
194 |
Smalltalk loadPackage:'stx:libbasic2'. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
195 |
]. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
196 |
Smalltalk loadPackage:'stx:libview'. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
197 |
Smalltalk fileInClassLibrary:'XWorkstation' inPackage:'stx:libview'. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
198 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
199 |
Smalltalk fileInClassLibrary:'WinWorkstation' inPackage:'stx:libview'. |
609 | 200 |
]. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
201 |
]. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
202 |
openDisplay := true. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
203 |
]. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
204 |
|
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
205 |
|
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
206 |
"/ Install patches, once everything has been loaded. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
207 |
"/ System methods may be overwritten by patches. |
336
5eb44f3e88af
do not output 'no sourceCode' warning messages
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
208 |
|
1111
a139aac9c633
Print warning on error during fileIn of 'patches'
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
209 |
prevCatchSetting := Class catchMethodRedefinitions:false. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
210 |
(Smalltalk secureFileIn:(Smalltalk commandName asFilename withSuffix:'pch')) ifFalse:[ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
211 |
Smalltalk isStandAloneApp ifFalse:[ |
1111
a139aac9c633
Print warning on error during fileIn of 'patches'
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
212 |
(Smalltalk secureFileIn:'patches') ifFalse:[ |
1112 | 213 |
'smalltalk.rc [warning]: error while filing in ''patches'' - some patches have not been loaded!!' errorPrintCR. |
1111
a139aac9c633
Print warning on error during fileIn of 'patches'
Stefan Vogel <sv@exept.de>
parents:
1090
diff
changeset
|
214 |
]. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
215 |
]. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
216 |
]. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
217 |
Class catchMethodRedefinitions:prevCatchSetting. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
218 |
|
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
219 |
openDisplay ifTrue:[ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
220 |
"/ open the graphical display |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
221 |
[ |
1361 | 222 |
'smalltalk.rc [info]: opening display...' infoPrintCR. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
223 |
Screen openDefaultDisplay:nil. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
224 |
] on:Screen deviceOpenErrorSignal do:[:ex| |
1112 | 225 |
('smalltalk.rc [warning]: no display connection to: ', ex parameter printString) errorPrintCR. |
226 |
'smalltalk.rc [info]: either set the DISPLAY environment variable,' infoPrintCR. |
|
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
227 |
'smalltalk.rc [info]: or start smalltalk with a -display argument.' infoPrintCR. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
228 |
Smalltalk isStandAloneApp ifFalse:[ |
394
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
387
diff
changeset
|
229 |
'' errorPrintCR. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
387
diff
changeset
|
230 |
'Textmode (enter smalltalk expressions terminated by single exclamation mark;' errorPrintCR. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
387
diff
changeset
|
231 |
OperatingSystem isUNIXlike ifTrue:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
387
diff
changeset
|
232 |
' CTRL-D to leave line-by-line interpreter.)' errorPrintCR. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
387
diff
changeset
|
233 |
] ifFalse:[ |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
387
diff
changeset
|
234 |
' CTRL-Z to leave line-by-line interpreter.)' errorPrintCR. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
387
diff
changeset
|
235 |
]. |
70ecff920548
Fix DISPLAY access for headless servers.
Stefan Vogel <sv@exept.de>
parents:
387
diff
changeset
|
236 |
Smalltalk readEvalPrint. |
355
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
237 |
]. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
238 |
Smalltalk exit |
5 | 239 |
]. |
10 | 240 |
]. |
0 | 241 |
|
25 | 242 |
"/ |
243 |
"/ this makes X-errors be handled immediately (so you see, |
|
244 |
"/ where it occured) but slows down the system soooo muuuucccchhh .. |
|
245 |
"/ if commented out, errors will be reported asynchronously. |
|
246 |
"/ (I enable this, when things go bad during startup) |
|
247 |
"/ |
|
10 | 248 |
"/ Display unBuffered. |
0 | 249 |
|
924 | 250 |
|
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
251 |
"/ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
252 |
"/ lazy loading |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
253 |
"/ (faster fileIn) - this is EXPERIMENTAL. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
254 |
"/ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
255 |
"/ - if turned on, an autoload operation will only create methodStubs |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
256 |
"/ (uncompiled) which trap when called the first time. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
257 |
"/ The bytecode compiler will compile them when first executen. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
258 |
"/ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
259 |
"/ - if turned off, an autoload will load & compile the whole class, |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
260 |
"/ which makes autoloading slower, but avoids the initial delays |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
261 |
"/ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
262 |
"/ This is much like just-in-time compilation, but on a higher level. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
263 |
"/ If there are any problems with lazy methods, disable the following |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
264 |
"/ and let me (info@exept.de) know what happened. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
265 |
"/ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
266 |
Autoload compileLazy:true. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
267 |
|
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
268 |
"/ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
269 |
"/ read the abbrev.stc file, extract class names |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
270 |
"/ and install all nonExisting classes as autoloaded |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
271 |
"/ |
609 | 272 |
Class withoutUpdatingChangesDo:[ |
568 | 273 |
|needToReactivate| |
274 |
||
275 |
HistoryManager notNil ifTrue:[ |
|
276 |
needToReactivate := HistoryManager isActive. |
|
277 |
HistoryManager deactivate. |
|
278 |
] ifFalse:[ |
|
279 |
needToReactivate := false |
|
280 |
]. |
|
617
f6afee16b359
Add --quick options to come up without gimmicks
Stefan Vogel <sv@exept.de>
parents:
612
diff
changeset
|
281 |
|
1467
befae5d031b8
--autoload option to get the old behavior;
Claus Gittinger <cg@exept.de>
parents:
1457
diff
changeset
|
282 |
"/ ((Smalltalk commandLineArguments includes:'--quick') |
befae5d031b8
--autoload option to get the old behavior;
Claus Gittinger <cg@exept.de>
parents:
1457
diff
changeset
|
283 |
"/ or:[ (Smalltalk isPlugin) |
befae5d031b8
--autoload option to get the old behavior;
Claus Gittinger <cg@exept.de>
parents:
1457
diff
changeset
|
284 |
"/ or:[ (Smalltalk commandLineArguments includes:'--faststart') |
befae5d031b8
--autoload option to get the old behavior;
Claus Gittinger <cg@exept.de>
parents:
1457
diff
changeset
|
285 |
"/ or:[ (Smalltalk commandLineArguments includes:'--fastStart') |
befae5d031b8
--autoload option to get the old behavior;
Claus Gittinger <cg@exept.de>
parents:
1457
diff
changeset
|
286 |
"/ ]]]) ifFalse: |
befae5d031b8
--autoload option to get the old behavior;
Claus Gittinger <cg@exept.de>
parents:
1457
diff
changeset
|
287 |
(Smalltalk commandLineArguments includes:'--autoload') |
befae5d031b8
--autoload option to get the old behavior;
Claus Gittinger <cg@exept.de>
parents:
1457
diff
changeset
|
288 |
ifTrue: |
befae5d031b8
--autoload option to get the old behavior;
Claus Gittinger <cg@exept.de>
parents:
1457
diff
changeset
|
289 |
[ |
656 | 290 |
'smalltalk.rc [info]: installing autoloaded classes...' infoPrintCR. |
617
f6afee16b359
Add --quick options to come up without gimmicks
Stefan Vogel <sv@exept.de>
parents:
612
diff
changeset
|
291 |
Smalltalk installAutoloadedClasses. |
f6afee16b359
Add --quick options to come up without gimmicks
Stefan Vogel <sv@exept.de>
parents:
612
diff
changeset
|
292 |
]. |
568 | 293 |
needToReactivate ifTrue:[HistoryManager activate]. |
294 |
]. |
|
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
295 |
|
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
296 |
buildClasses ifTrue:[ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
297 |
"/ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
298 |
"/ load all lazy classes |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
299 |
"/ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
300 |
Autoload subclasses do:[:aClass | |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
301 |
Autoload autoloadFailedSignal handle:[:ex | |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
302 |
'smalltalk.rc [warning]: autoload failed' errorPrintCR. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
303 |
ex return. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
304 |
] do:[ |
656 | 305 |
'smalltalk.rc [info]: loading ' infoPrint. aClass name infoPrint. '...' infoPrintCR. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
306 |
aClass autoload. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
307 |
] |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
308 |
]. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
309 |
|
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
310 |
"/ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
311 |
"/ binary save all classes |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
312 |
"/ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
313 |
Autoload loadedClasses do:[:cls | |
656 | 314 |
'smalltalk.rc [info]: saving binary of ' infoPrint. cls name infoPrint. '...' infoPrintCR. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
315 |
cls binaryFileOut. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
316 |
OperatingSystem executeCommand:'mv *.cls binary'. |
1346 | 317 |
]. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
318 |
Smalltalk exit |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
319 |
]. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
320 |
! |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
321 |
|
25 | 322 |
"/ |
686 | 323 |
"/ Memory settings. NOTE that all these settings may be overwritten by |
324 |
"/ settings.stx which stores the Launcher's settings. |
|
325 |
||
326 |
"/ |
|
25 | 327 |
"/ this starts the incremental GC earlier |
328 |
"/ (default is 500000) |
|
329 |
"/ the number given is the number of bytes which have to be allocated |
|
330 |
"/ since the last GC, to start the incremental GC running. |
|
331 |
"/ (see ObjectMemory>>documentation) |
|
332 |
"/ Claus: I moved this to the private.rc file |
|
333 |
"/ |
|
609 | 334 |
"/ ObjectMemory incrementalGCLimit:100000. |
0 | 335 |
|
25 | 336 |
"/ |
337 |
"/ this starts the incremental GC when freeSpace drops below a limit |
|
338 |
"/ (default is nil - i.e. dont look at freeSpace) |
|
339 |
"/ (see ObjectMemory>>documentation) |
|
340 |
"/ Claus: I moved this to the private.rc file |
|
341 |
"/ |
|
609 | 342 |
"/ ObjectMemory freeSpaceGCLimit:300000. |
16 | 343 |
|
322 | 344 |
"/ experimental: try to always keep some bytes in the pocket |
345 |
"/ this changes the memory policy, to start the background collector whenever |
|
609 | 346 |
"/ freespace drops below 250k or 500k have been allocated since the last GC. |
322 | 347 |
"/ AND to allocate more memory, if (after the collect) less than 1Mb is free. |
348 |
"/ Doing so makes the system behave better if lots of memory is required |
|
349 |
"/ for short periods of time, since it prepares itself for that situation |
|
350 |
"/ during idle time. (I often walk around in the fileBrowser, loading big |
|
351 |
"/ files like XWorkstation.st or SystemBrowser.st ....) |
|
352 |
||
1341
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
353 |
ObjectMemory freeSpaceGCAmount:(1024*1024). |
1362 | 354 |
ObjectMemory freeSpaceGCLimit:(4*1024*1024). |
355 |
"/ ObjectMemory incrementalGCLimit:(4*1024*1024). |
|
356 |
ObjectMemory oldSpaceIncrement:(4*1024*1024). |
|
457 | 357 |
ObjectMemory oldSpaceCompressLimit:0. "/ temporary kludge |
609 | 358 |
ObjectMemory startBackgroundCollectorAt:5. |
359 |
ObjectMemory startBackgroundFinalizationAt:5. |
|
566 | 360 |
|
361 |
"/ this limits the amount of memory which is allocated for oldSpace |
|
362 |
"/ (for example to prevent ST/X from taking memory from other processes) |
|
363 |
"/ The absolute maximum is a builtIn constant and OS specific. |
|
364 |
||
365 |
"/ ObjectMemory maxOldSpace:1024*1024*128. |
|
1297 | 366 |
"/ ObjectMemory maxOldSpace:1024*1024*512. |
1341
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
367 |
|
1298 | 368 |
ExternalBytes sizeofPointer == 8 ifTrue:[ |
1419 | 369 |
"/ limit to 8GB to prevent a runaway program from thrashing the system |
1298 | 370 |
"/ if you really need more, change that line |
1419 | 371 |
ObjectMemory maxOldSpace:8*1024*1024*1024. |
372 |
"/ ObjectMemory maxOldSpace:40*1024*1024*1024. |
|
1298 | 373 |
]. |
1297 | 374 |
|
1341
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
375 |
"/ experimental: configure the memory manager to quickly increase |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
376 |
"/ its oldSpace, as long as it stays below 256Mb |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
377 |
"/ (i.e. do not enter a blocking mark&sweep or compress, |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
378 |
"/ but go straight ahead increasing the oldSpace). |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
379 |
"/ Above that, behave as usual, i.e. try a GC first, |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
380 |
"/ then increase the oldSpace size if that did not help. |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
381 |
"/ If you have a machine with lots of (real) memory, you may want to |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
382 |
"/ increase the number. |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
383 |
"/ |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
384 |
ObjectMemory fastMoreOldSpaceLimit:256*1024*1024. |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
385 |
ObjectMemory fastMoreOldSpaceAllocation:true. |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
386 |
|
1419 | 387 |
"/ this changes the size of the eden generation, where objects |
388 |
"/ are initially allocated. Making it bigger may increase pause |
|
389 |
"/ times a bit, if many objects survive, but reduces the overall overhead |
|
390 |
"/ For server type applications (request-response-loops such as in webServers), |
|
391 |
"/ it is a good idea to make it big enough to handle a request-cycles temporary |
|
392 |
"/ data |
|
393 |
||
394 |
"/ ObjectMemory newSpaceSize:(2*1024*1024). |
|
395 |
"/ ObjectMemory newSpaceSize:(8*1024*1024). |
|
396 |
||
1341
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
397 |
"/ server settings; possibly longer worst case pause times, |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
398 |
"/ but less overhead overall. |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
399 |
"/ Use this for webservers, protocol servers etc, where blocking times |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
400 |
"/ above 30ms are acceptable (also works for interactive programming) |
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
401 |
|
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
402 |
ObjectMemory newSpaceSize:(16*1024*1024). |
1362 | 403 |
ObjectMemory incrementalGCLimit:(64*1024*1024). |
1341
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
404 |
|
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
405 |
"/ |
322 | 406 |
"/ run the background collector at a dynamic priority - it will |
407 |
"/ now always get a chance to make some progress ... |
|
1341
9a6ea7ab9585
changed settings file order (private first)
Claus Gittinger <cg@exept.de>
parents:
1316
diff
changeset
|
408 |
"/ |
322 | 409 |
Smalltalk addStartBlock:[ |
1316 | 410 |
"/ 'smalltalk.rc [info]: start timeSlicing...' infoPrintCR. |
322 | 411 |
Processor startTimeSlicing. |
412 |
Processor supportDynamicPriorities:true. |
|
413 |
ObjectMemory backgroundCollectProcess priorityRange:(4 to:9). |
|
414 |
ObjectMemory backgroundFinalizationProcess priorityRange:(4 to:9). |
|
415 |
]. |
|
416 |
! |
|
417 |
||
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
418 |
"/ another experimental (and a secret for now, since I don't want |
322 | 419 |
"/ you to play with those ;-) |
420 |
"/ For now, this is experimental. Once the best numbers |
|
421 |
"/ have been found, I'll hardwire them and document it ... |
|
422 |
||
686 | 423 |
|tenureParams| |
426
74cc4af22873
install autoloaded classes BEFORE doing display.rc/host.rc
Claus Gittinger <cg@exept.de>
parents:
424
diff
changeset
|
424 |
|
322 | 425 |
ObjectMemory newSpaceSize > (500*1024) ifTrue:[ |
686 | 426 |
tenureParams := #(nil nil nil nil -16 -4 -2 -2 0 0 16 nil) copy. |
322 | 427 |
] ifFalse:[ |
428 |
"/ min max cpy /32 /16 /8 /4 /2 /4 /8 /16 /32 " |
|
429 |
"/ |
|
430 |
"/ slow tenure - keeps objects longer in newSpace, |
|
431 |
"/ producing more scavenge overhead, but releasing IGC somewhat |
|
432 |
"/ |
|
686 | 433 |
"/ tenureParams := #(nil nil nil -100 -8 -4 -1 1 2 4 8 16 nil) copy. |
434 |
"/ tenureParams := #(nil nil nil nil -16 -4 0 0 0 4 16 nil) copy. |
|
322 | 435 |
|
436 |
"/ |
|
437 |
"/ fast tenure - moves objects earlier into oldSpace, |
|
438 |
"/ releasing newSpace collector; however, the oldSpace IGC |
|
439 |
"/ may have more work to do. |
|
440 |
"/ |
|
686 | 441 |
tenureParams := #(nil nil nil nil -20 -8 -3 -1 -1 1 16 nil) copy. |
322 | 442 |
]. |
686 | 443 |
ObjectMemory tenureParameters:tenureParams. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
444 |
! |
0 | 445 |
|
25 | 446 |
"/ |
358
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
447 |
"/ this defines stuff relating to the host we are running on |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
448 |
"/ |
656 | 449 |
"/ 'smalltalk.rc [info]: reading ''host.rc''...' infoPrintCR. |
358
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
450 |
Smalltalk fileIn:'host.rc'. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
451 |
|
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
452 |
"/ |
25 | 453 |
"/ this handles all variant display stuff |
454 |
"/ (i.e. things which might change, when DISPLAY is set different) |
|
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
325
diff
changeset
|
455 |
"/ Notice, that the display may be different from the host we run on; |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
325
diff
changeset
|
456 |
"/ Host specific things are configured in host.rc. |
25 | 457 |
"/ |
336
5eb44f3e88af
do not output 'no sourceCode' warning messages
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
458 |
Display notNil ifTrue:[ |
656 | 459 |
"/ 'smalltalk.rc [info]: reading ''display.rc''...' infoPrintCR. |
336
5eb44f3e88af
do not output 'no sourceCode' warning messages
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
460 |
Smalltalk fileIn:'display.rc'. |
5eb44f3e88af
do not output 'no sourceCode' warning messages
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
461 |
]. |
0 | 462 |
|
25 | 463 |
"/ |
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
464 |
"/ Ask user to accept Licence. |
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
465 |
"/ exit, if rejected. |
324
e8eb27061a3f
llow for licenceBox to be suppressed
Claus Gittinger <cg@exept.de>
parents:
322
diff
changeset
|
466 |
"/ |
152 | 467 |
"/ You may find this annoying - but lawers say: "this is a must ..." ;-) |
468 |
"/ (it will not be shown when coming up via a snapshot image) |
|
324
e8eb27061a3f
llow for licenceBox to be suppressed
Claus Gittinger <cg@exept.de>
parents:
322
diff
changeset
|
469 |
"/ Also, the licenceBox can be suppressed with a command-line argument; |
e8eb27061a3f
llow for licenceBox to be suppressed
Claus Gittinger <cg@exept.de>
parents:
322
diff
changeset
|
470 |
"/ however, if you do so, we assume you have read & accepted it at least |
e8eb27061a3f
llow for licenceBox to be suppressed
Claus Gittinger <cg@exept.de>
parents:
322
diff
changeset
|
471 |
"/ once (since this command-line-argument is not documented, you obviously |
e8eb27061a3f
llow for licenceBox to be suppressed
Claus Gittinger <cg@exept.de>
parents:
322
diff
changeset
|
472 |
"/ read the code below). |
220 | 473 |
|
324
e8eb27061a3f
llow for licenceBox to be suppressed
Claus Gittinger <cg@exept.de>
parents:
322
diff
changeset
|
474 |
"/ |
325 | 475 |
"/ WARNING: read the licence text before you: |
476 |
"/ - disable the code below, |
|
477 |
"/ - or start stx with a suppress argument. |
|
324
e8eb27061a3f
llow for licenceBox to be suppressed
Claus Gittinger <cg@exept.de>
parents:
322
diff
changeset
|
478 |
"/ |
250 | 479 |
|
678 | 480 |
(Smalltalk isStandAloneApp not |
686 | 481 |
and:[Smalltalk isPlugin not |
482 |
and:[Display notNil |
|
678 | 483 |
]]) ifTrue:[ |
617
f6afee16b359
Add --quick options to come up without gimmicks
Stefan Vogel <sv@exept.de>
parents:
612
diff
changeset
|
484 |
((Smalltalk commandLineArguments includes:'--noLicenceBox') |
663 | 485 |
or:[(Smalltalk commandLineArguments includes:'--quick') |
486 |
or:[(Smalltalk commandLineArguments includes:'--faststart') |
|
487 |
or:[(Smalltalk commandLineArguments includes:'--fastStart') |
|
678 | 488 |
]]]) ifFalse:[ |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
489 |
Smalltalk addStartBlock:[ |
656 | 490 |
'smalltalk.rc [info]: show licence conditions...' infoPrintCR. |
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
491 |
LicenceBox autoload. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
492 |
LicenceBox licenceRejectSignal handle:[:ex| |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
493 |
Smalltalk exit |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
494 |
] do:[ |
1358
7ea72a25a3d6
exitOnLastClose disabled for licenseBox
Claus Gittinger <cg@exept.de>
parents:
1346
diff
changeset
|
495 |
Display exitOnLastClose:false. |
656 | 496 |
(LicenceBox open) ifFalse:[ |
497 |
'smalltalk.rc [info]: licence conditions not accepted.' infoPrintCR. |
|
498 |
Smalltalk exit |
|
499 |
]. |
|
687 | 500 |
Class withoutUpdatingChangesDo:[ |
501 |
Smalltalk removeClass:LicenceBox. |
|
502 |
]. |
|
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
503 |
]. |
336
5eb44f3e88af
do not output 'no sourceCode' warning messages
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
504 |
] |
324
e8eb27061a3f
llow for licenceBox to be suppressed
Claus Gittinger <cg@exept.de>
parents:
322
diff
changeset
|
505 |
] |
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
506 |
]. |
358
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
507 |
! |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
508 |
|
723 | 509 |
|cls| |
358
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
510 |
"/ |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
511 |
"/ some ST80 name aliases |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
512 |
"/ (actually, much more is needed - this is just a start ...) |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
513 |
"/ |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
514 |
(cls := Smalltalk at:#StandardSystemView) notNil ifTrue:[ |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
515 |
Smalltalk at:#ScheduledWindow put:cls |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
516 |
]. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
517 |
(cls := Smalltalk at:#Socket) notNil ifTrue:[ |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
518 |
Smalltalk at:#UnixSocketAccessor put:cls. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
519 |
Smalltalk at:#SocketAccessor put:cls. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
520 |
Smalltalk at:#SocketAccessorByAddress put:cls. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
521 |
]. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
522 |
Smalltalk at:#BlockClosure put:Block. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
523 |
Smalltalk at:#CompiledMethod put:Method. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
524 |
(cls := Smalltalk at:#DialogBox) notNil ifTrue:[ |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
525 |
Smalltalk at:#Dialog put:cls. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
526 |
Smalltalk at:#DialogView put:cls. |
397 | 527 |
Smalltalk at:#FillInTheBlank put:cls. |
358
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
528 |
]. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
529 |
Smalltalk at:#ByteString put:String. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
530 |
Smalltalk at:#ByteSymbol put:Symbol. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
531 |
Smalltalk at:#ByteEncodedString put:String. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
532 |
Smalltalk at:#Console put:Stderr. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
533 |
Smalltalk at:#HandlerList put:HandlerCollection. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
534 |
Smalltalk at:#SignalCollection put:SignalSet. |
424
4b6de7399a42
ProgrsssWidgetSpec alias (VW compat)
Claus Gittinger <cg@exept.de>
parents:
416
diff
changeset
|
535 |
(cls := Smalltalk at:#ProgressIndicatorSpec) notNil ifTrue:[ |
4b6de7399a42
ProgrsssWidgetSpec alias (VW compat)
Claus Gittinger <cg@exept.de>
parents:
416
diff
changeset
|
536 |
Smalltalk at:#ProgressWidgetSpec put:cls. |
4b6de7399a42
ProgrsssWidgetSpec alias (VW compat)
Claus Gittinger <cg@exept.de>
parents:
416
diff
changeset
|
537 |
]. |
428 | 538 |
(cls := Smalltalk at:#ProgressIndicator) notNil ifTrue:[ |
539 |
Smalltalk at:#ProgressWidgetView put:cls. |
|
540 |
]. |
|
358
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
541 |
|
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
542 |
"/ FileDirectory notNil ifTrue:[ |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
543 |
"/ Smalltalk at:#Disk put:(Filename rootDirectory) |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
544 |
"/ ]. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
545 |
|
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
546 |
Screen notNil ifTrue:[ |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
547 |
Smalltalk at:#Window put:Screen. |
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
548 |
Smalltalk at:#Sensor put:Screen default. |
358
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
549 |
]. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
550 |
|
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
551 |
"/ |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
552 |
"/ ST/X has (currently) no Double, but Float is what ST-80's Double is ... |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
553 |
"/ |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
554 |
Smalltalk at:#Double put:Float. |
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
555 |
|
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
556 |
Smalltalk at:#Browser put:SystemBrowser. |
1419 | 557 |
|
558 |
"/ |
|
559 |
"/ some ANSI name aliases |
|
560 |
"/ |
|
561 |
(Smalltalk includesKey:#DateAndTime) ifFalse:[ |
|
562 |
Smalltalk at:#DateAndTime put:Timestamp. |
|
563 |
]. |
|
564 |
(Smalltalk includesKey:#Duration) ifFalse:[ |
|
565 |
Smalltalk at:#Duration put:TimeDuration. |
|
566 |
]. |
|
567 |
||
358
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
355
diff
changeset
|
568 |
! |
686 | 569 |
|file| |
143
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
570 |
|
71dc5ec7ef26
Renamed NewLauncher to Launcher.
Stefan Vogel <sv@exept.de>
parents:
133
diff
changeset
|
571 |
"/ |
41 | 572 |
"/ read private (per user) stuff |
25 | 573 |
"/ |
632
6cb9fe000c20
-F arg to allow other than private.rc
Claus Gittinger <cg@exept.de>
parents:
617
diff
changeset
|
574 |
(Smalltalk commandLine includes:'-F') ifTrue:[ |
6cb9fe000c20
-F arg to allow other than private.rc
Claus Gittinger <cg@exept.de>
parents:
617
diff
changeset
|
575 |
|idx file| |
6cb9fe000c20
-F arg to allow other than private.rc
Claus Gittinger <cg@exept.de>
parents:
617
diff
changeset
|
576 |
|
6cb9fe000c20
-F arg to allow other than private.rc
Claus Gittinger <cg@exept.de>
parents:
617
diff
changeset
|
577 |
idx := Smalltalk commandLine indexOf:'-F'. |
6cb9fe000c20
-F arg to allow other than private.rc
Claus Gittinger <cg@exept.de>
parents:
617
diff
changeset
|
578 |
file := Smalltalk commandLine at:idx + 1. |
6cb9fe000c20
-F arg to allow other than private.rc
Claus Gittinger <cg@exept.de>
parents:
617
diff
changeset
|
579 |
] ifFalse:[ |
686 | 580 |
file := 'private.rc'. |
632
6cb9fe000c20
-F arg to allow other than private.rc
Claus Gittinger <cg@exept.de>
parents:
617
diff
changeset
|
581 |
]. |
686 | 582 |
('smalltalk.rc [info]: reading ''' , file , '''...') infoPrintCR. |
583 |
Smalltalk fileIn:file. |
|
5 | 584 |
|
1246
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
585 |
! |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
586 |
|
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
587 |
"JV@2012-05-03: Search system path for rc.d directories, collect all *.rc files |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
588 |
and then file them in a lexical order" |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
589 |
|
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
590 |
| rcDFiles | |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
591 |
|
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
592 |
rcDFiles := SortedCollection sortBlock:[:a :b|a baseName < b baseName]. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
593 |
|
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
594 |
Smalltalk realSystemPath ? #() do:[:syspath| |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
595 |
| rcD | |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
596 |
|
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
597 |
rcD := syspath asFilename / 'rc.d'. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
598 |
rcD exists ifTrue:[ |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
599 |
rcD directoryContentsAsFilenames do:[:each| |
1431
691727155921
Avoid reading rc.d files twice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1428
diff
changeset
|
600 |
each suffix = 'rc' ifTrue:[ |
691727155921
Avoid reading rc.d files twice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1428
diff
changeset
|
601 |
| eachAbs | |
691727155921
Avoid reading rc.d files twice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1428
diff
changeset
|
602 |
|
691727155921
Avoid reading rc.d files twice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1428
diff
changeset
|
603 |
eachAbs := each asAbsoluteFilename. |
691727155921
Avoid reading rc.d files twice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1428
diff
changeset
|
604 |
(rcDFiles includes: eachAbs) ifFalse:[ |
691727155921
Avoid reading rc.d files twice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1428
diff
changeset
|
605 |
rcDFiles add: eachAbs. |
691727155921
Avoid reading rc.d files twice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1428
diff
changeset
|
606 |
] |
691727155921
Avoid reading rc.d files twice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1428
diff
changeset
|
607 |
] |
1246
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
608 |
]. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
609 |
]. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
610 |
]. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
611 |
|
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
612 |
rcDFiles do:[:each| |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
613 |
'smalltalk.rc [info]: reading ' infoPrint. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
614 |
each baseName infoPrint. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
615 |
'...' infoPrint. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
616 |
( AbortOperationRequest , TerminateProcessRequest , Parser parseErrorSignal ) handle:[:ex | |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
617 |
'FAILED: ' errorPrint. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
618 |
ex description errorPrintCR. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
619 |
ex return. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
620 |
] do:[ |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
621 |
each fileIn. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
622 |
'OK' infoPrintCR. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
623 |
]. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
624 |
]. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
625 |
|
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
626 |
! |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
627 |
|
488
521e2d58f050
Changed workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
475
diff
changeset
|
628 |
Screen notNil ifTrue:[ |
441 | 629 |
"/ |
630 |
"/ read saved configuration settings (if any) |
|
631 |
"/ |
|
1364
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
632 |
| idx | |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
633 |
|
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
634 |
idx := Smalltalk commandLineArguments indexOf: '--no-preferences'. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
635 |
idx ~~ 0 ifTrue:[ |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
636 |
Smalltalk commandLineArguments removeAtIndex: idx. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
637 |
] ifFalse:[ |
1246
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
638 |
|
1364
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
639 |
'smalltalk.rc [info]: reading preferences ' infoPrint. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
640 |
( AbortOperationRequest , TerminateProcessRequest , Parser parseErrorSignal ) handle:[:ex | |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
641 |
'READ FAILED: ' errorPrint. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
642 |
ex description errorPrintCR. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
643 |
ex return. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
644 |
1 halt. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
645 |
] do:[ |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
646 |
"JV@2012-03-07: Try following settings files: |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
647 |
$HOME/.smalltalk/settings.stx |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
648 |
$HOME/.smalltalk/settings.rc |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
649 |
$PWD/settings.stx |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
650 |
$PWD/settings.rc |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
651 |
|
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
652 |
in that order. Whichever is found, it is read and the rest |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
653 |
is not used. Also, path to the file which has beed read is |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
654 |
stored in 'UserPreferences current at:#settingsFilename' |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
655 |
" |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
656 |
| files continue | |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
657 |
|
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
658 |
files := nil. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
659 |
|
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
660 |
idx := Smalltalk commandLineArguments indexOf: '--preferences'. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
661 |
idx ~~ 0 ifTrue:[ |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
662 |
| file | |
1246
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
663 |
|
1364
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
664 |
Smalltalk commandLineArguments size <= idx ifTrue:[ |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
665 |
'' errorPrintCR. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
666 |
'smalltalk.rc [error]: --preferences requires an argument, none given' errorPrintCR. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
667 |
Smalltalk exit: 1. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
668 |
]. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
669 |
file := (Smalltalk commandLineArguments at: idx + 1) asFilename. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
670 |
file exists ifFalse:[ |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
671 |
'' errorPrintCR. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
672 |
('smalltalk.rc [error]: preference file ''', file pathName,''' does not exist') errorPrintCR. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
673 |
Smalltalk exit: 1. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
674 |
]. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
675 |
file isDirectory ifTrue:[ |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
676 |
'' errorPrintCR. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
677 |
('smalltalk.rc [error]: preference file ''', file pathName,''' is not a regular file') errorPrintCR. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
678 |
Smalltalk exit: 1. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
679 |
]. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
680 |
file isReadable ifFalse:[ |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
681 |
'' errorPrintCR. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
682 |
('smalltalk.rc [error]: preference file ''', file pathName,''' is not a readable (check permissions)') errorPrintCR. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
683 |
Smalltalk exit: 1. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
684 |
]. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
685 |
files := Array with: file. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
686 |
Smalltalk commandLineArguments removeAtIndex: idx + 1. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
687 |
Smalltalk commandLineArguments removeAtIndex: idx. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
688 |
]. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
689 |
files isNil ifTrue:[ |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
690 |
files := { |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
691 |
(Filename homeDirectory / '.smalltalk' / 'settings.stx') . "/ per-user settings file (new default?) |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
692 |
(Filename homeDirectory / '.smalltalk' / 'settings.rc') . "/ for backward compatibility with jv-branch |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
693 |
(Smalltalk getSystemFileName: 'settings.stx') . "/ old stx default |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
694 |
(Smalltalk getSystemFileName: 'settings.rc') . "/ for backward compatibility with jv-branch |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
695 |
}. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
696 |
]. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
697 |
continue := true. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
698 |
files do:[:each| |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
699 |
| eachFile | |
1246
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
700 |
|
1364
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
701 |
(continue and:[each notNil and:[(eachFile := each asFilename) exists]]) ifTrue:[ |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
702 |
continue := false. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
703 |
eachFile pathName infoPrintCR. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
704 |
eachFile fileIn. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
705 |
UserPreferences current at:#settingsFilename put: eachFile pathName. |
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
706 |
]. |
1246
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
707 |
]. |
1364
ab2a726d83e8
Added --no-preferences and --preferences options.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1362
diff
changeset
|
708 |
continue ifTrue:[ '(none found)' infoPrintCR ]. |
1246
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
709 |
]. |
357edb85942f
- settings reading improved - searches also ~/.smalltalk/settings.stx
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1112
diff
changeset
|
710 |
]. |
933 | 711 |
]. |
355
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
712 |
! |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
713 |
|
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
714 |
"/ |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
715 |
"/ just a quick check, if this ST/X installation seems to |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
716 |
"/ be halfway complete (it happened to some people, that |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
717 |
"/ their source/resource directories were not installed) |
609 | 718 |
"/ - better to warn early ... |
355
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
719 |
"/ |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
720 |
|anyWrong missing| |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
721 |
Smalltalk isStandAloneApp ifFalse:[ |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
722 |
anyWrong := false. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
723 |
missing := ''. |
409 | 724 |
|
725 |
"/ |
|
726 |
"/ no longer needed - if we have the package, |
|
727 |
"/ we also have the resources ... |
|
728 |
"/ |
|
729 |
"/ (Smalltalk getResourceFileName:'SystemBrowser.rs' forClass:SystemBrowser) isNil ifTrue:[ |
|
730 |
"/ '***********************************************************************' errorPrintCR. |
|
731 |
"/ '***** ATTENTION: please check installation of your >>resource<< files' errorPrintCR. |
|
732 |
"/ '***** I will not be able to give non-english messages' errorPrintCR. |
|
733 |
"/ anyWrong := true. |
|
734 |
"/ missing := '''resources'' '. |
|
735 |
"/ ]. |
|
736 |
||
737 |
"/ |
|
738 |
"/ no longer needed - if we have the package, |
|
739 |
"/ we also have the styles ... |
|
740 |
"/ |
|
741 |
"/ (Smalltalk getResourceFileName:'normal.style' forClass:View) isNil ifTrue:[ |
|
742 |
"/ '***********************************************************************' errorPrintCR. |
|
743 |
"/ '***** ATTENTION: please check installation of your >>style<< files' errorPrintCR. |
|
744 |
"/ '***** I will use a plain b&w viewStyle as a fallBack' errorPrintCR. |
|
745 |
"/ anyWrong := true. |
|
746 |
"/ missing := missing , '''resources'' '. |
|
747 |
"/ ]. |
|
748 |
||
686 | 749 |
(Smalltalk getPackageFileName:'stx/libbasic/source/Object.st') isNil and:[ |
750 |
(Smalltalk getPackageFileName:'stx/libbasic/Object.st') isNil and:[ |
|
751 |
(Smalltalk getSystemFileName:'source/Object.st') isNil and:[ |
|
752 |
(Smalltalk getSystemFileName:'source/source.zip') isNil and:[ |
|
753 |
(Smalltalk getSystemFileName:'source/libbasic.zip') isNil and:[ |
|
754 |
(Smalltalk getSourceFileName:'libbasic/Object.st') isNil and:[ |
|
355
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
755 |
"/ |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
756 |
"/ there may still be a SourceCodeManager ... |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
757 |
"/ |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
758 |
(Smalltalk at:#SourceCodeManager) isNil ifTrue:[ |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
759 |
'***********************************************************************' errorPrintCR. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
760 |
'***** ATTENTION: please check installation of your >>source<< files' errorPrintCR. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
761 |
'***** ' errorPrintCR. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
762 |
'***** the browser/debugger may not be able to show sourcecode.' errorPrintCR. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
763 |
'***** Also, autoloading may fail if sourceFiles are missing.' errorPrintCR. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
764 |
anyWrong := true. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
765 |
missing := missing , '''source'' '. |
686 | 766 |
]]]]]]]. |
409 | 767 |
|
768 |
"/ |
|
769 |
"/ no longer needed - if we have the package, |
|
770 |
"/ we also have the bitmaps ... |
|
771 |
"/ |
|
772 |
"/ (Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool') isNil ifTrue:[ |
|
773 |
"/ '***********************************************************************' errorPrintCR. |
|
774 |
"/ '***** ATTENTION: please check installation of your >>bitmap<< files' errorPrintCR. |
|
775 |
"/ anyWrong := true. |
|
776 |
"/ missing := missing , '''bitmaps'' '. |
|
777 |
"/ ]. |
|
355
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
778 |
|
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
779 |
anyWrong ifTrue:[ |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
780 |
'*****' errorPrintCR. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
781 |
'***** directory(s) named: ' errorPrint. missing errorPrint. 'incomplete/not existing' errorPrintCR. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
782 |
'***** I could not find the missing directory along your path,' errorPrintCR. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
783 |
'***** which is:' errorPrintCR. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
784 |
Smalltalk systemPath do:[:dir | |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
785 |
('***** ' , dir storeString) errorPrintCR. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
786 |
]. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
787 |
|
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
788 |
'*****' errorPrintCR. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
789 |
'***** Try: "make source bitmaps resources styles"' errorPrintCR. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
790 |
'***** or: "make symlinks" to fix this.' errorPrintCR. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
791 |
'***********************************************************************' errorPrintCR. |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
792 |
] |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
793 |
] |
007bd12bd854
check for source access possible AFTER reading private.rc
Claus Gittinger <cg@exept.de>
parents:
336
diff
changeset
|
794 |
! |
169 | 795 |
|
796 |
"/ |
|
797 |
"/ set the package to some useful default |
|
798 |
"/ |
|
799 |
Project notNil ifTrue:[ |
|
800 |
Project setDefaultProject. |
|
443 | 801 |
"/ Project current package:#'private'. |
169 | 802 |
]. |
803 |
||
804 |
"/ |
|
152 | 805 |
"/ if error occurs, and debugger has problems coming up, |
806 |
"/ uncomment the following ... |
|
25 | 807 |
"/ |
10 | 808 |
"/ Debugger := MiniDebugger. |
0 | 809 |
|
1422 | 810 |
|
811 |
"/ |
|
812 |
"/ load initial packages |
|
813 |
"/ |
|
814 |
UserPreferences current autoloadedPackages notEmpty ifTrue:[ |
|
1428 | 815 |
(Smalltalk commandLineArguments includesAny:#('--noAutoload' '--noautoload')) ifTrue:[ |
1426 | 816 |
'smalltalk.rc [info]: autoloaded packages suppressed.' infoPrintCR. |
817 |
] ifFalse:[ |
|
1422 | 818 |
'smalltalk.rc [info]: loading autoloaded packages...' infoPrintCR. |
819 |
(UserPreferences current autoloadedPackages) do:[:eachPackage | |
|
1424
602b53d13b37
splash message when autoloading packages
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
820 |
Smalltalk showSplashMessage:('Autoloading ',eachPackage,'...'). |
1425 | 821 |
Error handle:[:ex | |
1457 | 822 |
('smalltalk.rc [error]: error while autoloading package: ',eachPackage) errorPrintCR. |
1425 | 823 |
] do:[ |
824 |
Smalltalk loadPackage:eachPackage. |
|
825 |
] |
|
1422 | 826 |
]. |
1424
602b53d13b37
splash message when autoloading packages
Claus Gittinger <cg@exept.de>
parents:
1422
diff
changeset
|
827 |
Smalltalk showSplashMessage:('done.'). |
1426 | 828 |
] |
1422 | 829 |
]. |
830 |
||
152 | 831 |
"/ |
832 |
"/ save an initial image; this will speedup the next startup |
|
833 |
"/ (since all autoload-stuff will already be initialized) |
|
834 |
"/ |
|
672 | 835 |
((Smalltalk commandLineArguments includes:'--quick') |
686 | 836 |
or:[(Smalltalk commandLineArguments includes:'--faststart') |
837 |
or:[(Smalltalk commandLineArguments includes:'--fastStart') |
|
838 |
or:[(Smalltalk isPlugin) |
|
672 | 839 |
]]]) ifFalse:[ |
1384 | 840 |
('st.img' asFilename exists not and:[Filename currentDirectory isWritable]) ifTrue:[ |
686 | 841 |
|doneWithStartupStuff| |
153 | 842 |
|
686 | 843 |
doneWithStartupStuff := Semaphore new. |
609 | 844 |
|
686 | 845 |
Smalltalk addStartBlock:[ |
846 |
[ |
|
847 |
doneWithStartupStuff wait. |
|
848 |
'smalltalk.rc [info]: saving initial image for faster future startup...' infoPrintCR. |
|
849 |
ObjectMemory primSnapShotOn:'st.img' |
|
850 |
] forkAt:1. |
|
851 |
[ |
|
852 |
Delay waitForSeconds:10. |
|
853 |
doneWithStartupStuff signal |
|
854 |
] forkAt:1. |
|
855 |
]. |
|
856 |
]. |
|
672 | 857 |
]. |