scripts/build/companion_libs/cloog.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Jan 13 23:20:39 2011 +0100 (2011-01-13)
branch1.9
changeset 2263 2b25e1dab615
parent 2154 250cdcc86441
permissions -rw-r--r--
complibs/cloog: regenerate autostuff files

Latest version of CLooG does not have properly generated autoconf files,
so they need to be regenerated before the call to ./configure

Signed-off-by: "Ilya A. Volynets-Evenbakh" <ilya@total-knowlege.com>
[yann.morin.1998@anciens.enib.fr: make it conditional on 0.15.10 only]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 32c7bbfa3f6514a0fbd5a7388d33e664ba62ed89)
     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     if [ "${CT_CLOOG_VERSION}" = "0.15.10" ]; then
    33         ./autogen.sh
    34     fi
    35     CT_Popd
    36 }
    37 
    38 do_cloog() {
    39     local _t
    40     local cloog_LDFLAGS
    41     local -a cloog_opts
    42 
    43     # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
    44     # while versions 0.15.4 onward do have the version in the dirname.
    45     case "${CT_CLOOG_VERSION}" in
    46         0.15.3) _t="";;
    47         *)      _t="-${CT_CLOOG_VERSION}";;
    48     esac
    49 
    50     mkdir -p "${CT_BUILD_DIR}/build-cloog-ppl"
    51     cd "${CT_BUILD_DIR}/build-cloog-ppl"
    52 
    53     CT_DoStep INFO "Installing CLooG/ppl"
    54 
    55     CT_DoLog EXTRA "Configuring CLooG/ppl"
    56 
    57     if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then
    58         cloog_opts+=( --enable-shared --disable-static )
    59     else
    60         cloog_opts+=( --disable-shared --enable-static )
    61         cloog_LDFLAGS='-lstdc++ -lm'
    62     fi
    63 
    64     CFLAGS="${CT_CFLAGS_FOR_HOST}"              \
    65     LDFLAGS="${cloog_LDFLAGS}"                  \
    66     CT_DoExecLog CFG                            \
    67     "${CT_SRC_DIR}/cloog-ppl${_t}/configure"    \
    68         --build=${CT_BUILD}                     \
    69         --host=${CT_HOST}                       \
    70         --prefix="${CT_COMPLIBS_DIR}"           \
    71         --with-gmp="${CT_COMPLIBS_DIR}"         \
    72         --with-ppl="${CT_COMPLIBS_DIR}"         \
    73         --with-bits=gmp                         \
    74         "${cloog_opts[@]}"
    75 
    76     CT_DoLog EXTRA "Building CLooG/ppl"
    77     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    78 
    79     if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
    80         CT_DoLog EXTRA "Checking CLooG/ppl"
    81         CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
    82     fi
    83 
    84     CT_DoLog EXTRA "Installing CLooG/ppl"
    85     CT_DoExecLog ALL make install
    86 
    87     # Remove spuriously installed file
    88     CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/bin/cloog"
    89 
    90     CT_EndStep
    91 }
    92 
    93 fi # CT_CLOOG