host.rc
author Stefan Vogel <sv@exept.de>
Fri, 22 Mar 2013 08:44:18 +0100
changeset 1308 d073f0290d60
parent 1306 2581c10f1fff
child 1311 c88837870338
permissions -rw-r--r--
Remove unused vars
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
0cb137a77319 Initial revision
claus
parents:
diff changeset
     1
"*
609
f0f51d4a0066 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 577
diff changeset
     2
 * Encoding: iso8859-1
f0f51d4a0066 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 577
diff changeset
     3
 *
0
0cb137a77319 Initial revision
claus
parents:
diff changeset
     4
 * $Header$
5
420e4af41733 *** empty log message ***
claus
parents: 2
diff changeset
     5
 *
209
22793de5d56e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 195
diff changeset
     6
 * ST/X startup configuration file:
22793de5d56e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 195
diff changeset
     7
 *
5
420e4af41733 *** empty log message ***
claus
parents: 2
diff changeset
     8
 * DONT add site specific things here - use your own h_xxx.rc file instead
8
d82829c0d867 *** empty log message ***
claus
parents: 5
diff changeset
     9
 * where xxx stands for your hostname(s)
5
420e4af41733 *** empty log message ***
claus
parents: 2
diff changeset
    10
 *
0
0cb137a77319 Initial revision
claus
parents:
diff changeset
    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
0cb137a77319 Initial revision
claus
parents:
diff changeset
    14
 *"
1243
1fc6b3f01e48 End chung after initial comment / encoding spec
Stefan Vogel <sv@exept.de>
parents: 1126
diff changeset
    15
!
1308
d073f0290d60 Remove unused vars
Stefan Vogel <sv@exept.de>
parents: 1306
diff changeset
    16
|sysType host domain s conf includes incDir|
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
331
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    20
"------------------------------------------------------------------------"
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    21
"/ printer setup
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    22
"/ 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
    23
"/
239
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    24
"/ 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
    25
"/ on another host.
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    26
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    27
host := OperatingSystem getHostName.
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    28
(Smalltalk at:#'_ImageHostName') ~= host ifTrue:[
952
435154ba084b default printer setup for win32
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
    29
    sysType = 'win32' ifTrue:[
1306
2581c10f1fff removed via FileBrowser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
    30
	Printer := Smalltalk at:#WinPrinterStream.
952
435154ba084b default printer setup for win32
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
    31
    ] ifFalse:[
1306
2581c10f1fff removed via FileBrowser
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
    32
	Printer := Smalltalk at:#PostscriptPrinterStream.
177
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    33
    ].
932
910313a689a6 printer setup: default for win32
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
    34
].
103
9f5c03497b38 example - checking for the domain
Claus Gittinger <cg@exept.de>
parents: 8
diff changeset
    35
331
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    36
"------------------------------------------------------------------------"
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    37
"/ default compiler setup;
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    38
"/ 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
    39
"/
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    40
1308
d073f0290d60 Remove unused vars
Stefan Vogel <sv@exept.de>
parents: 1306
diff changeset
    41
(Smalltalk wasStartedFromImage not and:[ Smalltalk isPlugin not ])
678
728aff120ee7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
    42
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
    43
    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
    44
    Compiler stcCompilationOptions:'+optinline +inlineNew'.
331
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    45
577
d574370a1da5 only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
    46
    "/
d574370a1da5 only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
    47
    "/ 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
    48
    "/ 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
    49
    "/
d574370a1da5 only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
    50
    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
    51
    (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
    52
	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
    53
    ] ifFalse:[
d574370a1da5 only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
    54
	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
    55
    ].
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 ccCompilationOptions:'-O'.
331
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    57
1126
9a9ad236db9c host rc setup for 64mode32
Michael Beyl <mb@exept.de>
parents: 952
diff changeset
    58
    (conf includesString:'amd64_mode32') ifTrue:[
9a9ad236db9c host rc setup for 64mode32
Michael Beyl <mb@exept.de>
parents: 952
diff changeset
    59
	(ObjectFileLoader linkArgs includesString:'-m32') ifFalse:[
9a9ad236db9c host rc setup for 64mode32
Michael Beyl <mb@exept.de>
parents: 952
diff changeset
    60
	    ObjectFileLoader linkArgs:(ObjectFileLoader linkArgs , ' -m32 -m elf_i386').
9a9ad236db9c host rc setup for 64mode32
Michael Beyl <mb@exept.de>
parents: 952
diff changeset
    61
	].
9a9ad236db9c host rc setup for 64mode32
Michael Beyl <mb@exept.de>
parents: 952
diff changeset
    62
	(Compiler ccCompilationOptions includesString:'-m32') ifFalse:[
9a9ad236db9c host rc setup for 64mode32
Michael Beyl <mb@exept.de>
parents: 952
diff changeset
    63
	    Compiler ccCompilationOptions:(Compiler ccCompilationOptions , ' -m32').
9a9ad236db9c host rc setup for 64mode32
Michael Beyl <mb@exept.de>
parents: 952
diff changeset
    64
	].
9a9ad236db9c host rc setup for 64mode32
Michael Beyl <mb@exept.de>
parents: 952
diff changeset
    65
	(Compiler stcCompilationDefines includesString:'-D__amd64_mode32__') ifFalse:[
9a9ad236db9c host rc setup for 64mode32
Michael Beyl <mb@exept.de>
parents: 952
diff changeset
    66
	    Compiler stcCompilationDefines:(Compiler stcCompilationDefines , ' -D__amd64_mode32__').
9a9ad236db9c host rc setup for 64mode32
Michael Beyl <mb@exept.de>
parents: 952
diff changeset
    67
	].
9a9ad236db9c host rc setup for 64mode32
Michael Beyl <mb@exept.de>
parents: 952
diff changeset
    68
    ].
9a9ad236db9c host rc setup for 64mode32
Michael Beyl <mb@exept.de>
parents: 952
diff changeset
    69
577
d574370a1da5 only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
    70
    includes := ''.
d574370a1da5 only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
    71
    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
    72
    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
    73
	includes := includes , '-I' , incDir asFilename pathName , ' '
331
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    74
    ] ifFalse:[
677
222fd88429a3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
    75
	('../../../stx/include' asFilename exists) ifTrue:[
222fd88429a3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
    76
	    "/ running in a development environment ...
222fd88429a3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
    77
	    includes := includes , '-I../../../stx/include '.
331
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
    78
	] ifFalse:[
677
222fd88429a3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
    79
	    "/ if this is a production program, dont care for a warning
222fd88429a3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
    80
	    (Smalltalk isStandAloneApp or:[Smalltalk isHeadless])
222fd88429a3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
    81
	    ifFalse:[
222fd88429a3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
    82
		'host.rc [warning]: no >>include<< directory found along your path.' infoPrintCR.
222fd88429a3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
    83
		'host.rc [warning]: this might affect stc-compilation from within the browser.' infoPrintCR.
405
46fe89d09123 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 394
diff changeset
    84
	    ]
677
222fd88429a3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
    85
	]
577
d574370a1da5 only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
    86
    ].
d574370a1da5 only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
    87
d574370a1da5 only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
    88
    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
    89
d574370a1da5 only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
    90
    "/
d574370a1da5 only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
    91
    "/ 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
    92
    "/ 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
    93
    "/
d574370a1da5 only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
    94
    (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
    95
	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
    96
	    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
    97
	] ifFalse:[
d574370a1da5 only change compiler settings in host.rc, if not started from an image.
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
    98
	    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
    99
	    Compiler stcCompilationDefines:'-DVGL'.
331
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   100
	]
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   101
    ].
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   102
].
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   103
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   104
"/
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   105
"/ try systemType-specific setup
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   106
"/ h_<osType>.rc
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   107
"/
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   108
(Smalltalk at:#'_ImageOSTypeName') ~= sysType ifTrue:[
333
4a6780f29c71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   109
    ('host.rc [info]: ') infoPrint.
331
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   110
1295
b7f03a0eba28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   111
    "/ ('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
   112
    s := Smalltalk systemFileStreamFor:('h_' , sysType , '.rc').
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   113
    s notNil ifTrue:[
1295
b7f03a0eba28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   114
	('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
   115
	s fileIn.
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   116
	s close.
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   117
    ].
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   118
    Smalltalk at:#'_ImageOSTypeName' put:host.
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
165
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   121
"/
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   122
"/ try host-specific setup
331
a0be330a1f43 moved compiler setup into host-specific file.
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   123
"/ h_<hostname>.rc
165
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   124
"/
2
353a88ada7c6 *** empty log message ***
claus
parents: 0
diff changeset
   125
host isNil ifTrue:[
195
1cf850844da9 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 177
diff changeset
   126
    'host.rc [warning]: cannot determine host I am running on' errorPrintCR.
2
353a88ada7c6 *** empty log message ***
claus
parents: 0
diff changeset
   127
] ifFalse:[
0
0cb137a77319 Initial revision
claus
parents:
diff changeset
   128
    "if there is a corresponding file ..."
103
9f5c03497b38 example - checking for the domain
Claus Gittinger <cg@exept.de>
parents: 8
diff changeset
   129
5
420e4af41733 *** empty log message ***
claus
parents: 2
diff changeset
   130
    (Smalltalk at:#'_ImageHostName') ~= host ifTrue:[
1295
b7f03a0eba28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   131
	"/ ('host.rc [info]: trying host setup h_' , host , '.rc...') infoPrintCR.
5
420e4af41733 *** empty log message ***
claus
parents: 2
diff changeset
   132
8
d82829c0d867 *** empty log message ***
claus
parents: 5
diff changeset
   133
	s := Smalltalk systemFileStreamFor:('h_' , host , '.rc').
d82829c0d867 *** empty log message ***
claus
parents: 5
diff changeset
   134
	s notNil ifTrue:[
1295
b7f03a0eba28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   135
	    ('host.rc [info]: reading host setup h_' , host , '.rc...') infoPrintCR.
8
d82829c0d867 *** empty log message ***
claus
parents: 5
diff changeset
   136
	    s fileIn.
d82829c0d867 *** empty log message ***
claus
parents: 5
diff changeset
   137
	    s close.
d82829c0d867 *** empty log message ***
claus
parents: 5
diff changeset
   138
	].
d82829c0d867 *** empty log message ***
claus
parents: 5
diff changeset
   139
	Smalltalk at:#'_ImageHostName' put:host.
0
0cb137a77319 Initial revision
claus
parents:
diff changeset
   140
    ]
0cb137a77319 Initial revision
claus
parents:
diff changeset
   141
].
0cb137a77319 Initial revision
claus
parents:
diff changeset
   142
!