scripts/build/companion_libs/ppl.sh
author Anthony Foiani <anthony.foiani@gmail.com>
Thu May 19 23:06:16 2011 +0200 (2011-05-19)
changeset 2461 ec30b191f0e3
parent 2460 132c00ad3d6e
child 2927 ddaae597fd7c
permissions -rw-r--r--
complibs/ppl: build only C and C++ interfaces for PPL

By default, PPL wants to build interfaces for any of a variety of
langauges it finds on the local host (python, java, possibly perl, also
more esoteric languages such as ocaml and prolog).

These extra interfaces can double the compile time for the library. For
single-process builds, I found a savings of more than 40%:

default / j1: 716s total, 143.2s avg, 0.52s stdev
just_c / j1: 406s total, 81.2s avg, 0.33s stdev
just_c_cpp / j1: 413s total, 82.6s avg, 0.22s stdev

And for multi-process builds, it approached 50%:

default / j4: 625s total, 125.0s avg, 0.57s stdev
just_c / j4: 338s total, 67.6s avg, 1.25s stdev
just_c_cpp / j4: 327s total, 65.4s avg, 0.36s stdev

Since the PPL we build within ct-ng is only used by GCC, we only need to
build the C and C++ interfaces.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
yann@1324
     1
# This file adds the functions to build the PPL library
yann@1324
     2
# Copyright 2009 Yann E. MORIN
yann@1324
     3
# Licensed under the GPL v2. See COPYING in the root of this package
yann@1324
     4
yann@1324
     5
do_ppl_get() { :; }
yann@1324
     6
do_ppl_extract() { :; }
yann@1324
     7
do_ppl() { :; }
yann@1324
     8
yann@1324
     9
# Overide functions depending on configuration
yann@1808
    10
if [ "${CT_PPL}" = "y" ]; then
yann@1324
    11
yann@1324
    12
# Download PPL
yann@1324
    13
do_ppl_get() {
yann@1324
    14
    CT_GetFile "ppl-${CT_PPL_VERSION}"                                      \
yann@1324
    15
        http://www.cs.unipr.it/ppl/Download/ftp/releases/${CT_PPL_VERSION}  \
yann@1369
    16
        ftp://ftp.cs.unipr.it/pub/ppl/releases/${CT_PPL_VERSION}            \
yann@1369
    17
        ftp://gcc.gnu.org/pub/gcc/infrastructure
yann@1324
    18
}
yann@1324
    19
yann@1324
    20
# Extract PPL
yann@1324
    21
do_ppl_extract() {
yann@1324
    22
    CT_Extract "ppl-${CT_PPL_VERSION}"
yann@1901
    23
    CT_Patch "ppl" "${CT_PPL_VERSION}"
yann@1324
    24
}
yann@1324
    25
yann@1324
    26
do_ppl() {
yann@1324
    27
    mkdir -p "${CT_BUILD_DIR}/build-ppl"
yann@1324
    28
    cd "${CT_BUILD_DIR}/build-ppl"
yann@1324
    29
yann@1324
    30
    CT_DoStep INFO "Installing PPL"
yann@1324
    31
yann@1324
    32
    CT_DoLog EXTRA "Configuring PPL"
yann@1892
    33
yann@1892
    34
yann@2348
    35
    CT_DoExecLog CFG                                \
yann@1379
    36
    CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
yann@1379
    37
    CXXFLAGS="${CT_CFLAGS_FOR_HOST}"                \
yann@1324
    38
    "${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \
yann@1324
    39
        --build=${CT_BUILD}                         \
yann@1324
    40
        --host=${CT_HOST}                           \
yann@1893
    41
        --prefix="${CT_COMPLIBS_DIR}"               \
yann@1893
    42
        --with-libgmp-prefix="${CT_COMPLIBS_DIR}"   \
yann@1893
    43
        --with-libgmpxx-prefix="${CT_COMPLIBS_DIR}" \
anthony@2459
    44
        --with-gmp-prefix="${CT_COMPLIBS_DIR}"      \
yann@2364
    45
        --enable-watchdog                           \
yann@1324
    46
        --disable-debugging                         \
yann@1324
    47
        --disable-assertions                        \
yann@1324
    48
        --disable-ppl_lcdd                          \
yann@1892
    49
        --disable-ppl_lpsol                         \
yann@2381
    50
        --disable-shared                            \
anthony@2461
    51
        --enable-interfaces='c c++'                 \
yann@2381
    52
        --enable-static
yann@1324
    53
yann@1324
    54
    # Maybe-options:
yann@1324
    55
    # --enable-optimization=speed  or sspeed (yes, with 2 's')
yann@1324
    56
yann@1324
    57
    CT_DoLog EXTRA "Building PPL"
yann@2275
    58
    CT_DoExecLog ALL make ${JOBSFLAGS}
yann@1324
    59
yann@1890
    60
    if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
yann@1324
    61
        CT_DoLog EXTRA "Checking PPL"
yann@2275
    62
        CT_DoExecLog ALL make ${JOBSFLAGS} -s check
yann@1324
    63
    fi
yann@1324
    64
yann@1324
    65
    CT_DoLog EXTRA "Installing PPL"
yann@1324
    66
    CT_DoExecLog ALL make install
yann@1324
    67
yann@1397
    68
    # Remove spuriously installed file
yann@1397
    69
    CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/bin/ppl-config"
yann@1397
    70
yann@1324
    71
    CT_EndStep
yann@1324
    72
}
yann@1324
    73
yann@1808
    74
fi # CT_PPL