scripts/build/companion_libs/cloog.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 1761 88020b2c3246
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 CLooG library
     2 # Copyright 2009 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 do_cloog_get() { :; }
     6 do_cloog_extract() { :; }
     7 do_cloog() { :; }
     8 do_cloog_target() { :; }
     9 
    10 # Overide functions depending on configuration
    11 if [ "${CT_CLOOG}" = "y" ]; then
    12 
    13 # Download CLooG
    14 do_cloog_get() {
    15     CT_GetFile "cloog-ppl-${CT_CLOOG_VERSION}"  \
    16         ftp://gcc.gnu.org/pub/gcc/infrastructure
    17 }
    18 
    19 # Extract CLooG
    20 do_cloog_extract() {
    21     local _t
    22 
    23     CT_Extract "cloog-ppl-${CT_CLOOG_VERSION}"
    24 
    25     # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
    26     # while versions 0.15.4 onward do have the version in the dirname.
    27     case "${CT_CLOOG_VERSION}" in
    28         0.15.3) _t="";;
    29         *)      _t="-${CT_CLOOG_VERSION}";;
    30     esac
    31     CT_Pushd "${CT_SRC_DIR}/cloog-ppl${_t}"
    32     CT_Patch nochdir "cloog-ppl-${CT_CLOOG_VERSION}"
    33     CT_Popd
    34 }
    35 
    36 do_cloog() {
    37     local _t
    38 
    39     # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
    40     # while versions 0.15.4 onward do have the version in the dirname.
    41     case "${CT_CLOOG_VERSION}" in
    42         0.15.3) _t="";;
    43         *)      _t="-${CT_CLOOG_VERSION}";;
    44     esac
    45 
    46     mkdir -p "${CT_BUILD_DIR}/build-cloog-ppl"
    47     cd "${CT_BUILD_DIR}/build-cloog-ppl"
    48 
    49     CT_DoStep INFO "Installing CLooG/ppl"
    50 
    51     CT_DoLog EXTRA "Configuring CLooG/ppl"
    52     CFLAGS="${CT_CFLAGS_FOR_HOST}"              \
    53     CT_DoExecLog ALL                            \
    54     "${CT_SRC_DIR}/cloog-ppl${_t}/configure"    \
    55         --build=${CT_BUILD}                     \
    56         --host=${CT_HOST}                       \
    57         --prefix="${CT_PREFIX_DIR}"             \
    58         --with-gmp="${CT_PREFIX_DIR}"           \
    59         --with-ppl="${CT_PREFIX_DIR}"           \
    60         --enable-shared                         \
    61         --disable-static                        \
    62         --with-bits=gmp
    63 
    64     CT_DoLog EXTRA "Building CLooG/ppl"
    65     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    66 
    67     if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then
    68         CT_DoLog EXTRA "Checking CLooG/ppl"
    69         CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
    70     fi
    71 
    72     CT_DoLog EXTRA "Installing CLooG/ppl"
    73     CT_DoExecLog ALL make install
    74 
    75     # Remove spuriously installed file
    76     CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/bin/cloog"
    77 
    78     CT_EndStep
    79 }
    80 
    81 fi # CT_CLOOG