private.rc
author Claus Gittinger <cg@exept.de>
Wed, 18 Dec 1996 15:04:26 +0100
changeset 182 0f0ce432de5e
parent 181 4f41c57d2c4f
child 183 e0f91f84aaae
permissions -rw-r--r--
*** empty log message ***

"*
 * $Header$
 *
 * sample private.rc - file
 *
 * a copy of this file can (should) reside in $home/.smalltalk/private.rc or
 * in the current directory - put all private preferences in here.
 *
 *
 * notice, you will find some things enclosed in
 *  ... claus ifTrue:[
 *      
 * these are my personal preferences which will be
 * ignored in your environment, but are taken in mine.
 * That way, I dont have to maintain two different 'private.rc' files.
 * (you may want to have a look into it - some is of general interest)
 *"

"/
"/ enable the justInTimeCompiler.
"/ This is still somewhat experimental, therefore it is
"/ turned on maunally here ....
"/ ... it will be always on, once we have it running for half
"/ a year or so ;-)
"/
ObjectMemory justInTimeCompilation:true.
ObjectMemory dynamicCodeLimit:64000.

"/
"/ If local sources have preference over source code managment
"/
"/Class tryLocalSourceFirst:true.

"/
"/ I want the hostname to be prepended to a windows label
"/
StandardSystemView includeHostNameInLabel:true.

"/
"/ this turns off error/fatal messages from the VM
"/ (it does not really make sense to turn them off)
"/
"/ Smalltalk debugPrinting:false.

"/
"/ set the package for fileIns done below
"/
Project notNil ifTrue:[
    Project setDefaultProject.
    Project current packageName:#'goody-fileIn'.
].
!

|whoAmI thisIsMySystem conf systemType|

'reading keyboard.rc ...' infoPrintCR.
Smalltalk fileIn:'keyboard.rc'.

"/
"/ no matter what the 'display.rc' says:
"/     I want my #iris style ...
"/
View defaultStyle:#iris.
"/ View defaultStyle:#motif.



"/ add my private directories to the searchPath ...
"/ This does not make sense in your environment.
"/ However, I leave the code here to show how its done.
"/
Smalltalk systemPath addFirst:'../..'.

whoAmI := OperatingSystem getLoginName.
thisIsMySystem := whoAmI = 'claus' or:[whoAmI = 'cg'].

thisIsMySystem ifTrue:[
    MenuView defaultFont:(MenuView defaultFont size:10).

    Smalltalk systemPath addFirst:'../../not_delivered'.
    Smalltalk systemPath addFirst:'../../private_classes'.
    Smalltalk systemPath addFirst:'../../fileIn/not_delivered'.
    Smalltalk systemPath addFirst:'../../libpro'.
].

"/ since smalltalk keeps track of which directories exist
"/ in the path, this cache has to be flushed whenever new directories
"/ are added to the path:
"/
Smalltalk flushPathCaches.

"/
"/ color allocation strategy:
"/
"/ the default is to allocate from the colormap as required.
"/ As long as the number of distinct colors used is less than the number
"/ of available colors (which is usually the case) this leads to better looking
"/ images.
"/ However, if many images are to be displayed simulatiously, images displayed
"/ first may steal too many colors required in images displayed later.
"/ In this case, it is better to preallocate some colors, and dither all images
"/ using theese. Of course, while making the worst case better, this makes
"/ the best case worse. You can decide ...
"/
"/   Color getColors6x6x4.


"/ The following enables some nice cursors; for example thumbsUp and thumbsDown
"/
"/ claus:
"/     I like those fancy cursors :-)
"/     if you think this is too 'childish', remove the line below ...
"/
"/ 'loading fancy cursors ...' infoPrintCR.
Cursor initializeNewCursors.


"/ claus:
"/     The history manager automatically adds a history line to changed
"/     methods and optionally to a classes history method.
"/
thisIsMySystem ifTrue:[
    HistoryManager notNil ifTrue:[
	'activating HistoryManager ...' infoPrintCR.
	HistoryManager activate.
    ]
].

"/ claus:
"/     I startup the rdoit server process;
"/     (using rdoit to start ST/X views via window manager menus ...)
"/
thisIsMySystem ifTrue:[
    'starting RDoItServer ...' infoPrintCR.
    "/ Smalltalk fileIn:'../../goodies/rdoit/NewLauncher.chg'.
    RDoItServer autoload.
    RDoItServer start.
    RDoItServer allowHost:'localhost'.
].

"/ claus:
"/     I dont want those warnings about stx features being non-portable ...
"/     However, you should (at least when new to the system) see them.
"/     Once you get bored about them, make the below unconditional.
"/     (you can also turn them off in the Launchers settings menu ...)
"/
Compiler allowUnderscoreInIdentifier:true. 
Compiler warnUnderscoreInIdentifier:false. 
Compiler warnSTXSpecials:false.


"/ this is a temporary kludge: specify the flags to be used
"/ when compiling via stc. Primitive compilation (from within the browser)
"/ is still experimental. So you better not care (yet)
"/ BTW: its only supported on ELF systems and Linux - anyway 
"/      (and not in the free demo release).
"/
conf := Smalltalk configuration.
(conf includesString:'gcc') ifTrue:[
    Compiler ccPath:'gcc'
] ifFalse:[
    Compiler ccPath:'cc'
].

Compiler stcCompilation:#default.
Compiler stcCompilationOptions:'+optinline +inlineNew'.

"/ special options req'd for some systems (should be done in the host file ...)

systemType := OperatingSystem getOSType.

Compiler stcCompilationIncludes:'-I../../include'.

thisIsMySystem ifTrue:[
    "/
    "/ for myself: preset flags, so that I
    "/ can accept GLXWorkstation code
    "/
    Display supportsGLDrawing ifTrue:[
	systemType = 'irix' ifTrue:[
	    Display isOpenGL ifTrue:[
		Compiler stcCompilationDefines:'-DOPENGL'.
	    ] ifFalse:[
		Compiler stcCompilationDefines:'-DGLX'.
	    ]
	] ifFalse:[
	    Display isOpenGL ifTrue:[
		Compiler stcCompilationIncludes:'-I../../include -I../../support/MESA/Mesa1.2.5/include'.
		Compiler stcCompilationDefines:'-DOPENGL -DMESA'.
	    ] ifFalse:[
		Compiler stcCompilationIncludes:'-I../../include -I../../support/VGL/vogl/src'.
		Compiler stcCompilationDefines:'-DVGL'.
	    ].

	    "/ specify additional link libraries.
	    "/ Disabled; thats the default anyway ....
	    "/
	    "/    OperatingSystem getOSType = 'linux' ifTrue:[
	    "/      ObjectFileLoader searchedLibraries:#('/usr/lib/libc.a')
	    "/    ]

	].
    ]
].

Compiler ccCompilationOptions:'-O'.

systemType = 'solaris' ifTrue:[
    Compiler ccCompilationOptions:'-O -fPIC'
].

"/ experimental: try to always keep some bytes in the pocket
"/ this changes the memory policy, to start the background collector whenever
"/ freespace drops below 250k or 500k have been allocated since the last GC. 
"/ AND to allocate more memory, if (after the collect) less than 1Mb is free.
"/ Doing so makes the system behave better if lots of memory is required
"/ for short periods of time, since it prepares itself for that situation
"/ during idle time. (I often walk around in the fileBrowser, loading big
"/ files like XWorkstation.st or SystemBrowser.st ....)
"/
ObjectMemory freeSpaceGCAmount:1000000. 
ObjectMemory freeSpaceGCLimit:250000. 
ObjectMemory incrementalGCLimit:500000. 
ObjectMemory startBackgroundCollectorAt:5. 
ObjectMemory startBackgroundFinalizationAt:5. 

"/ experimental: configure the memory manager to quickly increase
"/ its oldSpace, as long as it stays below 8Mb (i.e. do not enter
"/ a blocking mark&sweep or compress, but go straight ahead increasing
"/ the oldSpace). Above that, behave as usual, i.e. try a GC first,
"/ then increase the oldSpace size if that did not help.
"/ If you have a machine with lots of (real) memory, you may want to
"/ increase the number. The value below should be ok for 16-32Mb machines.
"/
ObjectMemory fastMoreOldSpaceLimit:8*1024*1024.
ObjectMemory fastMoreOldSpaceAllocation:true.
!

"/ another experimental (and a secret for now, since I dont want
"/ you to play with those ;-)
"/ For now, this is experimental. Once the best numbers
"/ have been found, I'll hardwire them and document it ...

|a|
ObjectMemory newSpaceSize > (500*1024) ifTrue:[
    a := #(nil nil nil nil -16 -4 -2 -2 0 0 16 nil) copy.
] ifFalse:[
"/         min max cpy /32 /16 /8 /4 /2 /4 /8 /16 /32 "
    "/
    "/ slow tenure - keeps objects longer in newSpace,
    "/  producing more scavenge overhead, but releasing IGC somewhat
    "/
"/  a := #(nil nil nil -100 -8 -4 -1  1 2  4  8   16 nil) copy.
"/  a := #(nil nil nil nil -16 -4  0  0  0 4 16 nil) copy.

    "fast tenure"
    "/
    "/ fast tenure - moves objects earlier into oldSpace,
    "/ releasing newSpace collector; however, the oldSpace IGC
    "/ may have more work to do.
    "/
    a := #(nil nil nil nil -20 -8 -3 -1 -1 1 16 nil) copy.
].
ObjectMemory tenureParameters:a.


"/ set the package back to some useful default for programming
"/ this is the package token assigned (by default) to all new methods/classes
"/ (so you can use a browser on package=#private to find all of your new
"/ stuff easily. (the conditional on Project being nonNil is for stripped down
"/ systems without a Project class)

Project notNil ifTrue:[
    Project setDefaultProject.
    Project current packageName:#'private'.
].
!

(Smalltalk commandLine includes:'-q') ifFalse:[
    "/
    "/ this turns off/on information messages from classes
    "/ (such as 'D8IMAGE: allocating colors ...'
    "/
    "/ Object infoPrinting:false.
    Object infoPrinting:true.

    "/
    "/ this turns off/on information messages from the VM
    "/ (such as 'MEM: chitty chatty ...'
    "/
    "/ ObjectMemory infoPrinting:false.
    ObjectMemory infoPrinting:true.
].

Smalltalk addStartBlock:[
    "/
    "/ start some views ...
    "/ you can add all stuff you'd like to come up by default
    "/ the first time.
    "/

    'starting main-menu ...' infoPrintCR.
    Launcher open

    "/
    "/ start a SystemBrowser
    "/ - I dont want one (using Launcher)
    "/
    "/ SystemBrowser open.

    "/
    "/ start a FileBrowser
    "/ - I dont want one (using Launcher)
    "/
    "/ FileBrowser open.

    "/
    "/ start a Workspace 
    "/ - I dont want one (using Launcher)
    "/
    "/ Workspace open.
].

!