scripts/build/companion_libs/ppl.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 1397 593fb5054810
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 PPL library
     2 # Copyright 2009 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 do_ppl_get() { :; }
     6 do_ppl_extract() { :; }
     7 do_ppl() { :; }
     8 do_ppl_target() { :; }
     9 
    10 # Overide functions depending on configuration
    11 if [ "${CT_PPL}" = "y" ]; then
    12 
    13 # Download PPL
    14 do_ppl_get() {
    15     CT_GetFile "ppl-${CT_PPL_VERSION}"                                      \
    16         http://www.cs.unipr.it/ppl/Download/ftp/releases/${CT_PPL_VERSION}  \
    17         ftp://ftp.cs.unipr.it/pub/ppl/releases/${CT_PPL_VERSION}            \
    18         ftp://gcc.gnu.org/pub/gcc/infrastructure
    19 }
    20 
    21 # Extract PPL
    22 do_ppl_extract() {
    23     CT_Extract "ppl-${CT_PPL_VERSION}"
    24     CT_Patch "ppl-${CT_PPL_VERSION}"
    25 }
    26 
    27 do_ppl() {
    28     mkdir -p "${CT_BUILD_DIR}/build-ppl"
    29     cd "${CT_BUILD_DIR}/build-ppl"
    30 
    31     CT_DoStep INFO "Installing PPL"
    32 
    33     CT_DoLog EXTRA "Configuring PPL"
    34     CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    35     CXXFLAGS="${CT_CFLAGS_FOR_HOST}"                \
    36     CT_DoExecLog ALL                                \
    37     "${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \
    38         --build=${CT_BUILD}                         \
    39         --host=${CT_HOST}                           \
    40         --prefix="${CT_PREFIX_DIR}"                 \
    41         --with-libgmp-prefix="${CT_PREFIX_DIR}"     \
    42         --with-libgmpxx-prefix="${CT_PREFIX_DIR}"   \
    43         --enable-shared                             \
    44         --disable-static                            \
    45         --disable-debugging                         \
    46         --disable-assertions                        \
    47         --disable-ppl_lcdd                          \
    48         --disable-ppl_lpsol
    49 
    50     # Maybe-options:
    51     # --enable-interfaces=...
    52     # --enable-optimization=speed  or sspeed (yes, with 2 's')
    53 
    54     CT_DoLog EXTRA "Building PPL"
    55     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    56 
    57     if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then
    58         CT_DoLog EXTRA "Checking PPL"
    59         CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
    60     fi
    61 
    62     CT_DoLog EXTRA "Installing PPL"
    63     CT_DoExecLog ALL make install
    64 
    65     # Remove spuriously installed file
    66     CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/bin/ppl-config"
    67 
    68     CT_EndStep
    69 }
    70 
    71 fi # CT_PPL