author | Claus Gittinger <cg@exept.de> |
Mon, 17 Sep 2018 16:09:24 +0200 | |
changeset 1573 | 1ca3df2d6317 |
parent 1430 | b02e9366f9fc |
child 1440 | b822d6dc20e7 |
child 1595 | 4049d133aef2 |
permissions | -rw-r--r-- |
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1 |
"* |
609 | 2 |
* Encoding: iso8859-1 |
3 |
* |
|
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4 |
* $Header$ |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5 |
* |
399 | 6 |
* MIMEType: application/x-smalltalk-source |
7 |
* |
|
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
8 |
* ST/X startup configuration file - for win95, win98 and winNT OS. |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
9 |
* |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
10 |
* DONT add site specific things here - use your own h_xxx.rc file instead |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
11 |
* where xxx stands for your hostname(s) |
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
12 |
*" |
1243
1fc6b3f01e48
End chung after initial comment / encoding spec
Stefan Vogel <sv@exept.de>
parents:
921
diff
changeset
|
13 |
! |
357
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
14 |
"/ look in registry for LibDir ... |
723 | 15 |
|k rel curr libDir| |
357
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
16 |
|
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
17 |
rel := Smalltalk versionString. |
672 | 18 |
k := Win32OperatingSystem registryEntry key:('HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\',rel). |
357
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
19 |
k isNil ifTrue:[ |
672 | 20 |
k := Win32OperatingSystem registryEntry key:'HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X'. |
357
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
21 |
k notNil ifTrue:[ |
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
22 |
curr := k valueNamed:'CurrentVersion'. |
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
23 |
curr isString ifTrue:[ |
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
24 |
k close. |
672 | 25 |
k := Win32OperatingSystem registryEntry key:('HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\',curr). |
357
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
26 |
] |
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
27 |
] |
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
28 |
]. |
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
29 |
k notNil ifTrue:[ |
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
30 |
libDir := k valueNamed:'LibDir'. |
410 | 31 |
(libDir notNil and:[libDir asFilename exists]) ifTrue:[ |
670 | 32 |
(Smalltalk systemPath includes:(libDir asFilename pathName)) ifFalse:[ |
33 |
Smalltalk systemPath addFirst:(libDir asFilename pathName). |
|
34 |
Smalltalk flushPathCaches |
|
35 |
] |
|
357
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
36 |
]. |
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
37 |
k close. |
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
38 |
]. |
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
39 |
! |
dc01b7bc319e
add LibDir setting from registry to systemPath
Claus Gittinger <cg@exept.de>
parents:
331
diff
changeset
|
40 |
|
1294 | 41 |
|incl libs tryPathesForBin path usedCompiler |
1301 | 42 |
bccPath msvcPath mingw64Path mingw32Path |
1294 | 43 |
searchedLibraries |
44 |
linkCommand linkArgs ccCommand ccCompilationOptions |
|
45 |
| |
|
478 | 46 |
|
669 | 47 |
false "Smalltalk wasStartedFromImage" ifFalse:[ |
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
48 |
|
577
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
478
diff
changeset
|
49 |
incl := #( |
1294 | 50 |
'-I..\..\include' |
51 |
"/ '-I..\..\libopengl' |
|
577
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
478
diff
changeset
|
52 |
). |
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
478
diff
changeset
|
53 |
|
1294 | 54 |
tryPathesForBin := [:pathes | |
1304 | 55 |
|foundPath| |
56 |
pathes do:[:eachPath | |
|
57 |
|thisPath| |
|
58 |
||
1305 | 59 |
(thisPath := eachPath asFilename) exists ifTrue:[ |
1304 | 60 |
foundPath := thisPath |
1294 | 61 |
]. |
62 |
]. |
|
1304 | 63 |
foundPath |
1294 | 64 |
]. |
65 |
||
66 |
"/ |
|
67 |
"/ right now, stx can be used with one of: |
|
68 |
"/ - borland C-compiler (bcc32). |
|
69 |
"/ - visual studio C (actually: SDK) (msc) |
|
70 |
"/ - mingw64 gcc |
|
71 |
||
1418 | 72 |
"/ uncomment one of the following to enforce a compiler |
73 |
"/ bccPath := 'C:\borland\bcc55\bin'. |
|
74 |
"/ msvcPath := 'C:\Programme\Microsoft Visual Studio 10.0\VC\bin'. |
|
75 |
"/ mingw64Path := 'C:\mingw64\bin'. |
|
76 |
"/ mingw32Path := 'C:\mingw\bin'. |
|
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
77 |
|
1294 | 78 |
"/ or take a look what we find installed: |
79 |
path := (OperatingSystem getEnvironment:'PATH') asCollectionOfSubstringsSeparatedBy:$;. |
|
80 |
ExternalBytes sizeofPointer == 8 ifTrue:[ |
|
1418 | 81 |
mingw64Path := path detect:[:d | d asLowercase includesString:'mingw'] ifNone:nil. |
1301 | 82 |
mingw64Path isNil ifTrue:[ |
83 |
mingw64Path := tryPathesForBin value: |
|
1294 | 84 |
#( |
1305 | 85 |
'C:\Programme\mingw64\bin' |
1430 | 86 |
'C:\Programme\mingw-w64\mingw64\bin' |
87 |
'C:\Programme\mingw-w64\mingw\bin' |
|
1305 | 88 |
'C:\Programs\mingw64\bin' |
1430 | 89 |
'C:\Programs\mingw-w64\mingw64\bin' |
90 |
'C:\Programs\mingw-w64\mingw\bin' |
|
1305 | 91 |
'C:\Program Files\mingw64\bin' |
1430 | 92 |
'C:\Program Files\mingw-w64\mingw64\bin' |
93 |
'C:\Program Files\mingw-w64\mingw\bin' |
|
1305 | 94 |
'C:\mingw64\bin' |
1430 | 95 |
'C:\mingw-w64\mingw64\bin' |
1294 | 96 |
). |
669 | 97 |
]. |
1294 | 98 |
] ifFalse:[ |
1418 | 99 |
mingw32Path := path detect:[:d | d asLowercase includesString:'mingw'] ifNone:nil. |
100 |
mingw32Path isNil ifTrue:[ |
|
101 |
mingw32Path := tryPathesForBin value: |
|
102 |
#( |
|
103 |
'C:\Programme\mingw\bin' |
|
1430 | 104 |
'C:\Programme\mingw-w32\mingw32\bin' |
105 |
'C:\Programme\mingw-w32\mingw\bin' |
|
1418 | 106 |
'C:\Programs\mingw\bin' |
1430 | 107 |
'C:\Programs\mingw-w32\mingw32\bin' |
108 |
'C:\Programs\mingw-w32\mingw\bin' |
|
1418 | 109 |
'C:\Program Files\mingw\bin' |
1430 | 110 |
'C:\Program Files\mingw-w32\mingw32\bin' |
111 |
'C:\Program Files\mingw-w32\mingw\bin' |
|
1418 | 112 |
'C:\mingw\bin' |
1430 | 113 |
'C:\mingw-w32\mingw32\bin' |
114 |
'C:\mingw-w32\mingw\bin' |
|
1418 | 115 |
). |
116 |
]. |
|
117 |
||
1294 | 118 |
bccPath := path detect:[:d | d asLowercase includesString:'borland'] ifNone:nil. |
119 |
bccPath isNil ifTrue:[ |
|
120 |
bccPath := tryPathesForBin value: |
|
121 |
#( |
|
1305 | 122 |
'C:\Programme\borland\bcc55\bin' |
123 |
'C:\Programs\borland\bcc55\bin' |
|
124 |
'C:\Program Files\borland\bcc55\bin' |
|
125 |
'C:\borland\bcc55\bin' |
|
1294 | 126 |
). |
127 |
]. |
|
128 |
||
129 |
msvcPath isNil ifTrue:[ |
|
130 |
msvcPath := tryPathesForBin value: |
|
131 |
#( |
|
1305 | 132 |
'C:\Programme\Microsoft Visual Studio 11.0\VC\bin' |
133 |
'C:\Programme\Microsoft Visual Studio 10.0\VC\bin' |
|
134 |
'C:\Programme\Microsoft Visual Studio 9.0\VC\bin' |
|
135 |
'C:\Programme\Microsoft Visual Studio 8.0\VC\bin' |
|
136 |
'C:\Program Files\Microsoft Visual Studio 11.0\VC\bin' |
|
137 |
'C:\Program Files\Microsoft Visual Studio 10.0\VC\bin' |
|
138 |
'C:\Program Files\Microsoft Visual Studio 9.0\VC\bin' |
|
139 |
'C:\Program Files\Microsoft Visual Studio 8.0\VC\bin' |
|
1294 | 140 |
). |
669 | 141 |
]. |
577
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
478
diff
changeset
|
142 |
]. |
478 | 143 |
|
1294 | 144 |
bccPath notNil ifTrue:[ |
145 |
"/ borland |
|
146 |
ExternalBytes sizeofPointer == 8 ifTrue:[ |
|
1303 | 147 |
'host.rc [info]: ignore bcc32 compiler (cannot be used with 64 bit architecture)' infoPrintCR. |
1294 | 148 |
] ifFalse:[ |
149 |
'host.rc [info]: setup for borland bcc32 compiler' infoPrintCR. |
|
150 |
bccPath := bccPath asFilename. |
|
1309 | 151 |
"/ 'host.rc [info]: bccPath=' infoPrint. bccPath infoPrintCR. |
1305 | 152 |
ccCommand := (bccPath / 'bcc32') pathName. |
153 |
linkCommand := (bccPath / 'ilink32') pathName. |
|
1300 | 154 |
bccPath := bccPath directory. |
1310 | 155 |
'host.rc [info]: bccPath=' infoPrint. bccPath pathName infoPrintCR. |
1294 | 156 |
|
157 |
libs := #( |
|
158 |
'-L..\..\lib\bc' |
|
159 |
). |
|
160 |
||
161 |
incl := incl copyWith: ( '-I',(bccPath / 'include') pathName ). |
|
162 |
libs := libs copyWith: ( '-L',(bccPath / 'lib') pathName ). |
|
1305 | 163 |
(bccPath / 'lib' / 'psdk') exists ifTrue:[ |
164 |
libs := libs copyWith: ( '-L',(bccPath / 'lib' / 'psdk') pathName ). |
|
1294 | 165 |
]. |
166 |
ccCompilationOptions := '-w-'. |
|
167 |
searchedLibraries := #('import32.lib' 'odbc32.lib' 'glu32.lib' 'opengl32.lib'). |
|
168 |
||
169 |
libs := libs asStringWith:Character space. |
|
170 |
linkArgs := (libs , ' -r -c -ap -Tpd -Gi -w-dup'). |
|
171 |
incl := incl asStringWith:Character space. |
|
172 |
usedCompiler := 'bcc'. |
|
173 |
]. |
|
174 |
]. |
|
175 |
||
176 |
(usedCompiler isNil and:[msvcPath notNil]) ifTrue:[ |
|
177 |
"/ msvc |
|
178 |
ExternalBytes sizeofPointer == 8 ifTrue:[ |
|
1303 | 179 |
'host.rc [info]: ignore msvc compiler (cannot be used with 64 bit architecture)' infoPrintCR. |
1294 | 180 |
] ifFalse:[ |
181 |
'host.rc [info]: setup for msvc compiler' infoPrintCR. |
|
182 |
msvcPath := msvcPath asFilename. |
|
1305 | 183 |
ccCommand := (msvcPath / 'cl') pathName. |
184 |
linkCommand := (msvcPath / 'ilink32') pathName. |
|
1294 | 185 |
ccCompilationOptions := '/O1'. |
186 |
searchedLibraries := #('import32.lib' 'odbc32.lib' 'glu32.lib' 'opengl32.lib'). |
|
478 | 187 |
|
1294 | 188 |
libs := #( |
189 |
'-L..\..\lib\vc' |
|
190 |
). |
|
191 |
libs := libs asStringWith:Character space. |
|
192 |
linkArgs := (libs). |
|
193 |
incl := incl asStringWith:Character space. |
|
194 |
usedCompiler := 'msvc'. |
|
195 |
]. |
|
196 |
]. |
|
578
dfa929970bef
bugfix: do not overwrite compiler settings after restart from image
ca
parents:
577
diff
changeset
|
197 |
|
1301 | 198 |
usedCompiler isNil ifTrue:[ |
199 |
ExternalBytes sizeofPointer == 8 ifTrue:[ |
|
200 |
mingw64Path notNil ifTrue:[ |
|
201 |
"/ mingw64 |
|
202 |
'host.rc [info]: setup for mingw64 compiler' infoPrintCR. |
|
203 |
mingw64Path := mingw64Path asFilename. |
|
1305 | 204 |
ccCommand := (mingw64Path / 'gcc') pathName. |
205 |
linkCommand := (mingw64Path / 'gcc') pathName. |
|
206 |
mingw64Path := mingw64Path directory. |
|
1301 | 207 |
ccCompilationOptions := ''. |
1302 | 208 |
searchedLibraries := #('-lodbc32' '-lglu32' '-lopengl32'). |
1301 | 209 |
|
1302 | 210 |
libs := { |
211 |
'-L..\..\lib\mingw' . |
|
1304 | 212 |
( '-L',(mingw64Path / 'lib') pathName ) . |
1302 | 213 |
}. |
1301 | 214 |
libs := libs asStringWith:Character space. |
215 |
linkArgs := (libs). |
|
216 |
incl := incl asStringWith:Character space. |
|
217 |
usedCompiler := 'mingw'. |
|
218 |
]. |
|
1294 | 219 |
] ifFalse:[ |
1301 | 220 |
mingw32Path notNil ifTrue:[ |
221 |
"/ mingw32 |
|
222 |
'host.rc [info]: setup for mingw32 compiler' infoPrintCR. |
|
223 |
mingw32Path := mingw32Path asFilename. |
|
1305 | 224 |
ccCommand := (mingw32Path / 'gcc') pathName. |
225 |
linkCommand := (mingw32Path / 'gcc') pathName. |
|
226 |
mingw32Path := mingw32Path directory. |
|
1301 | 227 |
ccCompilationOptions := ''. |
1302 | 228 |
searchedLibraries := #('-lodbc32' '-lglu32' '-lopengl32'). |
1294 | 229 |
|
1302 | 230 |
libs := { |
231 |
'-L..\..\lib\mingw' . |
|
1305 | 232 |
( '-L',(mingw32Path / 'lib') pathName ) . |
1302 | 233 |
}. |
1301 | 234 |
libs := libs asStringWith:Character space. |
235 |
linkArgs := (libs). |
|
236 |
incl := incl asStringWith:Character space. |
|
237 |
usedCompiler := 'mingw'. |
|
238 |
]. |
|
1294 | 239 |
]. |
240 |
]. |
|
241 |
||
242 |
usedCompiler notNil ifTrue:[ |
|
243 |
ParserFlags ccPath:ccCommand. |
|
244 |
ParserFlags linkCommand:linkCommand. |
|
245 |
ParserFlags stcCompilationIncludes: incl. |
|
246 |
ParserFlags stcCompilationDefines: ''. |
|
247 |
ParserFlags stcCompilationOptions: '+optinline +inlineNew'. |
|
248 |
ParserFlags ccCompilationOptions: ccCompilationOptions. |
|
249 |
ParserFlags searchedLibraries:searchedLibraries. |
|
250 |
ParserFlags linkArgs: linkArgs. |
|
251 |
] |
|
478 | 252 |
]. |
366 | 253 |
|
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
254 |
! |