Changed workstation initialization.
Now mini-stx with only libbasic, libcomp and librun works.
--- a/Make.proto Mon May 13 13:12:33 2002 +0200
+++ b/Make.proto Tue May 21 10:16:25 2002 +0200
@@ -52,7 +52,7 @@
# other definitions to use for things compiled here
#
LOCALDEFS=-DDEBUG
-# ST_LDFLAG=
+#ST_LDFLAG=
# st files found here wont go into the global abbrev list
SUPPRESS_LOCAL_ABBREVS=1
@@ -241,6 +241,21 @@
LINK_LIBRUN=$(LINK_LIBRUN) \
LIBLIST="$(LIBLIST)"
+$(TARGET)_mini:
+ @echo "making shared library linked mini-smalltalk ..."
+ @$(MAKE) linkIt \
+ LIBOBJS="$(LIBBASIC) $(LIBCOMP)" \
+ LINK_LIBOBJS="$(LIBBASIC) $(LIBCOMP)" \
+ ADDITIONAL_OBJS=$(ADDITIONAL_OBJS) \
+ ADDITIONAL_CLASSES=$(ADDITIONAL_CLASSES) \
+ EXTRA_OBJ= \
+ EXTRA_LINK_OBJ= \
+ EXTRA_CLASSES= \
+ LIBRUN=$(LIBRUN) \
+ LINK_LIBRUN=$(LINK_LIBRUN) \
+ LIBLIST="libbasic libcomp"
+
+
$(TARGET)_fullstatic: $(STATIC_LIBRUN)
if [ -f $(LIBRUNDIR)/librun.a ]; then \
echo "librun.a already made."; \
--- a/display.rc Mon May 13 13:12:33 2002 +0200
+++ b/display.rc Tue May 21 10:16:25 2002 +0200
@@ -187,192 +187,170 @@
* look for a file named 'd_<displayname>.rc' and file it in
*"
-|displayDevice arguments displayVar display displayType isWindowsDisplay s idx|
-
-"find display name from environment or -display argument"
-
-arguments := Smalltalk commandLineArguments.
-arguments size > 0 ifTrue:[
- idx := arguments indexOf:'-display'.
- idx ~~ 0 ifTrue:[
- displayVar := arguments at:idx + 1.
- arguments removeAtIndex:idx+1.
- arguments removeAtIndex:idx.
- ].
-].
-displayVar isNil ifTrue:[
- displayVar := OperatingSystem getEnvironment:'DISPLAY'.
-].
+|displayDevice displayVar display displayType s|
displayDevice := Screen current.
-isWindowsDisplay := (displayDevice platformName = 'WIN32').
-
-display := displayVar.
-
-(displayVar notNil or:[isWindowsDisplay]) ifTrue:[
- "/ figure out the hostname of the display,
- "/ to read d_<hostname>.rc
+(displayDevice platformName = 'WIN32') ifTrue:[
+ "running on a local windows display"
+ display := OperatingSystem getHostName.
+] ifFalse:[
+ displayVar := displayDevice displayName.
+ displayVar notNil ifTrue:[
+ "/ figure out the hostname of the display,
+ "/ to read d_<hostname>.rc
- (isWindowsDisplay
- or:[(displayVar startsWith:':0')
- or:[(displayVar startsWith:'unix:')
- or:[displayVar startsWith:'shm:']]]) ifTrue:[
- "running on a local display"
- display := OperatingSystem getHostName.
- ] ifFalse:[
- (displayVar endsWith:':0') ifTrue:[
- display := displayVar copyTo:(displayVar size - 2)
+ ((displayVar startsWith:':0')
+ or:[(displayVar startsWith:'unix:')
+ or:[displayVar startsWith:'shm:']]) ifTrue:[
+ "running on a local display"
+ display := OperatingSystem getHostName.
] ifFalse:[
- (displayVar endsWith:':0.0') ifTrue:[
- display := displayVar copyTo:(displayVar size - 4)
+ (displayVar endsWith:':0') ifTrue:[
+ display := displayVar copyTo:(displayVar size - 2)
+ ] ifFalse:[
+ (displayVar endsWith:':0.0') ifTrue:[
+ display := displayVar copyTo:(displayVar size - 4)
+ ]
]
- ]
+ ].
+ ].
+].
+
+display isNil ifTrue:[
+ 'display.rc [warning]: cannot determine display I am running on' errorPrintCR.
+] ifFalse:[
+ "
+ if there is a corresponding file d_<displayName>.rc ...
+ thats the one to take.
+ "
+ s := Smalltalk systemFileStreamFor:('d_' , display , '.rc').
+ s notNil ifTrue:[
+ displayType := display.
+ s close.
].
-
- "/ if no host specific info,
- "/ take the display vendor information,
- "/ to read d_<vendor>.rc
+].
- display isNil ifTrue:[
- isWindowsDisplay ifTrue:[
- display := 'win32'
- ]
- ].
+displayType isNil ifTrue:[
+ "
+ if no host specific info,
+ take the display vendor information,
+ to read d_<vendor>.rc
+ "
+
+ "
+ if the X-server gives some info,
+ take that as a base
+ "
+ |serverVendor|
+
+ serverVendor := displayDevice serverVendor ? ''.
- display isNil ifTrue:[
- 'display.rc [warning]: cannot determine display I am running on' errorPrintCR.
- ] ifFalse:[
+ (serverVendor startsWith:'The XFree86 Project, Inc')
+ ifTrue:[
+ displayType := 'xfree'
+ ].
+ (serverVendor startsWith:'Silicon Graphics')
+ ifTrue:[
+ displayType := 'iris'
+ ].
+ (serverVendor startsWith:'International Business Machines')
+ ifTrue:[
+ displayType := 'aix'
+ ].
+ (serverVendor startsWith:'DECWINDOWS Digital Equipment')
+ ifTrue:[
+ displayType := 'dec'
+ ].
+ (serverVendor startsWith:'Hummingbird Communications')
+ ifTrue:[
+ displayType := 'exceed'
+ ].
+ (serverVendor startsWith:'Hewlett-Packard Company')
+ ifTrue:[
+ displayType := 'hpux'
+ ].
+].
+
+displayType isNil ifTrue:[
+ "
+ just an example - stuff can also be hardwired here ...
+ "
+ display notNil ifTrue:[
"
- if there is a corresponding file d_<displayName>.rc ...
- thats the one to take.
+ if, in your organization, all displays are of the
+ same type,
+ use something like:
"
- s := Smalltalk systemFileStreamFor:('d_' , display , '.rc').
- s notNil ifTrue:[
- displayType := display.
- s close.
- ].
+"/ OperatingSystem getDomainName = '<yourDomain>.de' ifTrue:[
+"/ displayType := 'myDisplayType'
+"/ ].
"
- if the X-server gives some info,
- take that as a base
- "
- displayType isNil ifTrue:[
- |serverVendor|
-
- serverVendor := displayDevice serverVendor.
-
- (serverVendor startsWith:'The XFree86 Project, Inc')
- ifTrue:[
- displayType := 'xfree'
- ].
- (serverVendor startsWith:'Silicon Graphics')
- ifTrue:[
- displayType := 'iris'
- ].
- (serverVendor startsWith:'International Business Machines')
- ifTrue:[
- displayType := 'aix'
- ].
- (serverVendor startsWith:'DECWINDOWS Digital Equipment')
- ifTrue:[
- displayType := 'dec'
- ].
- (serverVendor startsWith:'Hummingbird Communications')
- ifTrue:[
- displayType := 'exceed'
- ].
- (serverVendor startsWith:'Hewlett-Packard Company')
- ifTrue:[
- displayType := 'hpux'
- ].
- ].
-
- "
- otherwise ...
+ if, in your organization, the display type can
+ be deduced from the hostname,
+ use something like:
+ (take the exept code below as a guide ...)
"
- displayType isNil ifTrue:[
- "
- just an example - stuff can also be hardwired here ...
- "
- display notNil ifTrue:[
- "
- if, in your organization, all displays are of the
- same type,
- use something like:
- "
-"/ OperatingSystem getDomainName = '<yourDomain>.de' ifTrue:[
-"/ displayType := 'myDisplayType'
-"/ ].
+"/ (display startsWith:'slsv') ifTrue:[
+"/ "all those machines at SEL are suns"
+"/ displayType := 'sun'
+"/ ].
+"/ (display startsWith:'frxt') ifTrue:[
+"/ "all those machines at AEG are xterminals"
+"/ displayType := 'xterminal'
+"/ ].
+"/ (display startsWith:'frlx') ifTrue:[
+"/ "all those machines at AEG are linux boxes with olwm"
+"/ displayType := 'linux_olwm'
+"/ ].
+"/
+"/ OperatingSystem getDomainName = 'exept.de' ifTrue:[
+"/ (display startsWith:'clam') ifTrue:[
+"/ displayType := 'next'
+"/ ].
+"/ (display startsWith:'porty') ifTrue:[
+"/ displayType := 'portable'
+"/ ].
+"/ (display startsWith:'blue') ifTrue:[
+"/ displayType := 'iris'
+"/ ].
+"/ (display startsWith:'sun') ifTrue:[
+"/ displayType := 'sun'
+"/ ].
+"/ (display startsWith:'sol') ifTrue:[
+"/ displayType := 'sun'
+"/ ].
+"/ (display startsWith:'hp') ifTrue:[
+"/ displayType := 'hpux'
+"/ ].
+"/ ].
+ ].
+].
- "
- if, in your organization, the display type can
- be deduced from the hostname,
- use something like:
- (take the exept code below as a guide ...)
- "
-"/ (display startsWith:'slsv') ifTrue:[
-"/ "all those machines at SEL are suns"
-"/ displayType := 'sun'
-"/ ].
-"/ (display startsWith:'frxt') ifTrue:[
-"/ "all those machines at AEG are xterminals"
-"/ displayType := 'xterminal'
-"/ ].
-"/ (display startsWith:'frlx') ifTrue:[
-"/ "all those machines at AEG are linux boxes with olwm"
-"/ displayType := 'linux_olwm'
-"/ ].
-
-"/ OperatingSystem getDomainName = 'exept.de' ifTrue:[
-"/ (display startsWith:'clam') ifTrue:[
-"/ displayType := 'next'
-"/ ].
-"/ (display startsWith:'porty') ifTrue:[
-"/ displayType := 'portable'
-"/ ].
-"/ (display startsWith:'blue') ifTrue:[
-"/ displayType := 'iris'
-"/ ].
-"/ (display startsWith:'sun') ifTrue:[
-"/ displayType := 'sun'
-"/ ].
-"/ (display startsWith:'sol') ifTrue:[
-"/ displayType := 'sun'
-"/ ].
-"/ (display startsWith:'hp') ifTrue:[
-"/ displayType := 'hpux'
-"/ ].
-"/ ].
- ].
- ].
- ].
-
+displayType isNil ifTrue:[
"
- final fallback: take OperatingSystem if we are running a local
+ final fallback: use type of machine if smalltalk is running on a local
connection.
the used name is one of:
d_next.rc
d_iris.rc
etc.
"
- displayType isNil ifTrue:[
- "use type of machine smalltalk is running on as default ..."
+ "use type of machine smalltalk is running on as default ..."
- (isWindowsDisplay
- or:[(displayVar startsWith:':0')
- or:[(displayVar startsWith:(OperatingSystem getHostName , ':0'))]])
- ifTrue:[
- displayType := OperatingSystem getSystemType.
- ]
+ display = OperatingSystem getHostName ifTrue:[
+ displayType := OperatingSystem getSystemType.
]
].
"now, if the above mess found something, we have it in displayType;
- fileIn d_<displayType>.rc"
+ fileIn d_<displayType>.rc.
+ If we are running on the default display, do it only if
+ the displayType changed (e.g. image restart on another display)."
displayType notNil ifTrue:[
((Smalltalk at:#'_ImageDisplayName') ~= displayType
- or:[displayDevice ~~ Display]) ifTrue:[
+ or:[displayDevice ~~ Screen default]) ifTrue:[
"/
"/ mouse-button translation
@@ -386,20 +364,17 @@
"/
"/ the following line puts paste onto the right button (as in xterm):
"/
- "/ Screen buttonTranslation:#(1 2 #paste 4 5 6 7).
+ "/ Screen current buttonTranslation:#(1 2 #paste 4 5 6 7).
"/
"/ while that one puts the pop-up menu both on the middle and right buttons:
"/
- Screen buttonTranslation:#(1 2 2 #wheelFwd #wheelBwd 6 7).
-
- "/ Screen buttonTranslation:#(1 2 2 4 5 6 7).
+ displayDevice buttonTranslation:#(1 2 2 #wheelFwd #wheelBwd 6 7).
"/
"/ lefthanders can use:
"/
- "/ Screen buttonTranslation:#(2 2 1 #wheelFwd #wheelBwd 6 7).
- "/ Screen buttonTranslation:#(2 2 1 2 2 2 2).
+ "/ displayDevice buttonTranslation:#(2 2 1 #wheelFwd #wheelBwd 6 7).
"/ common keyboard setup;
"/ might be changed later by a display-specific
@@ -408,11 +383,6 @@
"/ 'display.rc [info]: reading ''keyboard.rc'' ...' infoPrintCR.
Smalltalk fileIn:'keyboard.rc'.
-
- "Default for supportsDeepIcons is false.
- Set default value only when ImageDisplayName changes
- and d_displayType is called.
- "
displayDevice supportsDeepIcons:false.
Smalltalk isStandAloneApp ifFalse:[
('display.rc [info]: ') infoPrint.
@@ -426,19 +396,26 @@
Smalltalk fileIn:('d_' , displayType , '.rc')
].
- displayDevice == Display ifTrue:[
- Smalltalk at:#'_ImageDisplayName' put:displayType
- ]
+
+ "If we are running on the default display, remember current setting for possible
+ image restart"
+ displayDevice == Screen default ifTrue:[
+ Smalltalk at:#'_ImageDisplayName' put:displayType.
+ ].
]
!
"*
* now, this is a nice one:
*
- * if the image was saved on a different type of display, ask
- * user, if he/she'd like to have the style changed.
+ * if we are running on the default display and the image was saved
+ * on a different type of display, ask the user,
+ * if he/she'd like to have the style changed.
*"
-Display notNil ifTrue:[
+|currentScreen|
+
+currentScreen := Screen current.
+currentScreen == Screen default ifTrue:[
|depthChange colorChange greyChange reconfigure|
depthChange := false.
@@ -446,13 +423,13 @@
greyChange := false.
(Smalltalk includesKey:#'_ImageDisplayDepth') ifTrue:[
- depthChange := ((Smalltalk at:#'_ImageDisplayDepth') ~~ Display depth)
+ depthChange := ((Smalltalk at:#'_ImageDisplayDepth') ~~ currentScreen depth)
].
(Smalltalk includesKey:#'_ImageDisplayHasColor') ifTrue:[
- colorChange := ((Smalltalk at:#'_ImageDisplayHasColors') ~~ Display hasColors)
+ colorChange := ((Smalltalk at:#'_ImageDisplayHasColors') ~~ currentScreen hasColors)
].
(Smalltalk includesKey:#'_ImageDisplayHasGreyscales') ifTrue:[
- greyChange := ((Smalltalk at:#'_ImageDisplayHasGreyscales') ~~ Display hasGreyscales)
+ greyChange := ((Smalltalk at:#'_ImageDisplayHasGreyscales') ~~ currentScreen hasGreyscales)
].
(depthChange or:[colorChange or:[greyChange]]) ifTrue:[
reconfigure := self confirm:'Display capabilities have changed
@@ -468,9 +445,9 @@
].
].
- Smalltalk at:#'_ImageDisplayDepth' put:Display depth.
- Smalltalk at:#'_ImageDisplayHasColors' put:Display hasColors.
- Smalltalk at:#'_ImageDisplayHasGreyscales' put:Display hasGreyscales.
+ Smalltalk at:#'_ImageDisplayDepth' put:currentScreen depth.
+ Smalltalk at:#'_ImageDisplayHasColors' put:currentScreen hasColors.
+ Smalltalk at:#'_ImageDisplayHasGreyscales' put:currentScreen hasGreyscales.
]
!
@@ -499,34 +476,19 @@
View defaultStyle:#mswindows95
].
type = 'linux' ifTrue:[
- "/ if on the local display, and WINDOWMANAGER is fvwm95,
- "/ use win95 style as default.
- wm := OperatingSystem getEnvironment:'WINDOWMANAGER'.
- (((OperatingSystem getEnvironment:'DISPLAY') = ':0')
- and:[wm notNil
- and:[wm endsWith:'fvwm95']])
- ifTrue:[
- View defaultStyle:#mswindows95
- ] ifFalse:[
- View defaultStyle:#iris
- ]
+ View defaultStyle:#mswindows95
].
type = 'hpux' ifTrue:[
- View defaultStyle:#'motif'
+ View defaultStyle:#motif
].
type = 'ultrix' ifTrue:[
View defaultStyle:#'motif_dec2'
].
type = 'os2' ifTrue:[
- View defaultStyle:#'os2'
+ View defaultStyle:#os2
].
(type = 'win32') ifTrue:[
- (Number readFromString:((OperatingSystem getSystemInfo) at:#release) onError:0)
- >= 4.0 ifTrue:[
- View defaultStyle:#'mswindows95'
- ] ifFalse:[
- View defaultStyle:#'mswindows'
- ]
+ View defaultStyle:#'mswindows95'
].
"/ final fallBack ...
--- a/hideBanner.rc Mon May 13 13:12:33 2002 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-"/
-"/ $Header$
-"/
-"/ MIMEType: application/x-smalltalk-source
-"/
-"/ if you dont like the splash banner at startup,
-"/ simply remove or rename the showBanner.rc file.
-"/
-
-|view|
-
-(view := Smalltalk at:#'__BannerView__') notNil ifTrue:[
- view destroy.
- Smalltalk removeKey:#'__BannerView__'.
-].
-
--- a/patches Mon May 13 13:12:33 2002 +0200
+++ b/patches Tue May 21 10:16:25 2002 +0200
@@ -1,186 +1,10 @@
"/
"/ $Header$
"/
-"/ This file is processed at initial startup
+"/ This file is processed very early at initial startup (before any rc script)
"/ - not when resuming an image.
"/
-"/
-"/ install uncompiled classes as autoload
-"/ classes ... (if not already present)
-"/ Autoloaded classes will be automatically filed-in
-"/ when first accessed. This allows a smaller executable,
-"/ but creates a short delay, when the class is loaded on
-"/ first access.
-"/
-"/ You can add more classes to these lists -
-"/ i.e. all your classes you like to have around,
-"/ but which are not needed often enough to justify
-"/ machine code for them ...
-
-|cpu iSets requiredClasses enableJIT|
-
-'patches [info]: initial startup (snapshot image restart is faster) ...' infoPrintCR.
-
-"/
-"/ the JIT translator is known to work with the following
-"/ architectures:
-"/ ix86 (linux, win32, unixware)
-"/ sgi-mips (irix)
-"/ alpha (osf)
-"/ sparc (solaris) [only tested with v7 & v8 & v9 cpus]
-"/ aix (rs6k) [not very well tested]
-"/
-enableJIT := false.
-
-cpu := OperatingSystem getCPUType.
-(#(
- 'i386'
- 'sparc'
- 'mips'
- 'alpha'
-) includes:cpu) ifTrue:[
- enableJIT := true.
-
- cpu = 'sparc' ifTrue:[
- "/ for now, disable if we detect running on a sparcV10;
- "/ Reason:
- "/ we do not have v10 machines here at Exept (they even do not exist at this time),
- "/ and therefore have no way of checking if it runs on v10.
- "/ I dont want ST/X to crash on your side in that case ...
- "/ ... better run a bit slower than not running at all.
- "/ Please let us know if it runs and we will remove the code below
- "/ (which you should do as well).
-
- iSets := OperatingSystem getSystemInfo at:#instructionSets.
- (iSets includesString:'sparcv10') ifTrue:[
- 'patches [warning]: disable JIT for sparcV10 - not yet validated' infoPrintCR.
- enableJIT := false
- ]
- ]
-].
-
-enableJIT ifTrue:[
- "/ 'patches [info]: turn on JIT ...' infoPrintCR.
- ObjectMemory justInTimeCompilation:true.
-].
-
-"/ GLXWorkstation forceGL:true.
-"/ OperatingSystem disableSignal:14.
-
-ObjectMemory infoPrinting:false.
-"/ Smalltalk loadBinaries:true.
-Compiler allowUnderscoreInIdentifier:true.
-Compiler warnUnderscoreInIdentifier:false.
-Compiler warnSTXSpecials:false.
-
-"/
-"/ set the package for changes done below
-"/
-Project notNil ifTrue:[
- |p|
-
- p := Project new.
- p package:#'autoloaded'.
- p comment:'only for autoloaded classes'.
- Project current:p.
-].
-
-"/
-"/ when filing in, keep source as reference to file
-"/ (instead of keeping a string locally in the image)
-"/
-"/ I disable this - its dangerous if you fileIn
-"/ classes from other directories and fileOut later clobbers those files
-"/
-"/ ClassCategoryReader sourceMode:#reference.
-
-"/
-"/ the following are required (either compiled or interpreted) ...
-"/
-requiredClasses := #(
- ObsoleteObject
- "/ BinaryIOManager BinaryInputManager BinaryOutputManager BinaryObjectStorage
- StringCollection
- CachingRegistry Registry
-).
-
-requiredClasses do:[:s |
- (Smalltalk at:s) isNil ifTrue:[
- ('patches [info]: loading ' , s , ' ...') infoPrintCR.
- Smalltalk fileInClass:s initialize:true lazy:false silent:true
- ]
-].
-!
-
-|optionalViews|
-
-(Smalltalk at:#View) isNil ifTrue:[
- 'patches [info]: installing required autoloaded classes ...' infoPrintCR.
-
- optionalViews := #(
- DeviceWorkstation
- Workstation
- XWorkstation
- DisplayRootView
- SimpleView
- TopView
- StandardSystemView
- ModalBox
- View
- PseudoView
- DeviceDrawable
- DisplayMedium
- DisplaySurface
- GraphicsMedium
- DeviceGraphicsContext
- GraphicsContext
- Image
- ViewStyle
- KeyboardMap
- KeyboardForwarder
- TextCollector
- SynchronousWindowSensor
- WindowSensor
- WindowGroup
- WindowEvent
- WindowingTransformation
- FontDescription
- Font
- Form
- Cursor
- Color
- Depth1Image
- Depth8Image
- ResourcePack
- Model
- Controller
- ApplicationModel
- ApplicationWindow
- WindowBuilder
- PopUpView
- ShadowView
- Colormap
- DeviceHandle
- DisplayObject
- ).
- optionalViews do:[:s |
- "install if not already compiled-in"
- (Smalltalk at:s) isNil ifTrue:[
- Autoload subclass:s
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- category:'autoloaded-Views'
- ]
- ].
- (Smalltalk at:#DeviceWorkstation) autoload.
- (Smalltalk at:#XWorkstation) autoload.
- (Smalltalk at:#Workstation) autoload.
- (Smalltalk at:#DeviceHandle) autoload.
-].
-!
-
"/
"/ set the package for changes done below
"/
--- a/private.rc Mon May 13 13:12:33 2002 +0200
+++ b/private.rc Tue May 21 10:16:25 2002 +0200
@@ -22,6 +22,17 @@
*"
"/
+"/ define the language (you can also set the LANG-shell variable)
+"/ (currently #english, #german and #french are supported).
+"/ some fragments for other languages (japanese ;-) exist.
+"/ Setting it here will override the LANG variable setting,
+"/ if neither set here nor in LANG, #english is the default.
+"/ see (and enhance) the resource files
+"/
+"/ Smalltalk language:#de.
+"/ Smalltalk language:#en.
+
+"/
"/ you may limit the amount of memory allocated to
"/ dynamic compiled code ...
"/ The default is unlimited;
--- a/showBanner.rc Mon May 13 13:12:33 2002 +0200
+++ b/showBanner.rc Tue May 21 10:16:25 2002 +0200
@@ -28,7 +28,9 @@
"/ considered slow and no banner is shown
(OperatingSystem isUNIXlike
-and:[Display notNil and:[Display roundTripTime < 20]]) ifTrue:[
+ and:[(Smalltalk at:#XPMReader) notNil "maybe minimal configuration"
+ and:[Display notNil
+ and:[Display roundTripTime < 20]]]) ifTrue:[
"/ choose one of the banners
"/ (select the one which fits our screen depth best,
"/ avoiding allocation of too many colors)
@@ -51,9 +53,10 @@
"/ ('showBanner.rc [info]: launch splash screen banner.') infoPrintCR.
"/ remember the bannerView - will be destroyed by
"/ the hideBanner script.
- Smalltalk at:#'__BannerView__' put:(view := PopUpBanner forImage:img).
+ view := PopUpBanner forImage:img.
view showCentered.
Display flush.
+ Smalltalk addStartBlock:[view destroy].
].
].
!
--- a/smalltalk.rc Mon May 13 13:12:33 2002 +0200
+++ b/smalltalk.rc Tue May 21 10:16:25 2002 +0200
@@ -31,6 +31,60 @@
"/ display specifics to "d_<displayName>.rc"
"/ and private user stuff in "private.rc"
"/***************************************************************
+|cpu enableJIT|
+
+'smalltalk.rc [info]: initial startup (snapshot image restart is faster) ...' infoPrintCR.
+
+"/
+"/ the JIT translator is known to work with the following
+"/ architectures:
+"/ ix86 (linux, win32, unixware)
+"/ sgi-mips (irix)
+"/ alpha (osf)
+"/ sparc (solaris) [only tested with v7 & v8 & v9 cpus]
+"/ aix (rs6k) [not very well tested]
+"/
+enableJIT := false.
+
+cpu := OperatingSystem getCPUType.
+(#(
+ 'i386'
+ 'sparc'
+ 'mips'
+ 'alpha'
+) includes:cpu) ifTrue:[
+ enableJIT := true.
+
+ cpu = 'sparc' ifTrue:[
+ "/ for now, disable if we detect running on a sparcV10;
+ "/ Reason:
+ "/ we do not have v10 machines here at Exept (they even do not exist at this time),
+ "/ and therefore have no way of checking if it runs on v10.
+ "/ I dont want ST/X to crash on your side in that case ...
+ "/ ... better run a bit slower than not running at all.
+ "/ Please let us know if it runs and we will remove the code below
+ "/ (which you should do as well).
+
+ ((OperatingSystem getSystemInfo at:#instructionSets) includesString:'sparcv10') ifTrue:[
+ 'smalltalk.rc [warning]: disable JIT for sparcV10 - not yet validated' infoPrintCR.
+ enableJIT := false
+ ]
+ ]
+].
+
+enableJIT ifTrue:[
+ "/ 'smalltalk.rc [info]: turn on JIT ...' infoPrintCR.
+ ObjectMemory justInTimeCompilation:true.
+].
+
+"/ OperatingSystem disableSignal:14.
+
+ObjectMemory infoPrinting:false.
+"/ Smalltalk loadBinaries:true.
+Compiler allowUnderscoreInIdentifier:true.
+Compiler warnUnderscoreInIdentifier:false.
+Compiler warnSTXSpecials:false.
+!
"/
"/ allow definition of the systemPath from an environment variable
@@ -42,7 +96,7 @@
"/ funny viewStyles, colors and stupid strings if wrong.
"/
-|path systemPath|
+|path|
(path := OperatingSystem getEnvironment:'STX_SYSTEMPATH') notNil ifTrue:[
Smalltalk systemPath:(path asCollectionOfSubstringsSeparatedBy:$:)
@@ -56,32 +110,6 @@
Smalltalk systemPath:(Smalltalk systemPath remove:path; yourself).
]
].
-(path := OperatingSystem getEnvironment:'STX_PACKAGEPATH') notNil ifTrue:[
- Smalltalk packagePath:(path asCollectionOfSubstringsSeparatedBy:$:).
- 'smalltalk.rc [info]: setting packagePath from STX_PACKAGEPATH' printCR.
- "/ 'packagePath: ' print. Smalltalk packagePath printCR.
-] ifFalse:[
- "/
- "/ if running in the development environment,
- "/ only use the local packages.
- "/
- ('../../projects' asFilename exists
- and:['../../projects/smalltalk' asFilename exists]) ifTrue:[
- Smalltalk packagePath removeAll; add:'../../..'.
- 'smalltalk.rc [info]: setting packagePath for local operation' printCR.
- "/ 'packagePath: ' print. Smalltalk packagePath printCR.
- ].
-
- "/
- "/ any additional local packages ?.
- "/
- 'packages' asFilename exists ifTrue:[
- Smalltalk packagePath addFirst:'./packages'.
- "/ 'additional local packages' printCR.
- "/ 'packagePath: ' print. Smalltalk packagePath printCR.
- ].
-].
-
'../../libbasic' asFilename exists ifTrue:[
Smalltalk systemPath addFirst:'../..'.
].
@@ -91,62 +119,107 @@
Smalltalk systemPath remove:'.'.
].
Smalltalk systemPath addFirst:'.'.
+
+(path := OperatingSystem getEnvironment:'STX_PACKAGEPATH') notNil ifTrue:[
+ Smalltalk packagePath:(path asCollectionOfSubstringsSeparatedBy:$:).
+ 'smalltalk.rc [info]: setting packagePath from STX_PACKAGEPATH' printCR.
+] ifFalse:[
+ "/
+ "/ if running in the development environment,
+ "/ only use the local packages.
+ "/
+ '../../projects/smalltalk' asFilename exists ifTrue:[
+ Smalltalk packagePath removeAll; add:'../../..'.
+ 'smalltalk.rc [info]: setting packagePath for local operation' printCR.
+ ].
+
+ "/
+ "/ any additional local packages ?.
+ "/
+ 'packages' asFilename exists ifTrue:[
+ Smalltalk packagePath addFirst:'./packages'.
+ "/ 'additional local packages' printCR.
+ ].
+ "/ 'packagePath: ' print. Smalltalk packagePath printCR.
+].
+
Smalltalk flushPathCaches.
!
-|args|
+|args buildClasses openDisplay prevCatchSetting|
-args := Smalltalk commandLineArguments.
+args := Smalltalk commandLineArguments ? #().
+
+buildClasses := false.
((args size > 0) and:[args last = '--buildClasses']) ifTrue:[
'binary' asFilename isDirectory ifFalse:[
'smalltalk.rc [warning]: no binary directory for classes.' errorPrintCR.
- ] ifTrue:[
- "/
- "/ load all lazy classes
- "/
- Autoload subclasses do:[:aClass |
- Autoload autoloadFailedSignal handle:[:ex |
- 'smalltalk.rc [warning]: autoload failed' errorPrintCR.
- ex return.
- ] do:[
- 'smalltalk.rc [info]: loading ' infoPrint. aClass name infoPrint. ' ...' infoPrintCR.
- aClass autoload.
- ]
- ].
-
- "/
- "/ binary save all classes
- "/
- Autoload loadedClasses do:[:cls |
- 'smalltalk.rc [info]: saving binary of ' infoPrint. cls name infoPrint. ' ...' infoPrintCR.
- cls binaryFileOut.
- OperatingSystem executeCommand:'mv *.cls binary'.
- ]
+ Smalltalk exit.
].
- Smalltalk exit
-].
-
-((args includes:'--noBanner') or:[args includes:'-noBanner']) ifFalse:[
- Smalltalk fileIn:'showBanner.rc'.
+ buildClasses := true.
].
+"/ check for display-classes being required and compiled into the system;
+"/ if not, load the display classes.
"/
-"/ check for display-classes being compiled into the system;
-"/ (and if display connection can be established)
-"/ if not, enter a simple read-eval-print loop
+openDisplay := false.
+(Smalltalk isHeadless or:[args includes:'--noDisplay']) ifFalse:[
+ (Smalltalk at:#DeviceWorkstation) isNil ifTrue:[
+ "now view classes compiled into the system.
+ Minimum smalltalk does only contain libbasic, libcomp and librun.
+ FileIn view stuff"
+
+ 'smalltalk.rc [info]: installing required class libraries ...' infoPrintCR.
+ (Smalltalk isClassLibraryLoaded:'libbasic2') ifFalse:[
+ Smalltalk loadPackage:'stx:libbasic2'.
+ ].
+ Smalltalk loadPackage:'stx:libview'.
+ Smalltalk fileInClassLibrary:'XWorkstation' inPackage:'stx:libview'.
+ OperatingSystem isMSWINDOWSlike ifTrue:[
+ Smalltalk fileInClassLibrary:'WinWorkstation' inPackage:'stx:libview'.
+ ].
+ ].
+ openDisplay := true.
+].
+
+"/
+"/ the following are required (either compiled or interpreted) ...
+"/ required classes should be in libbasic
"/
-Smalltalk isHeadless ifFalse:[
- Display isNil ifTrue:[
- (args includes:'--noDisplay') ifFalse:[
- DeviceWorkstation notNil ifTrue:[
- 'smalltalk.rc [warning]: No Display connection.' errorPrintCR.
- 'smalltalk.rc [info]: Either set the DISPLAY environment variable,' infoPrintCR.
- 'smalltalk.rc [info]: or start smalltalk with a -display argument.' infoPrintCR.
- Smalltalk isStandAloneApp ifTrue:[
- Smalltalk exit
- ].
+#(
+ "/ ObsoleteObject
+ "/ BinaryIOManager BinaryInputManager BinaryOutputManager BinaryObjectStorage
+ StringCollection CachingRegistry
+) do:[:s |
+ (Smalltalk at:s) isNil ifTrue:[
+ ('smalltalk.rc [info]: loading ' , s , ' ...') infoPrintCR.
+ Smalltalk fileInClass:s initialize:true lazy:false silent:true
+ ]
+].
+
+"/ Install patches, once everything has been loaded.
+"/ System methods may be overwritten by patches.
+prevCatchSetting := Class catchMethodRedefinitions.
+Class catchMethodRedefinitions:false.
+(Smalltalk secureFileIn:(Smalltalk commandName asFilename withSuffix:'pch')) ifFalse:[
+ Smalltalk isStandAloneApp ifFalse:[
+ Smalltalk secureFileIn:'patches'.
+ ].
+].
+Class catchMethodRedefinitions:prevCatchSetting.
+
+
+openDisplay ifTrue:[
+ "/ open the graphical display
+ [
+ Screen openDefaultDisplay:nil.
+ ] on:Screen deviceOpenErrorSignal do:[:ex|
+ ('smalltalk.rc [warning]: No Display connection to: ', ex parameter) errorPrintCR.
+ 'smalltalk.rc [info]: Either set the DISPLAY environment variable,' infoPrintCR.
+ 'smalltalk.rc [info]: or start smalltalk with a -display argument.' infoPrintCR.
+ Smalltalk isStandAloneApp ifFalse:[
'' errorPrintCR.
'Textmode (enter smalltalk expressions terminated by single exclamation mark;' errorPrintCR.
OperatingSystem isUNIXlike ifTrue:[
@@ -155,14 +228,9 @@
' CTRL-Z to leave line-by-line interpreter.)' errorPrintCR.
].
Smalltalk readEvalPrint.
- Smalltalk exit
- ] ifFalse:[
- Smalltalk isStandAloneApp ifFalse:[
- 'smalltalk.rc [warning]: Configuration without display.' errorPrintCR.
- ]
].
+ Smalltalk exit
].
- ].
].
"/
@@ -173,6 +241,72 @@
"/
"/ Display unBuffered.
+(buildClasses or:[args includes:'--noBanner']) ifFalse:[
+ Smalltalk fileIn:'showBanner.rc'.
+].
+
+"/
+"/ lazy loading
+"/ (faster fileIn) - this is EXPERIMENTAL.
+"/
+"/ - if turned on, an autoload operation will only create methodStubs
+"/ (uncompiled) which trap when called the first time.
+"/ The bytecode compiler will compile them when first executen.
+"/
+"/ - if turned off, an autoload will load & compile the whole class,
+"/ which makes autoloading slower, but avoids the initial delays
+"/
+"/ This is much like just-in-time compilation, but on a higher level.
+"/ If there are any problems with lazy methods, disable the following
+"/ and let me (info@exept.de) know what happened.
+"/
+Autoload compileLazy:true.
+
+"/
+"/ read the abbrev.stc file, extract class names
+"/ and install all nonExisting classes as autoloaded
+"/
+
+Class withoutUpdatingChangesDo:[
+ |needToReactivate|
+
+ HistoryManager notNil ifTrue:[
+ needToReactivate := HistoryManager isActive.
+ HistoryManager deactivate.
+ ] ifFalse:[
+ needToReactivate := false
+ ].
+ 'smalltalk.rc [info]: installing autoloaded classes ...' infoPrintCR.
+ Smalltalk installAutoloadedClasses.
+ needToReactivate ifTrue:[HistoryManager activate].
+].
+
+buildClasses ifTrue:[
+ "/
+ "/ load all lazy classes
+ "/
+ Autoload subclasses do:[:aClass |
+ Autoload autoloadFailedSignal handle:[:ex |
+ 'smalltalk.rc [warning]: autoload failed' errorPrintCR.
+ ex return.
+ ] do:[
+ 'smalltalk.rc [info]: loading ' infoPrint. aClass name infoPrint. ' ...' infoPrintCR.
+ aClass autoload.
+ ]
+ ].
+
+ "/
+ "/ binary save all classes
+ "/
+ Autoload loadedClasses do:[:cls |
+ 'smalltalk.rc [info]: saving binary of ' infoPrint. cls name infoPrint. ' ...' infoPrintCR.
+ cls binaryFileOut.
+ OperatingSystem executeCommand:'mv *.cls binary'.
+ ]
+ Smalltalk exit
+].
+!
+
"/
"/ this starts the incremental GC earlier
"/ (default is 500000)
@@ -232,7 +366,7 @@
ObjectMemory fastMoreOldSpaceAllocation:true.
!
-"/ another experimental (and a secret for now, since I dont want
+"/ another experimental (and a secret for now, since I don't 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 ...
@@ -259,52 +393,7 @@
a := #(nil nil nil nil -20 -8 -3 -1 -1 1 16 nil) copy.
].
ObjectMemory tenureParameters:a.
-
-"/
-"/ lazy loading
-"/ (faster fileIn) - this is EXPERIMENTAL.
-"/
-"/ - if turned on, an autoload operation will only create methodStubs
-"/ (uncompiled) which trap when called the first time.
-"/ The bytecode compiler will compile them when first executen.
-"/
-"/ - if turned off, an autoload will load & compile the while class,
-"/ which makes autoloading slower, but avoids the initial delays
-"/
-"/ This is much like just-in-time compilation, but on a higher level.
-"/ If there are any problems with lazy methods, disable the following
-"/ and let me (cg@exept.ssw.de) know what happened.
-"/
-Autoload compileLazy:true.
-
-"/
-"/ read the abbrev.stc file, extract class names
-"/ and install all nonExisting classes as autoloaded
-"/
-HistoryManager notNil ifTrue:[
- needToReactivate := HistoryManager isActive.
- HistoryManager deactivate.
-] ifFalse:[
- needToReactivate := false
-].
-
-Class withoutUpdatingChangesDo:[
- 'smalltalk.rc [info]: installing autoloaded classes ...' infoPrintCR.
- Smalltalk installAutoloadedClasses.
-].
-needToReactivate ifTrue:[HistoryManager activate].
-
-"/
-"/ define the language (you can also set the LANG-shell variable)
-"/ (currently #english, #german and #french are supported).
-"/ some fragments for other languages (japanese ;-) exist.
-"/ Setting it here will override the LANG variable setting,
-"/ if neither set here nor in LANG, #english is the default.
-"/ see (and enhance) the resource files
-"/ Claus: supposed to be done in private.rc or via LANG variable
-"/
-"/ Smalltalk language:#german.
-"/ Smalltalk language:#english.
+!
"/
"/ this defines stuff relating to the host we are running on
@@ -318,8 +407,8 @@
"/ Notice, that the display may be different from the host we run on;
"/ Host specific things are configured in host.rc.
"/
-"/ 'smalltalk.rc [info]: reading ''display.rc'' ...' infoPrintCR.
Display notNil ifTrue:[
+ "/ 'smalltalk.rc [info]: reading ''display.rc'' ...' infoPrintCR.
Smalltalk fileIn:'display.rc'.
].
@@ -340,25 +429,20 @@
"/ - or start stx with a suppress argument.
"/
-Smalltalk isStandAloneApp ifFalse:[
- Smalltalk isHeadless ifFalse:[
- Display notNil ifTrue:[
- (Smalltalk commandLineArguments includes:'--noLicenceBox') ifFalse:[
- Smalltalk addStartBlock:[
- 'smalltalk.rc [info]: show licence conditions ...' infoPrintCR.
+(Smalltalk isStandAloneApp not and:[Display notNil]) ifTrue:[
+ (Smalltalk commandLineArguments includes:'--noLicenceBox') ifFalse:[
+ Smalltalk addStartBlock:[
+ 'smalltalk.rc [info]: show licence conditions ...' infoPrintCR.
- LicenceBox autoload.
-
- LicenceBox licenceRejectSignal handle:[:ex|
- Smalltalk exit
- ] do:[
- (LicenceBox open) ifFalse:[Smalltalk exit].
- Smalltalk at:#LicenceBox put:nil.
- ].
- ]
+ LicenceBox autoload.
+ LicenceBox licenceRejectSignal handle:[:ex|
+ Smalltalk exit
+ ] do:[
+ (LicenceBox open) ifFalse:[Smalltalk exit].
+ Smalltalk at:#LicenceBox put:nil.
+ ].
]
]
- ]
].
!
@@ -399,15 +483,9 @@
"/ Smalltalk at:#Disk put:(Filename rootDirectory)
"/ ].
-Display notNil ifTrue:[
- Smalltalk at:#Window put:(Display class).
- Smalltalk at:#Screen put:(Display class).
- Smalltalk at:#Sensor put:Display.
-] ifFalse:[
- DeviceWorkstation notNil ifTrue:[
- Smalltalk at:#Window put:DeviceWorkstation.
- Smalltalk at:#Screen put:DeviceWorkstation.
- ]
+Screen notNil ifTrue:[
+ Smalltalk at:#Window put:Screen.
+ Smalltalk at:#Sensor put:Screen default.
].
"/
@@ -424,7 +502,7 @@
'smalltalk.rc [info]: reading ''private.rc'' ...' infoPrintCR.
Smalltalk fileIn:'private.rc'.
-DeviceWorkstation notNil ifTrue:[
+Screen notNil ifTrue:[
"/
"/ read saved configuration settings (if any)
"/
@@ -566,7 +644,4 @@
].
]
].
-!
-Smalltalk fileIn:'hideBanner.rc'.
-
--- a/smalltalk_r.rc Mon May 13 13:12:33 2002 +0200
+++ b/smalltalk_r.rc Tue May 21 10:16:25 2002 +0200
@@ -11,9 +11,17 @@
"/ is restarted. Usually, everything should stay as it was,
"/ except for things like keyboard mapping (if running on another display)
"/
-"/ notice, that all views and things have already been restored when this
-"/ script is run ....
-"/
+
+"/ first, restart the Display connection
+Display notNil ifTrue:[
+ (Display reinitializeFor:Screen defaultDisplayName) isNil ifTrue:[
+ 'smalltalk_r.rc [error]: Cannot restart connection to: ' errorPrint.
+ Screen defaultDisplayName errorPrintCR.
+ Smalltalk exit.
+ ].
+].
+"/ Tell smalltalk, that the display may be used now.
+Smalltalk displayInitializationDone.
"/
"/ this handles all variant display stuff
--- a/stxapp.rc Mon May 13 13:12:33 2002 +0200
+++ b/stxapp.rc Tue May 21 10:16:25 2002 +0200
@@ -8,16 +8,18 @@
"/ example for a very simple startup file for standAlone applications
"/ this is read for standAlone apps, if no <commandName>.rc is found.
"/
-"/ without an stxapp.rc, no setup of keyboardMap or viewStyle
+"/ without an stxapp.rc, no display is opened and no setup of keyboardMap or viewStyle
"/ is performed - this still works correctly, but may be invonvenient for the
"/ user ...
-"/
-"/ ... therefore, reuse display.rc for setup:
-"/
-
+[
+ Screen openDefaultDisplay:nil.
+] on:Screen deviceOpenErrorSignal do:[:ex|
+ ('smalltalk.rc [warning]: No Display connection to: ', ex parameter) errorPrintCR.
+]
Display notNil ifTrue:[
Smalltalk fileIn:'display.rc'
+ Smalltalk fileIn:'keyboard.rc'
].
Smalltalk silentLoading:true.
!