author | Claus Gittinger <cg@exept.de> |
Fri, 13 Jun 2014 10:16:44 +0200 | |
changeset 1353 | bf14ee2fde28 |
parent 1310 | 334663bda239 |
child 1403 | 4f390a9d33f9 |
child 1418 | 1c1e5f644a19 |
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 |
||
72 |
"/ uncomment one of the following |
|
1300 | 73 |
bccPath := 'C:\borland\bcc55\bin'. |
1305 | 74 |
msvcPath := 'C:\Programme\Microsoft Visual Studio 10.0\VC\bin'. |
75 |
mingw64Path := 'C:\mingw64\bin'. |
|
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
76 |
|
1294 | 77 |
"/ or take a look what we find installed: |
78 |
path := (OperatingSystem getEnvironment:'PATH') asCollectionOfSubstringsSeparatedBy:$;. |
|
79 |
ExternalBytes sizeofPointer == 8 ifTrue:[ |
|
1301 | 80 |
mingw64Path := path detect:[:d | d asLowercase includesString:'mingw64'] ifNone:nil. |
81 |
mingw64Path isNil ifTrue:[ |
|
82 |
mingw64Path := tryPathesForBin value: |
|
1294 | 83 |
#( |
1305 | 84 |
'C:\Programme\mingw64\bin' |
85 |
'C:\Programs\mingw64\bin' |
|
86 |
'C:\Program Files\mingw64\bin' |
|
87 |
'C:\mingw64\bin' |
|
1294 | 88 |
). |
669 | 89 |
]. |
1294 | 90 |
] ifFalse:[ |
91 |
bccPath := path detect:[:d | d asLowercase includesString:'borland'] ifNone:nil. |
|
92 |
bccPath isNil ifTrue:[ |
|
93 |
bccPath := tryPathesForBin value: |
|
94 |
#( |
|
1305 | 95 |
'C:\Programme\borland\bcc55\bin' |
96 |
'C:\Programs\borland\bcc55\bin' |
|
97 |
'C:\Program Files\borland\bcc55\bin' |
|
98 |
'C:\borland\bcc55\bin' |
|
1294 | 99 |
). |
100 |
]. |
|
101 |
||
102 |
msvcPath isNil ifTrue:[ |
|
103 |
msvcPath := tryPathesForBin value: |
|
104 |
#( |
|
1305 | 105 |
'C:\Programme\Microsoft Visual Studio 11.0\VC\bin' |
106 |
'C:\Programme\Microsoft Visual Studio 10.0\VC\bin' |
|
107 |
'C:\Programme\Microsoft Visual Studio 9.0\VC\bin' |
|
108 |
'C:\Programme\Microsoft Visual Studio 8.0\VC\bin' |
|
109 |
'C:\Program Files\Microsoft Visual Studio 11.0\VC\bin' |
|
110 |
'C:\Program Files\Microsoft Visual Studio 10.0\VC\bin' |
|
111 |
'C:\Program Files\Microsoft Visual Studio 9.0\VC\bin' |
|
112 |
'C:\Program Files\Microsoft Visual Studio 8.0\VC\bin' |
|
1294 | 113 |
). |
669 | 114 |
]. |
577
d574370a1da5
only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents:
478
diff
changeset
|
115 |
]. |
478 | 116 |
|
1294 | 117 |
bccPath notNil ifTrue:[ |
118 |
"/ borland |
|
119 |
ExternalBytes sizeofPointer == 8 ifTrue:[ |
|
1303 | 120 |
'host.rc [info]: ignore bcc32 compiler (cannot be used with 64 bit architecture)' infoPrintCR. |
1294 | 121 |
] ifFalse:[ |
122 |
'host.rc [info]: setup for borland bcc32 compiler' infoPrintCR. |
|
123 |
bccPath := bccPath asFilename. |
|
1309 | 124 |
"/ 'host.rc [info]: bccPath=' infoPrint. bccPath infoPrintCR. |
1305 | 125 |
ccCommand := (bccPath / 'bcc32') pathName. |
126 |
linkCommand := (bccPath / 'ilink32') pathName. |
|
1300 | 127 |
bccPath := bccPath directory. |
1310 | 128 |
'host.rc [info]: bccPath=' infoPrint. bccPath pathName infoPrintCR. |
1294 | 129 |
|
130 |
libs := #( |
|
131 |
'-L..\..\lib\bc' |
|
132 |
). |
|
133 |
||
134 |
incl := incl copyWith: ( '-I',(bccPath / 'include') pathName ). |
|
135 |
libs := libs copyWith: ( '-L',(bccPath / 'lib') pathName ). |
|
1305 | 136 |
(bccPath / 'lib' / 'psdk') exists ifTrue:[ |
137 |
libs := libs copyWith: ( '-L',(bccPath / 'lib' / 'psdk') pathName ). |
|
1294 | 138 |
]. |
139 |
ccCompilationOptions := '-w-'. |
|
140 |
searchedLibraries := #('import32.lib' 'odbc32.lib' 'glu32.lib' 'opengl32.lib'). |
|
141 |
||
142 |
libs := libs asStringWith:Character space. |
|
143 |
linkArgs := (libs , ' -r -c -ap -Tpd -Gi -w-dup'). |
|
144 |
incl := incl asStringWith:Character space. |
|
145 |
usedCompiler := 'bcc'. |
|
146 |
]. |
|
147 |
]. |
|
148 |
||
149 |
(usedCompiler isNil and:[msvcPath notNil]) ifTrue:[ |
|
150 |
"/ msvc |
|
151 |
ExternalBytes sizeofPointer == 8 ifTrue:[ |
|
1303 | 152 |
'host.rc [info]: ignore msvc compiler (cannot be used with 64 bit architecture)' infoPrintCR. |
1294 | 153 |
] ifFalse:[ |
154 |
'host.rc [info]: setup for msvc compiler' infoPrintCR. |
|
155 |
msvcPath := msvcPath asFilename. |
|
1305 | 156 |
ccCommand := (msvcPath / 'cl') pathName. |
157 |
linkCommand := (msvcPath / 'ilink32') pathName. |
|
1294 | 158 |
ccCompilationOptions := '/O1'. |
159 |
searchedLibraries := #('import32.lib' 'odbc32.lib' 'glu32.lib' 'opengl32.lib'). |
|
478 | 160 |
|
1294 | 161 |
libs := #( |
162 |
'-L..\..\lib\vc' |
|
163 |
). |
|
164 |
libs := libs asStringWith:Character space. |
|
165 |
linkArgs := (libs). |
|
166 |
incl := incl asStringWith:Character space. |
|
167 |
usedCompiler := 'msvc'. |
|
168 |
]. |
|
169 |
]. |
|
578
dfa929970bef
bugfix: do not overwrite compiler settings after restart from image
ca
parents:
577
diff
changeset
|
170 |
|
1301 | 171 |
usedCompiler isNil ifTrue:[ |
172 |
ExternalBytes sizeofPointer == 8 ifTrue:[ |
|
173 |
mingw64Path notNil ifTrue:[ |
|
174 |
"/ mingw64 |
|
175 |
'host.rc [info]: setup for mingw64 compiler' infoPrintCR. |
|
176 |
mingw64Path := mingw64Path asFilename. |
|
1305 | 177 |
ccCommand := (mingw64Path / 'gcc') pathName. |
178 |
linkCommand := (mingw64Path / 'gcc') pathName. |
|
179 |
mingw64Path := mingw64Path directory. |
|
1301 | 180 |
ccCompilationOptions := ''. |
1302 | 181 |
searchedLibraries := #('-lodbc32' '-lglu32' '-lopengl32'). |
1301 | 182 |
|
1302 | 183 |
libs := { |
184 |
'-L..\..\lib\mingw' . |
|
1304 | 185 |
( '-L',(mingw64Path / 'lib') pathName ) . |
1302 | 186 |
}. |
1301 | 187 |
libs := libs asStringWith:Character space. |
188 |
linkArgs := (libs). |
|
189 |
incl := incl asStringWith:Character space. |
|
190 |
usedCompiler := 'mingw'. |
|
191 |
]. |
|
1294 | 192 |
] ifFalse:[ |
1301 | 193 |
mingw32Path notNil ifTrue:[ |
194 |
"/ mingw32 |
|
195 |
'host.rc [info]: setup for mingw32 compiler' infoPrintCR. |
|
196 |
mingw32Path := mingw32Path asFilename. |
|
1305 | 197 |
ccCommand := (mingw32Path / 'gcc') pathName. |
198 |
linkCommand := (mingw32Path / 'gcc') pathName. |
|
199 |
mingw32Path := mingw32Path directory. |
|
1301 | 200 |
ccCompilationOptions := ''. |
1302 | 201 |
searchedLibraries := #('-lodbc32' '-lglu32' '-lopengl32'). |
1294 | 202 |
|
1302 | 203 |
libs := { |
204 |
'-L..\..\lib\mingw' . |
|
1305 | 205 |
( '-L',(mingw32Path / 'lib') pathName ) . |
1302 | 206 |
}. |
1301 | 207 |
libs := libs asStringWith:Character space. |
208 |
linkArgs := (libs). |
|
209 |
incl := incl asStringWith:Character space. |
|
210 |
usedCompiler := 'mingw'. |
|
211 |
]. |
|
1294 | 212 |
]. |
213 |
]. |
|
214 |
||
215 |
usedCompiler notNil ifTrue:[ |
|
216 |
ParserFlags ccPath:ccCommand. |
|
217 |
ParserFlags linkCommand:linkCommand. |
|
218 |
ParserFlags stcCompilationIncludes: incl. |
|
219 |
ParserFlags stcCompilationDefines: ''. |
|
220 |
ParserFlags stcCompilationOptions: '+optinline +inlineNew'. |
|
221 |
ParserFlags ccCompilationOptions: ccCompilationOptions. |
|
222 |
ParserFlags searchedLibraries:searchedLibraries. |
|
223 |
ParserFlags linkArgs: linkArgs. |
|
224 |
] |
|
478 | 225 |
]. |
366 | 226 |
|
331
a0be330a1f43
moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
227 |
! |