Changing the Compiler’s Behavior With Environment Variables
2-21
C Compiler Description
2.4 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.
2.4.1 Setting Default Shell Options (C_OPTION)
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
Enter
DOS or OS/2
set C_OPTION=
option
1
[;
option
2
. . .]
UNIX with C shell
setenv C_OPTION ”
option
1
[
option
2
. . .]
”
UNIX with Bourne or Korn
shell
C_OPTION=”
option
1
[
option
2
. . .]
”
export C_OPTION
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
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...