The run-time source version of the compiler includes ANSI-standard source code for the base run-time libraries. This code can be used to build binary versions of the run-time libraries for other operating environments. Included with the source code is a portable makefile that can be used to build the libraries on the target platform with minimal changes. All platform-specific items are isolated in the platform.mk file in the root directory of the installation.
The procedure to port the run-time code to a different platform is as follows (note: this assumes common UNIX or GNU compilation utilities are in place on the target platform).
Create a directory tree containing a root directory (the name does not matter) and lib, src, rt*src, and build_lib subdirectories (note: in these definitions, * is a wildcard character indicating there are multiple directories matching this pattern). The tree should be as follows:
Copy the files ending in extension ".mk" from the root directory of the installation to the root directory of the target platform (note: if transferring from DOS to UNIX or vice-versa, FTP the files in ASCII mode to ensure lines are terminated properly).
Copy all files from the src and the different rt*src subdirectories from the installation to the src and rt*src directories on the target platform (note: if transferring from DOS to UNIX or vice-versa, FTP the files in ASCII mode to ensure lines are terminated properly).
Copy the makefile from the build_lib subdirectory of the installation to the build_lib subdirectory on the target platform (note: if transferring from DOS to UNIX or vice-versa, FTP the files in ASCII mode to ensure lines are terminated properly).
Edit the platform.mk file in the root subdirectory and modify the compilation parameters to fit those of the compiler of the target system. In general, the following parameters will need to be adjusted:
CC
: C compiler executable name
CCC
: C++ compiler executable
name
CFLAGS_
: Flags that should be
specified on the C or C++ command line
The platform.w32 and platform.gnu files in the root directory of the installation are sample files for Windows 32 (Visual C++) and GNU compilers respectively. Either of these can be renamed to platform.mk for building in either of these environments.
Invoke the makefile in the build_lib subdirectory.
If all parameters were set up correctly, the result should be binary library files created in the lib subdirectory.