author | Claus Gittinger <cg@exept.de> |
Wed, 20 Mar 2013 20:43:29 +0100 | |
changeset 1306 | 2581c10f1fff |
parent 1295 | b7f03a0eba28 |
child 1308 | d073f0290d60 |
permissions | -rw-r--r-- |
0 | 1 |
"* |
609 | 2 |
* Encoding: iso8859-1 |
3 |
* |
|
0 | 4 |
* $Header$ |
5 | 5 |
* |
209 | 6 |
* ST/X startup configuration file: |
7 |
* |
|
5 | 8 |
* DONT add site specific things here - use your own h_xxx.rc file instead |
8 | 9 |
* where xxx stands for your hostname(s) |
5 | 10 |
* |
0 | 11 |
* startup configuration for host specific stuff - |
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
12 |
* looks for a system specific h_sysType.rc init file and loads it. |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
13 |
* looks for a host specific h_hostName.rc init file and loads it. |
0 | 14 |
*" |
1243
1fc6b3f01e48
End chung after initial comment / encoding spec
Stefan Vogel <sv@exept.de>
parents:
1126
diff
changeset
|
15 |
! |
1306 | 16 |
|sysType host domain s rshCommand isStupidSYSV3 conf includes incDir ps| |
177
eec6bac738ba
stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents:
169
diff
changeset
|
17 |
|
eec6bac738ba
stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents:
169
diff
changeset
|
18 |
sysType := OperatingSystem getSystemType. |
eec6bac738ba
stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents:
169
diff
changeset
|
19 |
isStupidSYSV3 := false. |
0 | 20 |
|
177
eec6bac738ba
stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents:
169
diff
changeset
|
21 |
sysType = 'realIX' ifTrue:[ |
eec6bac738ba
stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents:
169
diff
changeset
|
22 |
"/ |
eec6bac738ba
stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents:
169
diff
changeset
|
23 |
"/ those people must have been brain-damaged; |
eec6bac738ba
stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents:
169
diff
changeset
|
24 |
"/ They made a whole lot of trouble by renaming |
eec6bac738ba
stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents:
169
diff
changeset
|
25 |
"/ 'rsh' to 'remsh' (those systems are broken in other places as well ...). |
eec6bac738ba
stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents:
169
diff
changeset
|
26 |
"/ (who needs a restricted shell named 'rsh' ?) |
eec6bac738ba
stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents:
169
diff
changeset
|
27 |
"/ |
eec6bac738ba
stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents:
169
diff
changeset
|
28 |
isStupidSYSV3 := true. |
eec6bac738ba
stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents:
169
diff
changeset
|
29 |
]. |
eec6bac738ba
stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents:
169
diff
changeset
|
30 |
|
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
31 |
"------------------------------------------------------------------------" |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
32 |
"/ printer setup |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
33 |
"/ Notice that this setup may be changed by an OS-specific h_xxx file |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
34 |
"/ |
239
610af02f6b7e
only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
35 |
"/ only reset the printer setting, if restarted |
610af02f6b7e
only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
36 |
"/ on another host. |
610af02f6b7e
only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
37 |
|
610af02f6b7e
only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
38 |
host := OperatingSystem getHostName. |
610af02f6b7e
only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
39 |
(Smalltalk at:#'_ImageHostName') ~= host ifTrue:[ |
952
435154ba084b
default printer setup for win32
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
40 |
sysType = 'win32' ifTrue:[ |
1306 | 41 |
Printer := Smalltalk at:#WinPrinterStream. |
952
435154ba084b
default printer setup for win32
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
42 |
] ifFalse:[ |
1306 | 43 |
Printer := Smalltalk at:#PostscriptPrinterStream. |
177
eec6bac738ba
stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents:
169
diff
changeset
|
44 |
]. |
932
910313a689a6
printer setup: default for win32
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
45 |
]. |
103
9f5c03497b38
example - checking for the domain
Claus Gittinger <cg@exept.de>
parents:
8
diff
changeset
|
46 |
|
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
47 |
"------------------------------------------------------------------------" |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
48 |
"/ default compiler setup; |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
49 |
"/ can be rechanged in a h_xxx file. |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
50 |
"/ |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
51 |
|
678 | 52 |
(Smalltalk wasStartedFromImage not |
53 |
and:[ Smalltalk isPlugin not ]) |
|
54 |
ifTrue:[ |
|
577
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
55 |
Compiler stcCompilation:#default. |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
56 |
Compiler stcCompilationOptions:'+optinline +inlineNew'. |
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
57 |
|
577
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
58 |
"/ |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
59 |
"/ setup for gcc (which is OK for most systems); |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
60 |
"/ Notice that this setup may be changed by an OS-specific h_xxx file |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
61 |
"/ |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
62 |
conf := Smalltalk configuration. |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
63 |
(conf includesString:'gcc') ifTrue:[ |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
64 |
Compiler ccPath:'gcc' |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
65 |
] ifFalse:[ |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
66 |
Compiler ccPath:'cc' |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
67 |
]. |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
68 |
Compiler ccCompilationOptions:'-O'. |
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
69 |
|
1126 | 70 |
(conf includesString:'amd64_mode32') ifTrue:[ |
71 |
(ObjectFileLoader linkArgs includesString:'-m32') ifFalse:[ |
|
72 |
ObjectFileLoader linkArgs:(ObjectFileLoader linkArgs , ' -m32 -m elf_i386'). |
|
73 |
]. |
|
74 |
(Compiler ccCompilationOptions includesString:'-m32') ifFalse:[ |
|
75 |
Compiler ccCompilationOptions:(Compiler ccCompilationOptions , ' -m32'). |
|
76 |
]. |
|
77 |
(Compiler stcCompilationDefines includesString:'-D__amd64_mode32__') ifFalse:[ |
|
78 |
Compiler stcCompilationDefines:(Compiler stcCompilationDefines , ' -D__amd64_mode32__'). |
|
79 |
]. |
|
80 |
]. |
|
81 |
||
577
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
82 |
includes := ''. |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
83 |
incDir := Smalltalk getSystemFileName:'include'. |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
84 |
incDir notNil ifTrue:[ |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
85 |
includes := includes , '-I' , incDir asFilename pathName , ' ' |
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
86 |
] ifFalse:[ |
677 | 87 |
('../../../stx/include' asFilename exists) ifTrue:[ |
88 |
"/ running in a development environment ... |
|
89 |
includes := includes , '-I../../../stx/include '. |
|
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
90 |
] ifFalse:[ |
677 | 91 |
"/ if this is a production program, dont care for a warning |
92 |
(Smalltalk isStandAloneApp or:[Smalltalk isHeadless]) |
|
93 |
ifFalse:[ |
|
94 |
'host.rc [warning]: no >>include<< directory found along your path.' infoPrintCR. |
|
95 |
'host.rc [warning]: this might affect stc-compilation from within the browser.' infoPrintCR. |
|
405 | 96 |
] |
677 | 97 |
] |
577
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
98 |
]. |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
99 |
|
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
100 |
Compiler stcCompilationIncludes:includes. |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
101 |
|
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
102 |
"/ |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
103 |
"/ for myself: preset flags, so that we can accept GLXWorkstation code |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
104 |
"/ You probably will never do this. |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
105 |
"/ |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
106 |
(Display notNil and:[Display supportsGLDrawing]) ifTrue:[ |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
107 |
sysType = 'irix' ifTrue:[ |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
108 |
Compiler stcCompilationDefines:'-DGLX'. |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
109 |
] ifFalse:[ |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
110 |
Compiler stcCompilationIncludes:'-I../../include -I../../support/VGL/vogl/src'. |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
111 |
Compiler stcCompilationDefines:'-DVGL'. |
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
112 |
] |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
113 |
]. |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
114 |
]. |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
115 |
|
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
116 |
"/ |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
117 |
"/ try systemType-specific setup |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
118 |
"/ h_<osType>.rc |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
119 |
"/ |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
120 |
(Smalltalk at:#'_ImageOSTypeName') ~= sysType ifTrue:[ |
333 | 121 |
('host.rc [info]: ') infoPrint. |
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
122 |
|
1295 | 123 |
"/ ('trying host setup h_' , sysType , '.rc...') infoPrintCR. |
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
124 |
s := Smalltalk systemFileStreamFor:('h_' , sysType , '.rc'). |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
125 |
s notNil ifTrue:[ |
1295 | 126 |
('reading host setup h_' , sysType , '.rc...') infoPrintCR. |
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
127 |
s fileIn. |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
128 |
s close. |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
129 |
]. |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
130 |
Smalltalk at:#'_ImageOSTypeName' put:host. |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
131 |
]. |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
132 |
|
165 | 133 |
"/ |
134 |
"/ try host-specific setup |
|
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
135 |
"/ h_<hostname>.rc |
165 | 136 |
"/ |
2 | 137 |
host isNil ifTrue:[ |
195 | 138 |
'host.rc [warning]: cannot determine host I am running on' errorPrintCR. |
2 | 139 |
] ifFalse:[ |
0 | 140 |
"if there is a corresponding file ..." |
103
9f5c03497b38
example - checking for the domain
Claus Gittinger <cg@exept.de>
parents:
8
diff
changeset
|
141 |
|
5 | 142 |
(Smalltalk at:#'_ImageHostName') ~= host ifTrue:[ |
1295 | 143 |
"/ ('host.rc [info]: trying host setup h_' , host , '.rc...') infoPrintCR. |
5 | 144 |
|
8 | 145 |
s := Smalltalk systemFileStreamFor:('h_' , host , '.rc'). |
146 |
s notNil ifTrue:[ |
|
1295 | 147 |
('host.rc [info]: reading host setup h_' , host , '.rc...') infoPrintCR. |
8 | 148 |
s fileIn. |
149 |
s close. |
|
150 |
]. |
|
151 |
Smalltalk at:#'_ImageHostName' put:host. |
|
0 | 152 |
] |
153 |
]. |
|
154 |
! |