6.5. GMP-4.3.1

GMP is a library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers.

6.5.1. Environment Settings

This package requires compiler variables to be set for the target in the environment.

export CC="${CLFS_TARGET}-gcc"
export CXX="${CLFS_TARGET}-g++"
export AR="${CLFS_TARGET}-ar"
export AS="${CLFS_TARGET}-as"
export RANLIB="${CLFS_TARGET}-ranlib"
export LD="${CLFS_TARGET}-ld"
export STRIP="${CLFS_TARGET}-strip"

6.5.2. Installation of GMP

Prepare GMP for compilation:

CPPFLAGS=-fexceptions ./configure --prefix=/usr \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --enable-cxx --enable-mpbsd

Compile the package:

make

Install the package:

make DESTDIR=${CLFS} install

At this time, Libtool does not support searching a sysroot for libraries. Leaving the .la files in place will cause Libtool to look in the wrong place for libraries. These files are not required for linking on Linux. Remove them with the following command:

rm -v ${CLFS}/usr/lib/lib{gmp,gmpxx,mp}.la

6.5.3. Contents of GMP

Installed Libraries: libgmp.[a,so], libgmpxx[a,so]

Short Descriptions

libgmp

Contains the definitions for GNU multiple precision functions.

libgmpxx

Contains a C++ class wrapper for GMP types.