[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ] [ Search: ]

4.20.6 Setting the CRYSTAL environment variable

This section describes how to set the ‘CRYSTAL’ environment variable under a variety of operating systems.

Windows Vista/7/8

The instructions for Windows system may vary slightly but is essentially the same for adding a new environment variable to a system.

First, from the Desktop, right-click My Computer and click Properties. Now click Advanced System Settings link in the left column. In the System Properties window click the Environment Variables button. You will now be presented with a dialog box.

The Environment Variables dialog box should now be visible. You should notice that there are two sections for adding environment variables, User and System. We classify ‘CRYSTAL’ as a system variable but adding it as a user variable will work just as well.

To create the ‘CRYSTAL’ environment variable first click on the New button. You will be presented with a dialog for inserting the necessary information. In the text box Variable name insert ‘CRYSTAL’ and in the Variable value text box type the path to your ‘CS’ dir (i.e. ‘C:\projects\CS’).

Now hit the Ok buttons until you are back at the Control Panel.

If you have any command lines sessions open you will need to close and restart them for the variable to take effect. Rebooting should not be necessary.

Unix (GNU/Linux, BSD, Darwin, etc.)

There are several ways of setting environment variables in Unix. There are two common types of Unix shells, the Bourne shell (and its variants, such as Bash), and the C-shell (and its variants, such as Tcsh). Setting environment variables in Bourne shells is done in two steps. First set the variable, and then export it so that it is available to programs run by the shell. For example, if Crystal Space is installed in ‘/usr/local/CS’ the correct commands would be:

 
CRYSTAL="/usr/local/CS"
export CRYSTAL

Some Bourne shells (such as Bash) allow the two steps to be combined, so that the following single command may also work:

 
export CRYSTAL="/usr/local/CS"

For C-shell, you instead use the ‘setenv’ command. For example:

 
setenv CRYSTAL "/usr/local/CS"

If you do not want to type these commands each time you start up a shell, you should insert them into one of the shell startup files that are automatically invoked when the shell launches. For Bourne shell, you can place the commands in a file named ‘.profile’ in your home directory. Bash users can insert them into the file ‘.bash_profile’, or alternately ‘/etc/profile’ if you want to set the ‘CRYSTAL’ environment variable for all users. C-shell users can insert the ‘setenv’ command into the ‘.cshrc’ file in their home directory (or, the file ‘.tcshrc’ for Tcsh users).

If you are modifying a global startup file, such as ‘/etc/profile’, be sure to read the comments in the since some configuration tools of GNU/Linux distributions override the settings. In this case the distributions often created other files that are called automatically and are not touched by the configuration tools.

MacOS/X

Rather than setting an environment variable, MacOS/X users should set up the ‘CrystalSpaceRoot’ default in order to allow Crystal Space applications to be launched from the Finder. As with the ‘CRYSTAL’ environment variable, the ‘CrystalSpaceRoot’ default should point at the root of the Crystal Space directory hierarchy, such as ‘/usr/local/CS’. See the build instructions for MacOS/X for a more detailed description. See section Using Crystal Space.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated using texi2html 1.76.