Prev: Source Tree Layout Table of Contents Next: Remainint Tasks

6. Building CPPX

1. Unpack the GNU GCC compiler. We will refer to this directory as <gcc_source_dir>.
2. Unpack the CPPX Source. We will refer to this directory as <cppx_source_dir>
3. Copy the gcc modifications to the GCC source code:
   cp <cppx_source_dir>/gcc/Makefile.in <gcc_source_dir>/gcc/
   cp <cppx_source_dir>/gcc/c-dump.c <gcc_source_dir>/gcc/
   cp <cppx_source_dir>/gcc/gd* <gcc_source_dir>/gcc/
   cp <cppx_source_dir>/gcc/cp/dump.c <gcc_source_dir>/gcc/cp/
   cp <cppx_source_dir>/gcc/cp/Make-lang.in <gcc_source_dir>/gcc/cp/
3. Build the GCC compiler
3a. Make an object directory and make it the current directory
   mkdir objdir
   cd objdir
3b.  configure the compiler. The binary directory for the compiler should be called "execs"
   <gcc_source_dir>/configure --prefix=<install_dir> --bindir=<install_dir>/execs
example:
    <gcc_source_dir>/configure --prefix=/usr/local/cppx --bindir=/usr/local/cppx/execs
You do not have to build and install the system in /usr/local. It can be anywhere, but you have to specify the location when you configure the modified compiler.
3c. make
3d. make install
You now have the compiler build that will dump the binary GD format facts installed. The actual compiler is callled g++ in the execs directory.
4. Configure CPPX transform sources (in <cppx_source_dir>/gd)
4a. The first two lines of Makefile should be set to the installation directory and execs directory of the compiler (e.g. /usr/local/cppx and /usrlocal/cppx/execs, or the other directory you specified in step 3b).
4b. The 3rd line of the Makefile should be set to the location of the gcc subdirectory of the gcc source.
4c. If the location of the modified compiler is anthing other than /usr/local/cppx, then change the appropriate line in the cppx script in the cppx source directory.
4d. Two files are actually symbolic links.  The file gd_graph.h must be a symbolic link to gd_graph.h in the compiler source directory. Rebuild it if necessary (if the link does not point to a valid file):
   rm gd_graph.h
   ln -s <gcc_source_dir>/gcc/gd_graph.h
The file gd_graph.o is a symbolic link to the object verfsion of gd_graph.c. Rebuild it if necessary.
   rm gd_graph.o
   ln -s <path_to_objdir>/gcc/gd_graph.o
5. Build the cppx transforms (i.e. make)
6. Make the bin directory in the compiler target if it does not already exist (e.g. mkdir /usr/local/cppx/bin)
7. Install the cppx transforms (i.e. make install)
8. Add the bin directory of the target directory to your path.

Prev: Source Tree Layout Table of Contents Next: Remaining Tasks