Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)

File Locations for c89 and c99 Files
The standard C and C++ header files, library files, and other files for native c89, c99, and TNS
c89 are in different locations.
Native c89 and c99 Standard Include Directories
The standard C and C++ header files for the native C compilers are in the /usr/include directory
for the OSS environment.
Native c89 and c99 Standard Library Directories
For native environments, the linker searches a list of standard library directories. For the OSS
environment, the default directories are /lib, /usr/lib, and /usr/local/lib.
Native c89 and c99 Installation Locations
Beginning with the D40.00 RVU, the TNS/R native c89 utility is installed in the /usr/bin directory
by default. The H-series and the J-series TNS/E native c89 utility and the c99 utility is also installed
in the /usr/bin directory by default.
TNS c89 Standard Include Directories
The standard C and C++ header files for the TNS C compiler are in the /usr/include directory
for the OSS environment.
TNS c89 Standard Library Directories
For TNS c89, the linker searches a default list of standard library directories specified by -L flags.
For the G-series OSS environment, it is the /nonnative/usr/lib directory. When using the -L
flag, c89 searches the default library directories after those specified by the -L flag.
TNS c89 Installation Locations
Beginning with the D40.00 RVU, the c89 utility for generating TNS object files is installed in the
/nonnative/usr/bin directory by default.
c89 and c99 Utility Examples
The following example compiles test.c and produces an a.out executable file:
c89 test.c
The following example compiles source code modules x.c, y.c, and z.c; links the object
files into an executable file called tst; and produces symbolic information for debugging:
c99 -g -o tst x.c y.c z.c
The following example compiles file.c and links the native object file into an executable
file called a.out in the current working directory. The native C compiler is used.
c89 file.c -lc -WBstatic -larchive -WBdynamic -lnative
By default on a TNS/R platform, nld performs dynamic linking by searching first for the file
libc.srl and then libc.a. nld then performs static linking by searching for the file
libarchive.a. nld then performs dynamic linking by searching first for the file
libnative.srl and then libnative.a.
On a TNS/E platform, eld performs dynamic linking by searching first for the file libc.so
and then libc.a. eld then performs static linking by searching for the file libarchive.a.
eld then performs dynamic linking by searching first for the file libnative.so and then
libnative.a.
The following example compiles file.c and links the PIC linkfile into a PIC program called
a.out.
42 The Development Environment