       C Cross Referencing & Documenting tool Version 1.2 - cxref-cpp
       ==============================================================

This is a copy of the gcc-2.6.3 pre-processor with some modifications to make
cxref work better.

The files are modified in the following way.

cccp.c    - Hacked about a bit.
cexp.y    - As original.
version.c - As original.
pcp.h     - As original.
config.h  - As original.
tm.h      - As original or if this fails the minimum required is:
                CPP_PREDEFINES
                BITS_PER_*
                TARGET_*
                *_TYPE

config.h & tm.h
---------------

The files config.h and tm.h need to be taken from the appropriate place in the
gcc-2.6.3 source tree depending on the system architecture that you are
using. Use the configure script from gcc-2.6.3 if you are not sure.

The only config.h and tm.h supplied are for a 386/486 running Linux and a sparc
with SUNOS 4.1.x and Solaris 2.x.

  Machine                       tm.h                  config.h

i386 Linux              config/i386/linux.h     config/i386/xm-i386.h

Sparc Solaris 2.3       config/sparc/sol2.h     config/sparc/xm-sysv4.h
Sparc SUNOS 4.1         config/sparc/sparc.h    config/sparc/xm-sparc.h

Make a logical link to these files from config.h and tm.h.

Makefile
--------

[Note that what follows applies to gcc, other compilers may be different]

The cxref-cpp program needs to have the same include directories and predefined
macros built in to the program as gcc. This is so that cxref-cpp and gcc have
the same behaviour when processing the source files.

Use `gcc -E -v -dM - < /dev/null' to see the list of include paths and
predefined macros.

Those marked `->' below are important.

     | Reading specs from /usr/lib/gcc-lib/i486-linux/2.5.8/specs
     | gcc version 2.5.8
C -> |  /usr/lib/gcc-lib/i486-linux/2.5.8/cpp -lang-c -v -undef \
        -D__GNUC__=2 -D__GNUC_MINOR__=5 -Dunix -Di386 -Dlinux -D__unix__ \
        -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -D__i486__ \
        -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386) \
        -dM -
     |  /usr/lib/gcc-lib/i486-linux/2.5.8/cpp -lang-c -v -undef ...
     | GNU CPP version 2.5.8 (80386, BSD syntax)
     | #include "..." search starts here:
     | #include <...> search starts here:
I1-> |  /usr/local/include
I2-> |  /usr/i486-linux/include
I3-> |  /usr/lib/gcc-lib/i486-linux/2.5.8/include
     |  /usr/include
     | End of search list.
D -> | #define __linux__ 1 
D -> | #define linux 1 
D -> | #define __i386__ 1 
D -> | #define __i386 1 
D -> | #define __GNUC_MINOR__ 5 
D -> | #define __i486__ 1 
D -> | #define i386 1 
D -> | #define __unix 1 
D -> | #define __unix__ 1 
D -> | #define __GNUC__ 2 
D -> | #define __linux 1 
D -> | #define unix 1 


C   The command line that is used when gcc calls cpp. Notice that it includes a
    number of flags that change the default action of cpp.
    (Try doing 'cpp -v -dM - < /dev/null' to see the difference.)  Note in
    particular the -D... and -A... command line flags, see below in the
    description of 'D'.

I*  The include files that are built into the cpp program.
    Add these to the makefile as described below:

    I1) INCLUDE_DIR1
    I2) INCLUDE_DIR2
    I3) INCLUDE_DIR3

D   The built in and command line specified preprocessor definitions.
    Those built into the program are in the '#define CPP_PREDEFINES' in tm.h,
    those on the command line are shown at 'C' above.
    To set these, there are two methods, that can be used alone or together.
    1) The CPP_PREDEFINES variable in tm.h can be edited.
    2) The CPP_TO_USE variable in the Makefile in the main cxref
       directory can be set to include the command line arguments.
    

Testing
-------

When cxref-cpp has been made use 'cxref-cpp -v -dM - < /dev/null' and check that
the include directories and predefines are the same as those for gcc by using
'gcc -E -v -dM - < /dev/null'.

If there are differences then it is possible that the cxref-cpp program will
fail even though the source file is legal.
