2.6. Setting up the Environment

As with the installation process itself, the steps required to set up your environment depend on your host operating system.

2.6.1. Setting up the Environment on Microsoft Windows Hosts

2.6.1.1. Setting the PATH

If you installed Sourcery CodeBench Lite using the graphical installer then you may skip this step. The installer does this setup for you.

In order to use the Sourcery CodeBench tools from the command line, you should add them to your PATH. In the instructions that follow, replace installdir with the full pathname of your Sourcery CodeBench Lite installation directory, including the drive letter.

To set the PATH on a Microsoft Windows Vista system, use the following command in a cmd.exe shell:

> setx PATH "%PATH%;installdir\bin"

To set the PATH on a system running Microsoft Windows 7, from the desktop bring up the Start menu and right click on Computer. Select Properties and click on Advanced system settings. Go to the Advanced tab, then click on the Environment Variables button. Select the PATH variable and click Edit. Add the string ;installdir\bin to the end, and click OK.

To set the PATH on older versions of Microsoft Windows, from the desktop bring up the Start menu and right click on My Computer. Select Properties, go to the Advanced tab, then click on the Environment Variables button. Select the PATH variable and click the Edit. Add the string ;installdir\bin to the end, and click OK.

You can verify that your PATH is set up correctly by starting a new cmd.exe shell and running:

> arm-none-eabi-g++ -v

Verify that the last line of the output contains: Sourcery CodeBench Lite 2011.09-69.

2.6.1.2. Working with Cygwin

Sourcery CodeBench Lite does not require Cygwin or any other UNIX emulation environment. You can use Sourcery CodeBench directly from the Windows command shell. You can also use Sourcery CodeBench from within the Cygwin environment, if you prefer.

The Cygwin emulation environment translates Windows path names into UNIX path names. For example, the Cygwin path /home/user/hello.c corresponds to the Windows path c:\cygwin\home\user\hello.c. Because Sourcery CodeBench is not a Cygwin application, it does not, by default, recognize Cygwin paths.

If you are using Sourcery CodeBench from Cygwin, you should set the CYGPATH environment variable. If this environment variable is set, Sourcery CodeBench Lite automatically translates Cygwin path names into Windows path names. To set this environment variable, type the following command in a Cygwin shell:

> export CYGPATH=cygpath

To resolve Cygwin path names, Sourcery CodeBench relies on the cygpath utility provided with Cygwin. You must provide Sourcery CodeBench with the full path to cygpath if cygpath is not in your PATH. For example:

> export CYGPATH=c:/cygwin/bin/cygpath

directs Sourcery CodeBench Lite to use c:/cygwin/bin/cygpath as the path conversion utility. The value of CYGPATH must be an ordinary Windows path, not a Cygwin path.

2.6.2.  Setting up the Environment on GNU/Linux Hosts

If you installed Sourcery CodeBench Lite using the graphical installer then you may skip this step. The installer does this setup for you.

Before using Sourcery CodeBench Lite you should add it to your PATH. The command you must use varies with the particular command shell that you are using. If you are using the C Shell (csh or tcsh), use the command:

> setenv PATH installdir/bin:$PATH

If you are using Bourne Shell (sh), the Korn Shell (ksh), or another shell, use:

> PATH=installdir/bin:$PATH
> export PATH

If you are not sure which shell you are using, try both commands. In both cases, replace installdir with the full pathname of your Sourcery CodeBench Lite installation directory.

You may also wish to set the MANPATH environment variable so that you can access the Sourcery CodeBench manual pages, which provide additional information about using Sourcery CodeBench. To set the MANPATH environment variable, follow the same steps shown above, replacing PATH with MANPATH, and bin with share/doc/sourceryg++-arm-none-eabi/man.

You can test that your PATH is set up correctly by running the following command:

> arm-none-eabi-g++ -v

Verify that the last line of the output contains: Sourcery CodeBench Lite 2011.09-69.