Open System Services Porting Guide (G06.24+, H06.03+)
Table Of Contents
- What’s New in This Manual
- About This Manual
- 1 Introduction to Porting
- 2 The Development Environment
- 3 Useful Porting Tools
- 4 Interoperating Between User Environments
- Purpose of Interoperability
- The OSS User Environment
- OSS Commands for the Guardian User
- Guardian Commands for the UNIX User
- OSS Pathname and Guardian Filename Conversions
- Running the OSS Shell and Commands From TACL
- Running Guardian Commands From the OSS Shell
- Running OSS Processes With Guardian Attributes
- Using OSS Commands to Manage Guardian Objects
- 5 Interoperating Between Programming Environments
- 6 OSS Porting Considerations
- 7 Porting UNIX Applications to the OSS Environment
- 8 Migrating Guardian Applications to the OSS Environment
- General Migration Guidelines
- C Compiler Issues for Guardian Programs
- Using New and Extended Guardian Procedures
- Using OSS Functions in a Guardian Program
- Interoperating With OSS Programs
- Starting an OSS Program From the Guardian Environment
- C Compiler Considerations for OSS Programs
- Porting a Guardian Program to the OSS Environment
- How Arguments Are Passed to the C or C++ Program
- Differences in the Two Run-Time Environments
- Which Run-Time Routines Are Available
- Use of Common Run-Time Environment (CRE) Functions
- Replacing Guardian Procedure Calls With Equivalent OSS Functions
- Which IPC Mechanisms Can Be Used
- Interactions Between Guardian and OSS Functions
- 9 Porting From Specific UNIX Systems
- 10 Native Migration Overview
- 11 Porting or Migrating Sockets Applications
- 12 Porting Threaded Applications
- A Equivalent OSS and UNIX Commands for Guardian Users
- B Equivalent Guardian Commands for OSS and UNIX Users
- C Equivalent Inspect Debugging Commands for dbx Commands
- D Equivalent Native Inspect Debugging Commands for dbx Commands
- E Standard POSIX Threads Functions: Differences Between the Previous and Current Standards
- Glossary
- Index
The Development Environment
Open System Services Porting Guide—520573-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)