scripts/build/gmp.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Jan 29 22:09:55 2009 +0000 (2009-01-29)
changeset 1176 8508ec77df4c
parent 1119 4e7562023f3e
permissions -rw-r--r--
If compiling the Java frontend, we'll require a native gcj, but only in this case.

/trunk/scripts/crosstool-NG.sh.in | 8 7 1 0 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
     1 # This file adds the functions to build the GMP library
     2 # Copyright 2008 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 do_gmp_get() { :; }
     6 do_gmp_extract() { :; }
     7 do_gmp() { :; }
     8 do_gmp_target() { :; }
     9 
    10 # Overide functions depending on configuration
    11 if [ "${CT_GMP_MPFR}" = "y" ]; then
    12 
    13 # Download GMP
    14 do_gmp_get() {
    15     CT_GetFile "gmp-${CT_GMP_VERSION}" {ftp,http}://{ftp.sunet.se/pub,ftp.gnu.org}/gnu/gmp
    16 }
    17 
    18 # Extract GMP
    19 do_gmp_extract() {
    20     CT_Extract "gmp-${CT_GMP_VERSION}"
    21     CT_Patch "gmp-${CT_GMP_VERSION}"
    22 }
    23 
    24 do_gmp() {
    25     mkdir -p "${CT_BUILD_DIR}/build-gmp"
    26     cd "${CT_BUILD_DIR}/build-gmp"
    27 
    28     CT_DoStep INFO "Installing GMP"
    29 
    30     CT_DoLog EXTRA "Configuring GMP"
    31     CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    32     CT_DoExecLog ALL                                \
    33     "${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \
    34         --build=${CT_BUILD}                         \
    35         --host=${CT_HOST}                           \
    36         --prefix="${CT_PREFIX_DIR}"                 \
    37         --disable-shared --enable-static            \
    38         --enable-fft --enable-mpbsd
    39 
    40     CT_DoLog EXTRA "Building GMP"
    41     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    42 
    43     if [ "${CT_GMP_CHECK}" = "y" ]; then
    44         CT_DoLog EXTRA "Checking GMP"
    45         CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
    46     fi
    47 
    48     CT_DoLog EXTRA "Installing GMP"
    49     CT_DoExecLog ALL make install
    50 
    51     CT_EndStep
    52 }
    53 
    54 if [ "${CT_GMP_MPFR_TARGET}" = "y" ]; then
    55 
    56 do_gmp_target() {
    57     mkdir -p "${CT_BUILD_DIR}/build-gmp-target"
    58     cd "${CT_BUILD_DIR}/build-gmp-target"
    59 
    60     CT_DoStep INFO "Installing GMP for the target"
    61 
    62     CT_DoLog EXTRA "Configuring GMP"
    63     CFLAGS="${CT_CFLAGS_FOR_TARGET}"                \
    64     CT_DoExecLog ALL                                \
    65     "${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \
    66         --build=${CT_BUILD}                         \
    67         --host=${CT_TARGET}                         \
    68         --prefix=/usr                               \
    69         --disable-shared --enable-static            \
    70         --enable-fft --enable-mpbsd
    71 
    72     CT_DoLog EXTRA "Building GMP"
    73     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    74 
    75     # Not possible to check MPFR while X-compiling
    76 
    77     CT_DoLog EXTRA "Installing GMP"
    78     CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" install
    79 
    80     CT_EndStep
    81 }
    82 
    83 fi # CT_GMP_MPFR_TARGET == y
    84 
    85 fi # CT_GMP_MPFR == y