scripts/build/companion_libs/cloog.sh
author Remy Bohmer <linux@bohmer.net>
Thu May 27 23:18:19 2010 +0200 (2010-05-27)
changeset 2060 51e4597b07fc
parent 1893 f5dab3c43abf
child 2071 5526fb72a893
permissions -rw-r--r--
scripts: add option to strip all toolchain executables

To reduce filesizes of the toolchain and even improve build times
of projects to be build with this toolchain it is usefull to strip
the delivered toolchain executables. Since it is not likely that we
will debug the toolchain executables itself we do not need the
debug information inside the executables itself.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
     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++'
    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