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.
     1 # Build script for ltrace
     2 
     3 do_debug_ltrace_get() {
     4     CT_GetFile "ltrace_${CT_LTRACE_VERSION}.orig" {ftp,http}://ftp.de.debian.org/debian/pool/main/l/ltrace/
     5     # Create a link so that the following steps are easier to do:
     6     cd "${CT_TARBALLS_DIR}"
     7     ltrace_ext=$(CT_GetFileExtension "ltrace_${CT_LTRACE_VERSION}.orig")
     8     ln -sf "ltrace_${CT_LTRACE_VERSION}.orig${ltrace_ext}" "ltrace-${CT_LTRACE_VERSION}${ltrace_ext}"
     9 }
    10 
    11 do_debug_ltrace_extract() {
    12     CT_Extract "ltrace-${CT_LTRACE_VERSION}"
    13     CT_Patch "ltrace-${CT_LTRACE_VERSION}"
    14     # ltrace uses ppc instead of powerpc for the arch name
    15     # create a symlink to get it to build for powerpc
    16     CT_Pushd "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}/sysdeps/linux-gnu"
    17     CT_DoExecLog ALL ln -sf ppc powerpc
    18     CT_Popd
    19 }
    20 
    21 do_debug_ltrace_build() {
    22     CT_DoStep INFO "Installing ltrace"
    23 
    24     CT_DoLog EXTRA "Copying sources to build dir"
    25     CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}" \
    26                             "${CT_BUILD_DIR}/build-ltrace"
    27     CT_Pushd "${CT_BUILD_DIR}/build-ltrace"
    28 
    29     CT_DoLog EXTRA "Configuring ltrace"
    30     # ltrace-0.5.3, and later, don't use GNU Autotools configure script anymore
    31     if [ "${CT_LTRACE_0_5_3_or_later}" = "y" ]; then
    32         CC=${CT_TARGET}-${CT_CC} \
    33         HOST=${CT_ARCH} \
    34         CFLAGS="${CT_TARGET_CFLAGS}" \
    35         CT_DoExecLog ALL ./configure --prefix=/usr
    36     else
    37         CT_DoExecLog ALL        \
    38         ./configure             \
    39             --build=${CT_BUILD} \
    40             --host=${CT_TARGET} \
    41             --prefix=/usr
    42     fi
    43 
    44     CT_DoLog EXTRA "Building ltrace"
    45     CT_DoExecLog ALL make
    46 
    47     CT_DoLog EXTRA "Installing ltrace"
    48     CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" install
    49 
    50     CT_Popd
    51     CT_EndStep
    52 }
    53