Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
The Development Environment
Open System Services Porting Guide520573-006
2-11
C and C++ Compilation Using the c89 Utility
you run c89 in the OSS environment; it will produce executables for the OSS
environment.
Input to the c89 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 UNIX run-time routines; and any library files that were produced by the
linker. c89 searches all of the standard Guardian system routines in its library.
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 native 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 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)