Building the framework for Solaris systems

About this task

Because there is no cross-compiler that can build Solaris code on the PC, the framework libraries that are linked into Solaris applications must be built on Solaris. In addition to the framework source files, you need a script that removes carriage returns from framework source files to be built on Solaris. These files are provided in the Solaris library's tar file, which is installed when you select the Solaris 2.x Libraries option during the IBM® Rational® Rhapsody® installation.

To build the framework:

Procedure

  1. When installing Rational Rhapsody on the PC, select the Solaris 2.x Libraries option. This option installs the sol2shr.tar file, which contains the files needed to build the framework for Solaris.
  2. On the Solaris machine, create a rhapsody directory. For example:
    $ mkdir /usr/rhapsody
  3. Copy the sol2shr.tar file from the PC to the rhapsody directory on the Solaris machine.
  4. On the Solaris machine, extract the sol2shr.tar file in the rhapsody directory using the following command:
    $ tar xvf sol2shr.tar

    This creates a Share directory under rhapsody and extracts the framework source files to the appropriate subdirectories. It also extracts the GNU make executable and the removeCR.sh script to the Share/etc directory. The script removes carriage returns from UNIX files.

  5. On the Solaris machine, set the OMROOT environment variable to point to the new Share directory. For example, if you created the Share directory as
    /usr/rhapsody/Share, use the following command to set OMROOT:
    $ setenv OMROOT /usr/rhapsody/Share
  6. Ensure that the path to the compiler is set in the PATH variable.
  7. Change directory to $OMROOT/Lang<lang>.
  8. Run the removeCR.sh script to remove carriage returns from the sol2build.mak and sol2buildGNU.mak files using the following command:
    $ ../etc/removeCR.sh sol2build*.mak
  9. Change directory to $OMROOT/Lang<lang>/aom and run the removeCR.sh script to remove carriage returns from all the makefiles and source files in the directory using the following command:
    $ ../../etc/removeCR.sh *.mak *.h *.cpp
  10. Repeat 9 for each of the omcom, oxf, and tom subdirectories of $OMROOT/Lang<lang>.
  11. Change directory to $OMROOT/Lang<lang>.
  12. If you are using the Forte compiler, build the framework libraries using the following command:
    $ ../etc/make -f sol2build.mak

    If you are using the GNU compiler, use the following command:

    $ ../etc/make -f sol2buildGNU.mak

Feedback