scripts/build/companion_libs/cloog.sh
changeset 2927 ddaae597fd7c
parent 2854 a70abdbfa342
child 2929 22e495b7bee8
     1.1 --- a/scripts/build/companion_libs/cloog.sh	Fri Jan 27 13:31:16 2012 +0100
     1.2 +++ b/scripts/build/companion_libs/cloog.sh	Sun Jul 17 18:56:30 2011 +0200
     1.3 @@ -4,7 +4,7 @@
     1.4  
     1.5  do_cloog_get() { :; }
     1.6  do_cloog_extract() { :; }
     1.7 -do_cloog() { :; }
     1.8 +do_cloog_for_host() { :; }
     1.9  
    1.10  # Overide functions depending on configuration
    1.11  if [ "${CT_CLOOG}" = "y" ]; then
    1.12 @@ -33,25 +33,49 @@
    1.13      fi
    1.14  }
    1.15  
    1.16 -do_cloog() {
    1.17 +# Build CLooG/PPL for running on host
    1.18 +do_cloog_for_host() {
    1.19 +    local -a cloog_opts
    1.20 +
    1.21 +    CT_DoStep INFO "Installing CLooG/PPL for host"
    1.22 +    CT_mkdir_pushd "${CT_BUILD_DIR}/build-cloog-ppl-host-${CT_HOST}"
    1.23 +
    1.24 +    cloog_opts+=( "host=${CT_HOST}" )
    1.25 +    cloog_opts+=( "prefix=${CT_COMPLIBS_DIR}" )
    1.26 +    cloog_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
    1.27 +    do_cloog_backend "${cloog_opts[@]}"
    1.28 +
    1.29 +    CT_Popd
    1.30 +    CT_EndStep
    1.31 +}
    1.32 +
    1.33 +# Build ClooG/PPL
    1.34 +#     Parameter     : description               : type      : default
    1.35 +#     host          : machine to run on         : tuple     : (none)
    1.36 +#     prefix        : prefix to install into    : dir       : (none)
    1.37 +#     cflags        : host cflags to use        : string    : (empty)
    1.38 +do_cloog_backend() {
    1.39 +    local host
    1.40 +    local prefix
    1.41 +    local cflags
    1.42      local cloog_src_dir="${CT_SRC_DIR}/cloog-ppl-${CT_CLOOG_VERSION}"
    1.43 +    local arg
    1.44  
    1.45 -    mkdir -p "${CT_BUILD_DIR}/build-cloog-ppl"
    1.46 -    cd "${CT_BUILD_DIR}/build-cloog-ppl"
    1.47 -
    1.48 -    CT_DoStep INFO "Installing CLooG/ppl"
    1.49 +    for arg in "$@"; do
    1.50 +        eval "${arg// /\\ }"
    1.51 +    done
    1.52  
    1.53      CT_DoLog EXTRA "Configuring CLooG/ppl"
    1.54  
    1.55      CT_DoExecLog CFG                            \
    1.56 -    CFLAGS="${CT_CFLAGS_FOR_HOST}"              \
    1.57 +    CFLAGS="${cflags}"                          \
    1.58      LIBS="-lm"                                  \
    1.59      "${cloog_src_dir}/configure"                \
    1.60          --build=${CT_BUILD}                     \
    1.61 -        --host=${CT_HOST}                       \
    1.62 -        --prefix="${CT_COMPLIBS_DIR}"           \
    1.63 -        --with-gmp="${CT_COMPLIBS_DIR}"         \
    1.64 -        --with-ppl="${CT_COMPLIBS_DIR}"         \
    1.65 +        --host=${host}                          \
    1.66 +        --prefix="${prefix}"                    \
    1.67 +        --with-gmp="${prefix}"                  \
    1.68 +        --with-ppl="${prefix}"                  \
    1.69          --with-bits=gmp                         \
    1.70          --with-host-libstdcxx='-lstdc++'        \
    1.71          --disable-shared                        \
    1.72 @@ -67,8 +91,6 @@
    1.73  
    1.74      CT_DoLog EXTRA "Installing CLooG/ppl"
    1.75      CT_DoExecLog ALL make install-libLTLIBRARIES install-pkgincludeHEADERS
    1.76 -
    1.77 -    CT_EndStep
    1.78  }
    1.79  
    1.80  fi # CT_CLOOG