2.4 Changing the Compiler's Behavior With Environment Variables
2.4.1 Setting Default Shell Options (C_OPTION)
Changing the Compiler's Behavior With Environment Variables
You can define environment variables that set certain software tool parame-
ters you normally use. An environment variable is a special system symbol
that you define and associate to a string in your system initialization file. The
compiler uses this symbol to find or obtain certain types of information.
When you use environment variables, default values are set, making each
individual invocation of the compiler simpler because these parameters are
automatically specified. When you invoke a tool, you can use command-line
options to override many of the defaults that are set with environment vari-
ables.
You might find it useful to set the compiler, assembler, and linker shell default
options using the C_OPTION environment variable. If you do this, the shell
uses the default options and/or input filenames that you name with
C_OPTION every time you run the shell.
Setting the default options with the C_OPTION environment variable is useful
when you want to run the shell consecutive times with the same set of options
and/or input files. After the shell reads the command line and the input file-
names, it looks for the C_OPTION environment variable and processes it.
The table below shows how to set the C_OPTION environment variable.
Select the command for your operating system:
Operating System
DOS or OS/2
UNIX with C shell
UNIX with Bourne or Korn
shell
Environment variable options are specified in the same way and have the
same meaning as they do on the command line. For example, if you want to
always run quietly (the −q option), enable C source interlisting (the −s option),
and link (the −z option) for Windows, set up the C_OPTION environment vari-
able as follows:
set C_OPTION=−qs −z
Enter
set C_OPTION=option
1
setenv C_OPTION "option
C_OPTION="option
[option
1
export C_OPTION
C Compiler Description
[;option
. . .]
2
[option
. . .]"
1
2
. . .]"
2
2-21
Need help?
Do you have a question about the TMS320C2x and is the answer not in the manual?