scripts/build/companion_libs/cloog.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Jan 01 17:09:52 2010 +0100 (2010-01-01)
changeset 1673 ecb7fcc4edb0
parent 1530 fafe0dd00c66
child 1761 88020b2c3246
permissions -rw-r--r--
scripts/functions: fix downloading with aria2

In case the remote file does not exist (and probably for some
other reasons as well), aria2 nonetheless creates an empty file
(or not empty for some other reasons).

The solution is to delete the file whenever aria2 fails.
     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_PPL_CLOOG_MPC}" = "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 "cloog-ppl-${CT_CLOOG_VERSION}" nochdir
    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_PPL_CLOOG_MPC