scripts/build/debug/400-ltrace.sh
author Remy Bohmer <linux@bohmer.net>
Thu May 27 23:18:19 2010 +0200 (2010-05-27)
changeset 2060 51e4597b07fc
parent 1821 57c71b197ee6
child 2154 250cdcc86441
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>
yann@479
     1
# Build script for ltrace
yann@479
     2
yann@479
     3
do_debug_ltrace_get() {
yann@1687
     4
    CT_GetFile "ltrace_${CT_LTRACE_VERSION}.orig" .tar.gz               \
yann@1687
     5
               {ftp,http}://ftp.de.debian.org/debian/pool/main/l/ltrace/
yann@479
     6
    # Create a link so that the following steps are easier to do:
yann@1688
     7
    CT_Pushd "${CT_TARBALLS_DIR}"
yann@523
     8
    ltrace_ext=$(CT_GetFileExtension "ltrace_${CT_LTRACE_VERSION}.orig")
yann@1687
     9
    ln -sf "ltrace_${CT_LTRACE_VERSION}.orig${ltrace_ext}"              \
yann@1687
    10
           "ltrace-${CT_LTRACE_VERSION}${ltrace_ext}"
yann@1688
    11
    CT_Popd
yann@479
    12
}
yann@479
    13
yann@479
    14
do_debug_ltrace_extract() {
yann@1126
    15
    CT_Extract "ltrace-${CT_LTRACE_VERSION}"
yann@1901
    16
    CT_Patch "ltrace" "${CT_LTRACE_VERSION}"
yann@479
    17
}
yann@479
    18
yann@479
    19
do_debug_ltrace_build() {
yann@1820
    20
    local ltrace_host
yann@1820
    21
yann@479
    22
    CT_DoStep INFO "Installing ltrace"
yann@479
    23
yann@973
    24
    CT_DoLog EXTRA "Copying sources to build dir"
yann@1678
    25
    CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}" \
yann@1678
    26
                            "${CT_BUILD_DIR}/build-ltrace"
yann@1678
    27
    CT_Pushd "${CT_BUILD_DIR}/build-ltrace"
yann@973
    28
yann@479
    29
    CT_DoLog EXTRA "Configuring ltrace"
jocke@1685
    30
    # ltrace-0.5.3, and later, don't use GNU Autotools configure script anymore
jocke@1685
    31
    if [ "${CT_LTRACE_0_5_3_or_later}" = "y" ]; then
yann@1820
    32
        case "${CT_ARCH}:${CT_ARCH_BITNESS}" in
yann@1821
    33
            x86:32)     ltrace_host="i386";;
yann@1821
    34
            x86:64)     ltrace_host="x86_64";;
yann@1821
    35
            powerpc:*)  ltrace_host="ppc";;
yann@1821
    36
            *)          ltrace_host="${CT_ARCH}";;
yann@1820
    37
        esac
yann@1820
    38
        CC="${CT_TARGET}-${CT_CC}"      \
yann@1820
    39
        HOST="${ltrace_host}"           \
yann@1820
    40
        CFLAGS="${CT_TARGET_CFLAGS}"    \
jocke@1685
    41
        CT_DoExecLog ALL ./configure --prefix=/usr
jocke@1685
    42
    else
jocke@1685
    43
        CT_DoExecLog ALL        \
jocke@1685
    44
        ./configure             \
jocke@1685
    45
            --build=${CT_BUILD} \
jocke@1685
    46
            --host=${CT_TARGET} \
jocke@1685
    47
            --prefix=/usr
jocke@1685
    48
    fi
yann@479
    49
yann@479
    50
    CT_DoLog EXTRA "Building ltrace"
yann@669
    51
    CT_DoExecLog ALL make
yann@479
    52
yann@479
    53
    CT_DoLog EXTRA "Installing ltrace"
yann@1219
    54
    CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" install
yann@479
    55
yann@479
    56
    CT_Popd
yann@479
    57
    CT_EndStep
yann@479
    58
}
yann@479
    59