scripts/build/mpfr.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Sep 14 16:21:07 2008 +0000 (2008-09-14)
changeset 850 ef8549b58b6f
parent 656 b43129be0f04
child 1063 1b4b6359a329
permissions -rw-r--r--
Introduce a new EXPERIMENTAL feature: BARE_METAL.
This should ultimately llow to build bare-metal compilers, for targets that have no kernel and no C library.
Move the C library build script to their own sub-directory; introduce an empty build script for bare-metal.
Move the compiler build script to its own sub-directory.
Move the kernel build script to its own sub-directory; introduce an empty build script for bare-metal.
Update the ARM target tuples to enable bare-metal targets.
Add two ARM bare-metal samples.
Add latest Linux kernel versions.

/trunk/scripts/build/kernel/none.sh | 77 6 71 0 +----
/trunk/scripts/build/cc/gcc.sh | 58 41 17 0 ++-
/trunk/scripts/build/libc/none.sh | 513 9 504 0 +-----------------------------
/trunk/scripts/crosstool.sh | 17 9 8 0 +
/trunk/scripts/functions | 6 4 2 0 +
/trunk/scripts/showSamples.sh | 6 3 3 0
/trunk/samples/arm-unknown-elf/crosstool.config | 225 225 0 0 +++++++++++++
/trunk/samples/arm-unknown-eabi/crosstool.config | 223 223 0 0 +++++++++++++
/trunk/config/kernel/linux_headers_install.in | 64 27 37 0 ++--
/trunk/config/kernel.in | 9 8 1 0 +
/trunk/config/toolchain.in | 1 1 0 0 +
/trunk/config/cc/gcc.in | 3 3 0 0 +
/trunk/config/debug/dmalloc.in | 1 1 0 0 +
/trunk/config/debug/gdb.in | 4 3 1 0 +
/trunk/config/debug/strace.in | 1 1 0 0 +
/trunk/config/debug/duma.in | 1 1 0 0 +
/trunk/config/cc.in | 8 8 0 0 +
/trunk/config/target.in | 13 13 0 0 +
/trunk/config/binutils.in | 1 1 0 0 +
/trunk/config/gmp_mpfr.in | 1 1 0 0 +
/trunk/config/libc.in | 17 11 6 0 +
/trunk/arch/arm/functions | 3 1 2 0 -
22 files changed, 600 insertions(+), 652 deletions(-)
     1 # This file adds the functions to build the MPFR library
     2 # Copyright 2008 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 do_print_filename() { :; }
     6 do_mpfr_get() { :; }
     7 do_mpfr_extract() { :; }
     8 do_mpfr() { :; }
     9 do_mpfr_target() { :; }
    10 
    11 # Overide function depending on configuration
    12 if [ "${CT_GMP_MPFR}" = "y" ]; then
    13 
    14 do_print_filename() {
    15     [ "${CT_GMP_MPFR}" = "y" ] || return 0
    16     echo "mpfr-${CT_MPFR_VERSION}"
    17 }
    18 
    19 # Download MPFR
    20 do_mpfr_get() {
    21     CT_GetFile "${CT_MPFR_FILE}" http://www.mpfr.org/mpfr-current/          \
    22                                  http://www.mpfr.org/mpfr-${CT_MPFR_VERSION}/
    23 }
    24 
    25 # Extract MPFR
    26 do_mpfr_extract() {
    27     CT_ExtractAndPatch "${CT_MPFR_FILE}"
    28 
    29     # OK, Gentoo have a sanity check that libtool.m4 and ltmain.sh have the
    30     # same version number. Unfortunately, some tarballs of MPFR are not
    31     # built sanely, and thus ./configure fails on Gentoo.
    32     # See: http://sourceware.org/ml/crossgcc/2008-05/msg00080.html
    33     # and: http://sourceware.org/ml/crossgcc/2008-06/msg00005.html
    34     # This hack is not bad per se, but the MPFR guys would be better not to
    35     # do that in the future...
    36     CT_Pushd "${CT_SRC_DIR}/${CT_MPFR_FILE}"
    37     if [ ! -f .autotools.ct-ng ]; then
    38         CT_DoLog DEBUG "Re-building autotools files"
    39         CT_DoExecLog ALL autoreconf -fi
    40         CT_DoExecLog ALL libtoolize -f
    41         touch .autotools.ct-ng
    42     fi
    43     CT_Popd
    44 }
    45 
    46 do_mpfr() {
    47     mkdir -p "${CT_BUILD_DIR}/build-mpfr"
    48     cd "${CT_BUILD_DIR}/build-mpfr"
    49 
    50     CT_DoStep INFO "Installing MPFR"
    51 
    52     CT_DoLog EXTRA "Configuring MPFR"
    53     CFLAGS="${CT_CFLAGS_FOR_HOST}"              \
    54     CT_DoExecLog ALL                            \
    55     "${CT_SRC_DIR}/${CT_MPFR_FILE}/configure"   \
    56         --build=${CT_BUILD}                     \
    57         --host=${CT_HOST}                       \
    58         --prefix="${CT_PREFIX_DIR}"             \
    59         --enable-thread-safe                    \
    60         --disable-shared --enable-static        \
    61         --with-gmp="${CT_PREFIX_DIR}"
    62 
    63     CT_DoLog EXTRA "Building MPFR"
    64     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    65 
    66     if [ "${CT_MPFR_CHECK}" = "y" ]; then
    67         CT_DoLog EXTRA "Checking MPFR"
    68         CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
    69     fi
    70 
    71     CT_DoLog EXTRA "Installing MPFR"
    72     CT_DoExecLog ALL make install
    73 
    74     CT_EndStep
    75 }
    76 
    77 if [ "${CT_GMP_MPFR_TARGET}" = "y" ]; then
    78 
    79 do_mpfr_target() {
    80     mkdir -p "${CT_BUILD_DIR}/build-mpfr-target"
    81     cd "${CT_BUILD_DIR}/build-mpfr-target"
    82 
    83     CT_DoStep INFO "Installing MPFR for the target"
    84 
    85     CT_DoLog EXTRA "Configuring MPFR"
    86     CFLAGS="${CT_CFLAGS_FOR_TARGET}"            \
    87     CT_DoExecLog ALL                            \
    88     "${CT_SRC_DIR}/${CT_MPFR_FILE}/configure"   \
    89         --build=${CT_BUILD}                     \
    90         --host=${CT_TARGET}                     \
    91         --prefix=/usr                           \
    92         --enable-thread-safe                    \
    93         --disable-shared --enable-static        \
    94         --with-gmp="${CT_SYSROOT_DIR}/usr"
    95 
    96     CT_DoLog EXTRA "Building MPFR"
    97     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    98 
    99     # Not possible to check MPFR while X-compiling
   100 
   101     CT_DoLog EXTRA "Installing MPFR"
   102     CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" install
   103 
   104     CT_EndStep
   105 }
   106 
   107 fi # CT_GMP_MPFR_TARGET == y
   108 
   109 fi # CT_GMP_MPFR == y