scripts/build/debug/400-ltrace.sh
author Joachim Nilsson <jocke@vmlinux.org>
Sun Jan 03 16:46:58 2010 +0100 (2010-01-03)
changeset 1685 ecccce88fc71
parent 1678 ac247da318a1
child 1686 7608142e4fc1
permissions -rw-r--r--
debug/ltrace: Add support for ltrace-0.5.3

From this version of ltrace the maintainer has removed support for
GNU Autotools, so the patch sets needed to be reworked.

Included is the latest Debian patch, by the Debian ltrace maintainer
Juan Cespedes <cespedes@debian.org>, the OpenEmbedded patches for cross
compiling, by Khem Raj <raj.khem@gmail.com> and a further set of patches
by Joachim Nilsson <jocke@vmlinux.org> for crosstool-NG.
yann@479
     1
# Build script for ltrace
yann@479
     2
yann@479
     3
do_debug_ltrace_get() {
yann@486
     4
    CT_GetFile "ltrace_${CT_LTRACE_VERSION}.orig" {ftp,http}://ftp.de.debian.org/debian/pool/main/l/ltrace/
yann@479
     5
    # Create a link so that the following steps are easier to do:
yann@479
     6
    cd "${CT_TARBALLS_DIR}"
yann@523
     7
    ltrace_ext=$(CT_GetFileExtension "ltrace_${CT_LTRACE_VERSION}.orig")
yann@479
     8
    ln -sf "ltrace_${CT_LTRACE_VERSION}.orig${ltrace_ext}" "ltrace-${CT_LTRACE_VERSION}${ltrace_ext}"
yann@479
     9
}
yann@479
    10
yann@479
    11
do_debug_ltrace_extract() {
yann@1126
    12
    CT_Extract "ltrace-${CT_LTRACE_VERSION}"
yann@1126
    13
    CT_Patch "ltrace-${CT_LTRACE_VERSION}"
yann@1147
    14
    # ltrace uses ppc instead of powerpc for the arch name
yann@1147
    15
    # create a symlink to get it to build for powerpc
yann@1147
    16
    CT_Pushd "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}/sysdeps/linux-gnu"
yann@1147
    17
    CT_DoExecLog ALL ln -sf ppc powerpc
yann@1147
    18
    CT_Popd
yann@479
    19
}
yann@479
    20
yann@479
    21
do_debug_ltrace_build() {
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
jocke@1685
    32
        CC=${CT_TARGET}-${CT_CC} \
jocke@1685
    33
        HOST=${CT_ARCH} \
jocke@1685
    34
        CFLAGS="${CT_TARGET_CFLAGS}" \
jocke@1685
    35
        CT_DoExecLog ALL ./configure --prefix=/usr
jocke@1685
    36
    else
jocke@1685
    37
        CT_DoExecLog ALL        \
jocke@1685
    38
        ./configure             \
jocke@1685
    39
            --build=${CT_BUILD} \
jocke@1685
    40
            --host=${CT_TARGET} \
jocke@1685
    41
            --prefix=/usr
jocke@1685
    42
    fi
yann@479
    43
yann@479
    44
    CT_DoLog EXTRA "Building ltrace"
yann@669
    45
    CT_DoExecLog ALL make
yann@479
    46
yann@479
    47
    CT_DoLog EXTRA "Installing ltrace"
yann@1219
    48
    CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" install
yann@479
    49
yann@479
    50
    CT_Popd
yann@479
    51
    CT_EndStep
yann@479
    52
}
yann@479
    53