scripts/build/debug/400-ltrace.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Feb 17 23:50:49 2010 +0100 (2010-02-17)
changeset 1810 e44f67656c5f
parent 1687 be5c9afe1593
child 1820 55adc838cd68
permissions -rw-r--r--
complibs: hide companion libraries for target entry

The companion libraries on the target are required only for internal use by
binutils and gdb. The user should not have to know about this, so hide the
option.
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@1126
    16
    CT_Patch "ltrace-${CT_LTRACE_VERSION}"
yann@1147
    17
    # ltrace uses ppc instead of powerpc for the arch name
yann@1147
    18
    # create a symlink to get it to build for powerpc
yann@1147
    19
    CT_Pushd "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}/sysdeps/linux-gnu"
yann@1147
    20
    CT_DoExecLog ALL ln -sf ppc powerpc
yann@1147
    21
    CT_Popd
yann@479
    22
}
yann@479
    23
yann@479
    24
do_debug_ltrace_build() {
yann@479
    25
    CT_DoStep INFO "Installing ltrace"
yann@479
    26
yann@973
    27
    CT_DoLog EXTRA "Copying sources to build dir"
yann@1678
    28
    CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}" \
yann@1678
    29
                            "${CT_BUILD_DIR}/build-ltrace"
yann@1678
    30
    CT_Pushd "${CT_BUILD_DIR}/build-ltrace"
yann@973
    31
yann@479
    32
    CT_DoLog EXTRA "Configuring ltrace"
jocke@1685
    33
    # ltrace-0.5.3, and later, don't use GNU Autotools configure script anymore
jocke@1685
    34
    if [ "${CT_LTRACE_0_5_3_or_later}" = "y" ]; then
jocke@1685
    35
        CC=${CT_TARGET}-${CT_CC} \
jocke@1685
    36
        HOST=${CT_ARCH} \
jocke@1685
    37
        CFLAGS="${CT_TARGET_CFLAGS}" \
jocke@1685
    38
        CT_DoExecLog ALL ./configure --prefix=/usr
jocke@1685
    39
    else
jocke@1685
    40
        CT_DoExecLog ALL        \
jocke@1685
    41
        ./configure             \
jocke@1685
    42
            --build=${CT_BUILD} \
jocke@1685
    43
            --host=${CT_TARGET} \
jocke@1685
    44
            --prefix=/usr
jocke@1685
    45
    fi
yann@479
    46
yann@479
    47
    CT_DoLog EXTRA "Building ltrace"
yann@669
    48
    CT_DoExecLog ALL make
yann@479
    49
yann@479
    50
    CT_DoLog EXTRA "Installing ltrace"
yann@1219
    51
    CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" install
yann@479
    52
yann@479
    53
    CT_Popd
yann@479
    54
    CT_EndStep
yann@479
    55
}
yann@479
    56