scripts/build/companion_libs/mpc.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Mar 29 00:15:32 2010 +0200 (2010-03-29)
changeset 1864 758d5137fe87
parent 1399 d603008707f1
child 1890 39045a2f1163
permissions -rw-r--r--
scripts/populate: optimise search loop

Curently, populate will iterate over all ELF (shared objects|executables)
to look for missing NEEDED DSOs, adding to the list at every iterations
of the search loop.

Instead of looking again at previously handled ELF files, recursively
resolve every ELf files.

Also, in case there are a whole lot of files (more than the shell can
accept as arguments list, or creating a command line longer than the
shell can cope with), use a temporary file with the list of files
to search for missing dependencies.
     1 # This file adds the functions to build the MPC library
     2 # Copyright 2009 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 do_mpc_get() { :; }
     6 do_mpc_extract() { :; }
     7 do_mpc() { :; }
     8 do_mpc_target() { :; }
     9 
    10 # Overide functions depending on configuration
    11 if [ "${CT_MPC}" = "y" ]; then
    12 
    13 # Download MPC
    14 do_mpc_get() {
    15     CT_GetFile "mpc-${CT_MPC_VERSION}" .tar.gz      \
    16         http://www.multiprecision.org/mpc/download
    17 }
    18 
    19 # Extract MPC
    20 do_mpc_extract() {
    21     CT_Extract "mpc-${CT_MPC_VERSION}"
    22     CT_Patch "mpc-${CT_MPC_VERSION}"
    23 }
    24 
    25 do_mpc() {
    26     mkdir -p "${CT_BUILD_DIR}/build-mpc"
    27     cd "${CT_BUILD_DIR}/build-mpc"
    28 
    29     CT_DoStep INFO "Installing MPC"
    30 
    31     CT_DoLog EXTRA "Configuring MPC"
    32     CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    33     CT_DoExecLog ALL                                \
    34     "${CT_SRC_DIR}/mpc-${CT_MPC_VERSION}/configure" \
    35         --build=${CT_BUILD}                         \
    36         --host=${CT_HOST}                           \
    37         --prefix="${CT_PREFIX_DIR}"                 \
    38         --with-gmp="${CT_PREFIX_DIR}"               \
    39         --with-mpfr="${CT_PREFIX_DIR}"              \
    40         --enable-shared                             \
    41         --disable-static                            \
    42 
    43     CT_DoLog EXTRA "Building MPC"
    44     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    45 
    46     if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then
    47         CT_DoLog EXTRA "Checking MPC"
    48         CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
    49     fi
    50 
    51     CT_DoLog EXTRA "Installing MPC"
    52     CT_DoExecLog ALL make install
    53 
    54     CT_EndStep
    55 }
    56 
    57 fi # CT_MPC