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

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 95/98/ME

First, locate the file `autoexec.bat'. This can be found on your system drive i.e. the `C:\' drive most commonly. Open the file with Notepad. Insert the following, making sure to change the string to correspond to the location of the `CS' directory on your computer.

 ```SET CRYSTAL=C:\projects\CS ```

After adding the above simply click File and Save. Close Notepad and reboot your computer.

Windows NT4/2000/XP

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

First, open the Control Panel. Now locate the System utility and click on the icon. You will now be presented with a dialog box. Click on the Advanced tab, then on the button Environment Variables.

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 ] [ >> ]

This document was generated using texi2html 1.76.