scripts/build/companion_libs/ppl.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 18:56:30 2011 +0200 (2011-07-17)
changeset 2927 ddaae597fd7c
parent 2461 ec30b191f0e3
child 2929 22e495b7bee8
permissions -rw-r--r--
complibs: split companion libraries to backend/frontend, a-la cc_core

Move the actual complibs codes to backend functions that builds the
required combo of build/host/target as requested by a frontend.

This split is currently a no-op, but is required for the upcoming
canadian-cross rework, where we'll be needing to build the complibs
twice, one for build/build, and one for build/host.

This applies to the six companion libraries:
- GMP
- MPFR
- PPL
- Cloog/PPL
- MPC
- libelf

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 # This file adds the functions to build the PPL library
     2 # Copyright 2009 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 do_ppl_get() { :; }
     6 do_ppl_extract() { :; }
     7 do_ppl_for_host() { :; }
     8 
     9 # Overide functions depending on configuration
    10 if [ "${CT_PPL}" = "y" ]; then
    11 
    12 # Download PPL
    13 do_ppl_get() {
    14     CT_GetFile "ppl-${CT_PPL_VERSION}"                                      \
    15         http://www.cs.unipr.it/ppl/Download/ftp/releases/${CT_PPL_VERSION}  \
    16         ftp://ftp.cs.unipr.it/pub/ppl/releases/${CT_PPL_VERSION}            \
    17         ftp://gcc.gnu.org/pub/gcc/infrastructure
    18 }
    19 
    20 # Extract PPL
    21 do_ppl_extract() {
    22     CT_Extract "ppl-${CT_PPL_VERSION}"
    23     CT_Patch "ppl" "${CT_PPL_VERSION}"
    24 }
    25 
    26 # Build PPL for running on host
    27 do_ppl_for_host() {
    28     local -a ppl_opts
    29 
    30     CT_DoStep INFO "Installing PPL for host"
    31     CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-host-${CT_HOST}"
    32 
    33     ppl_opts+=( "host=${CT_HOST}" )
    34     ppl_opts+=( "prefix=${CT_COMPLIBS_DIR}" )
    35     ppl_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
    36     do_ppl_backend "${ppl_opts[@]}"
    37 
    38     CT_Popd
    39     CT_EndStep
    40 }
    41 
    42 # Build PPL
    43 #     Parameter     : description               : type      : default
    44 #     host          : machine to run on         : tuple     : (none)
    45 #     prefix        : prefix to install into    : dir       : (none)
    46 #     cflags        : host cflags to use        : string    : (empty)
    47 do_ppl_backend() {
    48     local host
    49     local prefix
    50     local cflags
    51     local arg
    52 
    53     for arg in "$@"; do
    54         eval "${arg// /\\ }"
    55     done
    56 
    57     CT_DoLog EXTRA "Configuring PPL"
    58 
    59     CT_DoExecLog CFG                                \
    60     CFLAGS="${cflags}"                              \
    61     CXXFLAGS="${cflags}"                            \
    62     "${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \
    63         --build=${CT_BUILD}                         \
    64         --host=${host}                              \
    65         --prefix="${prefix}"                        \
    66         --with-libgmp-prefix="${prefix}"            \
    67         --with-libgmpxx-prefix="${prefix}"          \
    68         --with-gmp-prefix="${prefix}"               \
    69         --enable-watchdog                           \
    70         --disable-debugging                         \
    71         --disable-assertions                        \
    72         --disable-ppl_lcdd                          \
    73         --disable-ppl_lpsol                         \
    74         --disable-shared                            \
    75         --enable-interfaces='c c++'                 \
    76         --enable-static
    77 
    78     # Maybe-options:
    79     # --enable-optimization=speed  or sspeed (yes, with 2 's')
    80 
    81     CT_DoLog EXTRA "Building PPL"
    82     CT_DoExecLog ALL make ${JOBSFLAGS}
    83 
    84     if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
    85         CT_DoLog EXTRA "Checking PPL"
    86         CT_DoExecLog ALL make ${JOBSFLAGS} -s check
    87     fi
    88 
    89     CT_DoLog EXTRA "Installing PPL"
    90     CT_DoExecLog ALL make install
    91 
    92     # Remove spuriously installed file
    93     CT_DoExecLog ALL rm -f "${prefix}/bin/ppl-config"
    94 }
    95 
    96 fi # CT_PPL