scripts/build/companion_libs/cloog.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Aug 06 00:00:26 2010 +0200 (2010-08-06)
changeset 2071 5526fb72a893
parent 1901 bdb3a98e064b
child 2099 1bb063c8a0ca
permissions -rw-r--r--
complibs/cloog: with static ppl, correctly link with libm

On some Fedora boxen (at least FC13), it is also required
to link with libm when static ppl is used.

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