scripts/build/companion_libs/cloog.sh
author Anthony Foiani <anthony.foiani@gmail.com>
Fri Oct 22 22:02:57 2010 +0200 (2010-10-22)
changeset 2154 250cdcc86441
parent 2099 1bb063c8a0ca
child 2199 ab0759ba292c
child 2263 2b25e1dab615
permissions -rw-r--r--
scripts: add "FILE" and "CFG" debug levels.

I ran into some minor difficulties looking through the build log for a
particular file: I wasn't interested in seeing it unpacked, but only
when it is built or installed. Adding these two levels allows me to
differentiate between those cases.

[Yann E. MORIN: Those are blind log levels, and are used only to search
in the build-log afterward.]

Signed-off-by: Anthony Foiani <anthony.foiani@gmail.com>
     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 
     9 # Overide functions depending on configuration
    10 if [ "${CT_CLOOG}" = "y" ]; then
    11 
    12 # Download CLooG
    13 do_cloog_get() {
    14     CT_GetFile "cloog-ppl-${CT_CLOOG_VERSION}"  \
    15         ftp://gcc.gnu.org/pub/gcc/infrastructure
    16 }
    17 
    18 # Extract CLooG
    19 do_cloog_extract() {
    20     local _t
    21 
    22     CT_Extract "cloog-ppl-${CT_CLOOG_VERSION}"
    23 
    24     # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
    25     # while versions 0.15.4 onward do have the version in the dirname.
    26     case "${CT_CLOOG_VERSION}" in
    27         0.15.3) _t="";;
    28         *)      _t="-${CT_CLOOG_VERSION}";;
    29     esac
    30     CT_Pushd "${CT_SRC_DIR}/cloog-ppl${_t}"
    31     CT_Patch nochdir "cloog-ppl" "${CT_CLOOG_VERSION}"
    32     CT_Popd
    33 }
    34 
    35 do_cloog() {
    36     local _t
    37     local cloog_LDFLAGS
    38     local -a cloog_opts
    39 
    40     # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
    41     # while versions 0.15.4 onward do have the version in the dirname.
    42     case "${CT_CLOOG_VERSION}" in
    43         0.15.3) _t="";;
    44         *)      _t="-${CT_CLOOG_VERSION}";;
    45     esac
    46 
    47     mkdir -p "${CT_BUILD_DIR}/build-cloog-ppl"
    48     cd "${CT_BUILD_DIR}/build-cloog-ppl"
    49 
    50     CT_DoStep INFO "Installing CLooG/ppl"
    51 
    52     CT_DoLog EXTRA "Configuring CLooG/ppl"
    53 
    54     if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then
    55         cloog_opts+=( --enable-shared --disable-static )
    56     else
    57         cloog_opts+=( --disable-shared --enable-static )
    58         cloog_LDFLAGS='-lstdc++ -lm'
    59     fi
    60 
    61     CFLAGS="${CT_CFLAGS_FOR_HOST}"              \
    62     LDFLAGS="${cloog_LDFLAGS}"                  \
    63     CT_DoExecLog CFG                            \
    64     "${CT_SRC_DIR}/cloog-ppl${_t}/configure"    \
    65         --build=${CT_BUILD}                     \
    66         --host=${CT_HOST}                       \
    67         --prefix="${CT_COMPLIBS_DIR}"           \
    68         --with-gmp="${CT_COMPLIBS_DIR}"         \
    69         --with-ppl="${CT_COMPLIBS_DIR}"         \
    70         --with-bits=gmp                         \
    71         "${cloog_opts[@]}"
    72 
    73     CT_DoLog EXTRA "Building CLooG/ppl"
    74     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    75 
    76     if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
    77         CT_DoLog EXTRA "Checking CLooG/ppl"
    78         CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
    79     fi
    80 
    81     CT_DoLog EXTRA "Installing CLooG/ppl"
    82     CT_DoExecLog ALL make install
    83 
    84     # Remove spuriously installed file
    85     CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/bin/cloog"
    86 
    87     CT_EndStep
    88 }
    89 
    90 fi # CT_CLOOG