DJGPP Package of GNU Multi Precision (GMP) Library 4.1.2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you wish to:

* use GMP in your programs, you only need the binary distribution;

* rebuild the GMP libraries for maximum performance on your computer,
  then you only need the source distribution;

* read the documentation in a format other than info, e.g. PostScript,
  you need the documentation distribution.

Please note that some files are in more than one distribution - they
should be the same in each distribution, so it is same to overwrite
when extracting the archives.

Installing the Binary Distribution
----------------------------------

To use GMP, the following packages are required:

. DJGPP 2.03
. GNU C compiler (gcc) - version 2.95.x or greater suggested
. GNU C++ compiler (g++) - version 3.2 or greater required
. GNU binutils - version 2.13 suggested

g++ version 3.2 or greater is only required, if you intend to use
GMP's C++ features. The C++ ABI changed between g++ 2.x and g++ 3.0
and again between g++ 3.1.1 and g++ 3.2. Since GMP's C++ library
has been compiled with g++ 3.2, g++ 3.2 or later is required to use
the GMP C++ library in C++ programs.

If you wish to read the documentation, you should also install:

. GNU texinfo 4.0 or later

Unzip the distribution preserving the directory structure - use PKUNZIP's
-d option; use an equivalent option with other unzippers. Unzip into
the top DJGPP installation directory, e.g. c:\djgpp.

Entries need to be added to the info directory for 'info gmp'
and 'info mpfr' to work. To add the entries, run the following commands:

    install-info --info-file=c:/djgpp/info/gmp.info --info-dir=c:/djgpp/info
    install-info --info-file=c:/djgpp/info/mpfr.info --info-dir=c:/djgpp/info

Replace c:/djgpp with the actual DJGPP directory path.

The libraries in the binary distribution have been stripped of debugging
information.

Installing the Documentation Distribution
-----------------------------------------

Unzip the distribution preserving the directory structure - use PKUNZIP's
-d option; use an equivalent option with other unzippers. Unzip into
the top DJGPP installation directory, e.g. c:\djgpp.

Building from the Source Distribution
-------------------------------------

GMP was straightforward to build from sources. None of the library
sources required patching. To build GMP, the following packages
were used:

. DJGPP 2.03
. GNU bash 2.04
. GNU C compiler, gcc 3.2.1
. GNU C++ compiler, g++ 3.2.1
. GNU binutils 2.13
. GNU make 3.79.2 alpha 2
. GNU fileutils 4.1
. GNU sh-utils 2.0.11
. GNU grep 2.4
. GNU sed 3.02.80
. GNU awk 3.0.3
. GNU m4 1.4
. GNU texinfo 4.2

bash 2.04 is required to build GMP 4.1.2. The build will fail with
bash 2.03.

In the instructions below, it is assumed that bash is your shell.
If it is not, start bash by running the command 'bash'.

GMP can be built with optimisations for different processors.
The distributed binaries were made for i386 processors by running
'configure' like so:

    ./configure --build=i386-pc-msdosdjgpp [<other configure options>]

You can get a list of available configure options by running:

    ./configure --help

If you do not identify the host system, the configure script will detect
it. If you want maximum performance, this is best; if you want maximum
compatibility, then build for i386 processors.

To configure & build for installation in the DJGPP directory:

    ./configure --prefix=/dev/env/DJDIR [<other configure options>]
    make

This may take some time (tens of minutes). GMP comes with some tests,
which can be used to check that gmp has built correctly. To run
the tests:

    make check

'configure' was run like this for the normal binary release:

    AWK=gawk CXX=gxx ./configure \
        --build=i386-pc-msdosdjgpp --disable-shared --disable-alloca \
        --enable-mpbsd --enable-mpfr --enable-cxx \
        --prefix=/dev/env/DJDIR

For your convenience you can run the script 'djconfig.sh' in the djgpp/
directory off the GMP source directory (gnu/gmp-4.12):

    bash djgpp/djconfig.sh

The libraries in the binary distribution were stripped of debugging
information. Because some of the source files in the library have
the same name, the library cannot be stripped, because 'strip'
would discard all but one of the object files with the same name
(no path information is stored). So the object files need to be
stripped and the library rebuilt, to remove debugging information.
After the library was built successfully, the following commands
were run:

    find . -name '*.o' | xargs strip -g
    find . -name '*.lo' | xargs touch
    make

NB: This requires GNU findutils to be installed.

Finally
-------

I hope this package is useful. Please feel free to contact me
about any problems with the DJGPP packages of GMP.

Richard Dawe <richdawe@bigfoot.com> 2003-01-03
