Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)
files and the run-time libraries, enabling you to compile programs compliant with ISO/ANSI C for
either the OSS or Guardian environment. By default, if you run c99 in the OSS environment; it
will produce executables for the OSS environment.
Input to the c99 utility can include C or C++ source files; the object files generated by the -c flag;
libraries built with the archive utility; all of the files in /usr/lib, which are the standard C and
C++ standard libraries, additional operating system libraries, and POSIX standard libraries; and
any library files that were produced by the linker. c99 searches all of the standard Guardian
system routines in its library.
Beginning with the H06.24 and J06.13 RVUs, the c99 utility has new features for 64-bit support.
For information about 64-bit support features in the C/C++ compilers, see the C/C++ Programmer's
Guide in the NTL.
Compiling Using the TNS/R Native C Compiler
The TNS/R native C and C++ compilation tools conceptually consist of a C and C++ compiler
and front end for SQL (cfe for SQL/MP and sqlcfe for SQL/MX), global optimizer (uopt), code
generator (ugen), assembler (as1), linkers (ld and nld), and SQL compilers (sqlcomp for
SQL/MP and mxcmp for SQL/MX).
In the TNS/E compiler, cfe, sqlcfe, uopt, ugen, and as1 are replaced by ccombe and the
ld and nld linkers are replace by the TNS/E native linker eld.
To generate native object code, acceleration steps are not required. Also, generating object code
from C++ source code using the native C compilers involve many fewer steps than required with
the TNS C compiler.
In the OSS environments, a single c89 command can compile one or more source files and produce
an executable file, because the c89 utility calls the linker component after doing the compilations.
Depending on the flags and input file operands you include on the c89 command line, the native
C compilers can perform the following operations:
1. Compile any source C and C++ files into object files.
2. Link the object files together with any libraries specified on the command line. (This occurs if
no flags that prevent linking are specified, and the source files are compiled without errors.)
3. Write an executable object file to the file specified by the -o flag (if present) or to the file
a.out.
4. If the program contains embedded SQL statements, use the SQL compiler as the final step.
Compiling Using the TNS C Compiler
The G-series TNS C and C++ compilation tools conceptually consist of a C language preprocessor,
a C compiler, and a binder, with additional program components to support C++ preprocessing
(cfront), SQL preprocessing (sqlc for SQL/MP), SQL compilation (sqlcomp for SQL/MP and
mxcmp for SQL/MX), and object code acceleration (axcel). Binding is performed by the Binder
program; code acceleration is performed by the Accelerator program axcel.
The J-series and H-series TNS C and C++ compilation tools consist of the same components, with
the exception that acceleration is performed by the Object Code Accelerator (OCA) utility. The
H-series TNS C and C++ compilation tools run in the Guardian environment only.
The TNS C and C++ compilation tools are not supported on PCs or in the H-series or J-series OSS
environment. The code files and reference pages for the TNS C and C++ tools are located in the
OSS /nonnative directory.
Depending on the flags and input file operands you include on the c89 command line, the TNS
C compiler can perform the following operations:
1. Compile any source C and C++ files into object files
2. Bind object files with any libraries specified on the command line into a single program file
(unless the -c or -Wnobind flag is specified)
Working on the NonStop System 39