SLAU131V October 2004 – February 2020
An environment variable is a system symbol that you define and assign a string to. The linker uses an environment variable named MSP430_C_DIR to name alternate directories that contain object libraries. The command syntaxes for assigning the environment variable are:
Operating System | Enter |
---|---|
UNIX (Bourne shell) | MSP430_C_DIR="pathname1;pathname2; . . ."; export MSP430_C_DIR |
Windows | set MSP430_C_DIR= pathname1;pathname2; . . . |
The pathnames are directories that contain input files. Use the --library linker option on the command line or in a command file to tell the linker which library or linker command file to search for. The pathnames must follow these constraints:
set MSP430_C_DIR= c:\path\one\to\tools ; c:\path\two\to\tools
set MSP430_C_DIR=c:\first path\to\tools;d:\second path\to\tools
In the example below, assume that two archive libraries called r.lib and lib2.lib reside in ld and ld2 directories. The table below shows how to set the environment variable, and how to use both libraries during a link. Select the row for your operating system:
Operating System | Invocation Command |
---|---|
UNIX (Bourne shell) |
MSP430_C_DIR="/ld ;/ld2"; export MSP430_C_DIR;
|
Windows |
MSP430_C_DIR=\ld;\ld2
|
The environment variable remains set until you reboot the system or reset the variable by entering:
Operating System | Enter |
---|---|
UNIX (Bourne shell) |
unset MSP430_C_DIR
|
Windows |
set MSP430_C_DIR=
|
The assembler uses an environment variable named MSP430_A_DIR to name alternate directories that contain copy/include files or macro libraries. If MSP430_C_DIR is not set, the linker searches for object libraries in the directories named with MSP430_A_DIR. For information about MSP430_A_DIR, see Section 4.5.2. For more information about object libraries, see Section 8.6.3.