scripts/build/companion_libs/ppl.sh
author Johannes Stezenbach <js@sig21.net>
Thu Jul 29 19:47:16 2010 +0200 (2010-07-29)
changeset 2045 fdaa6c7f6dea
parent 1893 f5dab3c43abf
child 2099 1bb063c8a0ca
permissions -rw-r--r--
cc/gcc: add option to compile against static libstdc++, for gcc-4.4 and newer

Idea and know-how taken from CodeSourcery build script.

Normal build:
$ ldd arm-unknown-linux-uclibcgnueabi-gcc
linux-gate.so.1 => (0xb77f3000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb76e8000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb75a1000)
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb757a000)
/lib/ld-linux.so.2 (0xb77f4000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb755c000)

CC_STATIC_LIBSTDCXX=y:
$ ldd arm-unknown-linux-uclibcgnueabi-gcc
linux-gate.so.1 => (0xb7843000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb76e6000)
/lib/ld-linux.so.2 (0xb7844000)

I made CC_STATIC_LIBSTDCXX default=y since I think
it is always desirable.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
     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() { :; }
     8 do_ppl_target() { :; }
     9 
    10 # Overide functions depending on configuration
    11 if [ "${CT_PPL}" = "y" ]; then
    12 
    13 # Download PPL
    14 do_ppl_get() {
    15     CT_GetFile "ppl-${CT_PPL_VERSION}"                                      \
    16         http://www.cs.unipr.it/ppl/Download/ftp/releases/${CT_PPL_VERSION}  \
    17         ftp://ftp.cs.unipr.it/pub/ppl/releases/${CT_PPL_VERSION}            \
    18         ftp://gcc.gnu.org/pub/gcc/infrastructure
    19 }
    20 
    21 # Extract PPL
    22 do_ppl_extract() {
    23     CT_Extract "ppl-${CT_PPL_VERSION}"
    24     CT_Patch "ppl" "${CT_PPL_VERSION}"
    25 }
    26 
    27 do_ppl() {
    28     local -a ppl_opts
    29 
    30     mkdir -p "${CT_BUILD_DIR}/build-ppl"
    31     cd "${CT_BUILD_DIR}/build-ppl"
    32 
    33     CT_DoStep INFO "Installing PPL"
    34 
    35     CT_DoLog EXTRA "Configuring PPL"
    36 
    37     if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then
    38         ppl_opts+=( --enable-shared --disable-static )
    39     else
    40         ppl_opts+=( --disable-shared --enable-static )
    41     fi
    42 
    43     CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    44     CXXFLAGS="${CT_CFLAGS_FOR_HOST}"                \
    45     CT_DoExecLog ALL                                \
    46     "${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \
    47         --build=${CT_BUILD}                         \
    48         --host=${CT_HOST}                           \
    49         --prefix="${CT_COMPLIBS_DIR}"               \
    50         --with-libgmp-prefix="${CT_COMPLIBS_DIR}"   \
    51         --with-libgmpxx-prefix="${CT_COMPLIBS_DIR}" \
    52         --disable-debugging                         \
    53         --disable-assertions                        \
    54         --disable-ppl_lcdd                          \
    55         --disable-ppl_lpsol                         \
    56         "${ppl_opts[@]}"
    57 
    58     # Maybe-options:
    59     # --enable-interfaces=...
    60     # --enable-optimization=speed  or sspeed (yes, with 2 's')
    61 
    62     CT_DoLog EXTRA "Building PPL"
    63     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    64 
    65     if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
    66         CT_DoLog EXTRA "Checking PPL"
    67         CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
    68     fi
    69 
    70     CT_DoLog EXTRA "Installing PPL"
    71     CT_DoExecLog ALL make install
    72 
    73     # Remove spuriously installed file
    74     CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/bin/ppl-config"
    75 
    76     CT_EndStep
    77 }
    78 
    79 fi # CT_PPL