back

Installing Smalltalk/X

Index

Distributed packages

The Smalltalk/X system is available in two versions:

Files and directories as on the delivery medium

The full development package consists of the directories: In the free educational package, only files and directories in and below "projects/smalltalk" are included.

To run Smalltalk/X using the incremental compiler only, you will need all the directories "projects/smalltalk" and below. This is enough to play with the system, learn the language and write programs which execute in the integrated environment. With the help of startup scripts, you can even create pseudo standalone applications.

To compile classes into machine code, you will need the include files and the stc compiler.

To recompile all classes you will need a full tree as above and lots of disk space.

Reading the delivery medium

The first step in your installation is to verify that enough disk space is available. A full installation requires approx. 50-70 Mb of disk space (the full amount is only required during compilation of the system, some of the intermediate object files can be removed later).
Create a new directory where the files should go, and change into it. In the following description, we call this directory "TOP".

Installing files for a single user

If only one person is going to use Smalltalk/X, your installation is already complete, after you have extracted the files and directories from the distribution medium.
To start it, execute:
cd TOP/projects/smalltalk
smalltalk
or, if you installed the demo version,
cd TOP
smalltalk

Installing files for group usage

Smalltalk/X, as delivered lives in its own directory, and does not need any files to be added to system directories.
However, if more than one person are going to use Smalltalk/X, it is useful to install the common files in some standard places, and have the private files per-user. This not only saves valuable disk space, but also makes administration and distribution of new code and classes easier.
For most file accesses within Smalltalk/X, it uses a searchpath (i.e. a list of directory names in which files are searched), allowing users to override definitions and settings.
The path looks like:
.
HOME/.smalltalk
SMALLTALK_LIBDIR
/usr/local/lib/smalltalk
/usr/lib/smalltalk
where HOME is your login directory and SMALLTALK_LIDIR is a shell environment variable which can be left undefined.
Files are searched for in those directories, in the above order (*).

For example, a personal startup-script "smalltalk.rc" can be put into "HOME/.smalltalk/smalltalk.rc".

To install the system into some standard place (usually "/usr/local/bin" or "/usr/local/lib"), you should create the following directories:

/usr/local/lib/smalltalk
/usr/local/lib/smalltalk/source
/usr/local/lib/smalltalk/resources
/usr/local/lib/smalltalk/bitmaps
/usr/local/lib/smalltalk/doc
and copy the files from corresponding subdirectories found in "projects/smalltalk" to those new directories. Also, all files ending in ".rc" should be copied to this new directory.

If you do not have access to "/usr/local/lib", you can also put the stuff into any directory you like, and set the shell-variable SMALLTALK_LIBDIR to the name of that directory.

Thus, your global directory should look like:

.../source
.../source/*.st
.../resources
.../resources/*.rs
.../resources/*.style
.../bitmaps
.../bitmaps/*.xbm
.../fileIn/...
.../doc/coding
.../doc/misc
.../doc/...
.../smalltalk.rc
.../smalltalk_r.rc
.../display.rc
.../host.rc
.../d_*.rc
.../h_*.rc
.../abbrev.stc
.../patches
and (if "..." is not one of "/usr/lib/smalltalk" or "/usr/local/lib/smalltalk") the shell environment should contain a variable named SMALLTALK_LIBDIR, which is set to whatever "..." is.

Since compiled code does not include the source code itself, but instead a reference (filename & position) to it, an incorrect installation will lead to no source code being shown in the browser (the "smalltalk.rc"-script which is described below does a quick check and gives a warning).

Also, please do not manually edit the source files themselfes - you will make the position-information in compiled code invalid, and therefore see funny source code (parts only) in the browser.

The free demo package does not include all sources - some stuff is only avaliable in the non-free release. Therefore some methods source will not be visible in the browsers - even with a correct installation.

Startup actions

During startup, ST/X reads a file called "smalltalk.rc" to setup some internal stuff. Since the search for this file is done using the above path, you can put your private "smalltalk.rc" into either the current directory or "HOME/.smalltalk".

This script contains smalltalk expressions which will first do some display-specific setup (by executing "display.rc"), followed by host-specific setup (executing "host.rc"), and (if present) private definitions from "private.rc".
Finally it launches some default applications (currently the Transcript and Launcher). You can of course add more to this (for example, if you like to arrange for a systemBrowser to come up automatically).
"display.rc" tries to find out the kind of display hardware you are working with and then executes one of the "d_xxx.rc" scripts.Have a look at "display.rc" to see how this is done.
Some display specific scripts are already provided with the system, but you can add your own ones, if you are not happy with those settings. However, please leave the existing "d_xxx.rc"-files unmodified - better add your own new, and call it "d_displayname.rc". Your new "d_xxx.rc" file should set your personal preferences, such as view-look and keyboard mappings (use "d_sample_display.rc" as a guide). Also, keyboard mappings are set up in both 'display.rc' and the individual 'd_xxx.rc' files. For example, national keyboard variants are set there.

The same strategy is used for host specific setup, which consists mainly of printer setup. "host.rc" tries to find out, what host you are running on (which is NOT always the same as the display in X). Like with the display files, you should leave the existing host files untouched and add a new one, called "h_hostname.rc". Use "h_sample_host.rc" as a guide.

The other startup script "smalltalk_r.rc" is consulted, when a snapshot image is restarted; it also does the display and host setup but does not launch any new applications. Thus, the existing views will reopen after restart, but the look may be different, if started with another DISPLAY setting.

Summary, startup actions:

Please read the document on configuration and customization for details on how to change ST/X's settings to meat your personal preferences.

Hint:

the above mentioned search-path is valid for all files used and read by ST/X. The order allows both sharing of startup files and individual setups both per user and per project.
For example, you can put global default scripts into "/usr/local/lib", workgroup specific files into "SMALLTALK_LIBDIR", user private things into each users "HOME/.smalltalk" and finally project specifics into individual subdirectories.
Since bitmaps and resource files are too found along that path, you can even define your private bitmaps (for example: icons), by creating a "bitmaps" directory somewhere in the path and putting your own bitmap files there.

Hint:

actually the above was not completely correct: the name of the startup script is "executable-name.rc" - not strictly "smalltalk.rc". Thus, you can create an application by simply linking to the smalltalk executable, call it "whatever" and create a corresponding "whatever.rc".
If you have a full distribution (including the stc-compiler) you can also create stand alone executables.

Notes

Searchpath
The searchpath is kept in a class variable of the Smalltalk class (SystemPath) and can be accessed via class methods. You can add components to the path or change it completely from your startup file "smalltalk.rc" or "private.rc".

Copyright © Claus Gittinger Development & Consulting, all rights reserved

(cg@ssw.de)