Environment variables affecting the SOM Compiler
To execute the SOM Compiler on one or more files that contain IDL specifications
for one or more classes, use the sc. or somc as follows:
sc [-options] files (on AIX or OS/2)
somc [-options] files (on Windows)
where "files" specifies one or more .idl files.
Available "-options" for the command are detailed in the next topic. The
operation of the SOM Compiler (whether it produces C binding files or C++
binding files, for example) is also controlled by a set of environment variables
that can be set before the sc command is issued. The applicable environment
variables are as follows:
SMEMIT
Determines which output files the SOM Compiler
produces. Its value consists of a list of items separated by semicolons
for OS/2, or by semicolons or colons for AIX. Each item designates an emitter
to execute. For example, the statement:
SET SMEMIT=c;h;ih
(for OS/2, for C binding files)
export SMEMIT="c;h;ih"
directs
the SOM Compiler to produce the C binding files "hello.c", "hello.h", and"hello.ih"
from the "hello.idl" input specification. By comparison,
SET SMEMIT=xc;xh;xih
export SMEMIT="xc;xh;xih"
directs
the SOM Compiler to produce C++ binding files "hello.C" (for AIX) or "hello.cpp"
(for OS/2), "hello.xh", and "hello.xih" from the "hello.idl" input specification.
By default, all output files are placed in the same directory as the input
file. If the SMEMIT environment variable is not set, then a default value
of "h;ih" is assumed.
Windows note: The SMEMIT environmental variable can be set by using the
SET command before the somc command is issued. For example:
SET SMEMIT="c;h;ih" (for Windows)
If you are running the SOM Compiler from a DOS box under Windows, make sure
to define SMEMIT before Windows is started.
SMINCLUDE
SMTMP
Specifies the directory that the SOM Compiler
should use to hold intermediate output files. This directory should not
coincide with the directory of the input or output files. For AIX, the
default setting of SMTMP is /tmp; for OS/2, the default setting of SMTMP
is the root directory of the current drive.
OS/2 or Windows example:
SET SMTMP=..\MYSCDIR\GARBAGE
tells the SOM Compiler to place the temporary files in the GARBAGE directory.
Or, on OS/2 only:
SET SMTMP=%TMP%
tells the SOM Compiler to use the same directory for temporary files as
given by the setting of the TMP environment variable (the defult location
for temporary system files). (On Windows, you cannot set one variable to
another.)
AIX example:
export SMTMP=$TMP
export SMTMP=../myscdir/garbage
SMKNOWNEXTS
Specifies
additional emitters to which the SOM Compiler should add a header. For example,
if you were to write a new emitter for Pascal, called "emitpas", then by
default the SOM Compiler would not add any header comments to it. However,
by setting SMKNOWNEXTS=pas, as shown:
set SMKNOWNEXTS=pas
export SMKNOWNEXTS=pas
the
SOM Compiler will add a header to files generated with the "emitpas" emitter.
The "header" added is a SOM Compiler-generated message plus any comments,
such as copyright statements, that appear at the head of your .idl input
file. For details on writing your own emitter, see the Emitter Framework
Guide and Reference.
SOMIR
Specifies
the name (or list of names) of the Interface Repository file. The ir
emitter, if run, creates the Interface Repository, or checks it for
consistency if it already exists. If the -u option is specified when
invoking the SOM Compiler, the ir emitter also updates
an existing Interface Repository.
SMADDSTAR
When
defined, causes all interface references to have a "*" added to them for
the C bindings. The command-line options -maddstar and -mnoaddstar
supercede and override the SMADDSTAR setting, however.
Note: Environment variables that affect the SOM Compiler can be
set for any -m options of the SOM Compiler command. See the -m
option in the following topic, "Running the SOM Compiler." Also, the
-E option in the following topic can be used to set an environment
variable.
[Back: Generating binding files]
[Next: Running the SOM Compiler]