scripts/build/debug/200-duma.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Mar 03 17:41:59 2009 +0000 (2009-03-03)
changeset 1219 2b875ed306c2
parent 1126 1ab3d2e08c8b
child 1238 73c8b86a05b1
permissions -rw-r--r--
Allow user to add a directory component in the sys-root path.
Rename CT_DEBUG_INSTALL_DIR to CT_DEBUGROOT_DIR (to match CT_SYSROOT_DIR).
As a side effect, fix creating lib64->lib symlinks.

/trunk/scripts/build/debug/100-dmalloc.sh | 2 1 1 0 +-
/trunk/scripts/build/debug/400-ltrace.sh | 2 1 1 0 +-
/trunk/scripts/build/debug/300-gdb.sh | 6 3 3 0 +++---
/trunk/scripts/build/debug/500-strace.sh | 2 1 1 0 +-
/trunk/scripts/build/debug/200-duma.sh | 6 3 3 0 +++---
/trunk/scripts/crosstool-NG.sh.in | 16 7 9 0 +++++++---------
/trunk/scripts/functions | 2 1 1 0 +-
/trunk/config/toolchain.in | 17 17 0 0 +++++++++++++++++
8 files changed, 34 insertions(+), 19 deletions(-)
yann@571
     1
# Build script for D.U.M.A.
yann@479
     2
yann@479
     3
do_debug_duma_get() {
yann@479
     4
    CT_GetFile "duma_${CT_DUMA_VERSION}" http://mesh.dl.sourceforge.net/sourceforge/duma/
yann@711
     5
    # Downloading from sourceforge leaves garbage, cleanup
yann@1126
     6
    CT_DoExecLog ALL rm -f "${CT_TARBALLS_DIR}/showfiles.php"*
yann@479
     7
}
yann@479
     8
yann@479
     9
do_debug_duma_extract() {
yann@1126
    10
    CT_Extract "duma_${CT_DUMA_VERSION}"
yann@1126
    11
    CT_Pushd "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}"
yann@1126
    12
    # Even if DUMA uses _ and not -, crosstool-NG uses the dash to split the
yann@1126
    13
    # name from the version in order to find the appropriate patches
yann@1126
    14
    # YEM: FIXME: make CT_Patch more intelligent, Eg.: CT_Patch duma _ "${CT_DUMA_VERSION}"
yann@1126
    15
    CT_Patch "duma-${CT_DUMA_VERSION}" nochdir
yann@1126
    16
    CT_Popd
yann@479
    17
}
yann@479
    18
yann@479
    19
do_debug_duma_build() {
yann@479
    20
    CT_DoStep INFO "Installing D.U.M.A."
yann@479
    21
    CT_DoLog EXTRA "Copying sources"
yann@1125
    22
    cp -a "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}" "${CT_BUILD_DIR}/build-duma"
yann@479
    23
    CT_Pushd "${CT_BUILD_DIR}/build-duma"
yann@479
    24
yann@479
    25
    DUMA_CPP=
yann@479
    26
    [ "${CT_CC_LANG_CXX}" = "y" ] && DUMA_CPP=1
yann@479
    27
yann@571
    28
    # The shared library needs some love: some version have libduma.so.0.0,
yann@571
    29
    # while others have libduma.so.0.0.0
yann@571
    30
    duma_so=$(make -n -p 2>&1 |egrep '^libduma.so[^:]*:' |head -n 1 |cut -d : -f 1)
yann@571
    31
yann@479
    32
    libs=
yann@479
    33
    [ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
yann@571
    34
    [ "${CT_DUMA_SO}" = "y" ] && libs="${libs} ${duma_so}"
yann@571
    35
    libs="${libs# }"
yann@571
    36
    CT_DoLog EXTRA "Building libraries '${libs}'"
yann@669
    37
    CT_DoExecLog ALL                    \
yann@1041
    38
    make HOSTCC="${CT_BUILD}-gcc"       \
yann@571
    39
         CC="${CT_TARGET}-gcc"          \
yann@581
    40
         CXX="${CT_TARGET}-gcc"         \
yann@571
    41
         RANLIB="${CT_TARGET}-ranlib"   \
yann@571
    42
         DUMA_CPP="${DUMA_CPP}"         \
yann@669
    43
         ${libs}
yann@571
    44
    CT_DoLog EXTRA "Installing libraries '${libs}'"
yann@669
    45
    CT_DoExecLog ALL install -m 644 ${libs} "${CT_SYSROOT_DIR}/usr/lib"
yann@479
    46
    if [ "${CT_DUMA_SO}" = "y" ]; then
yann@571
    47
        CT_DoLog EXTRA "Installing shared library link"
yann@571
    48
        ln -vsf ${duma_so} "${CT_SYSROOT_DIR}/usr/lib/libduma.so"   2>&1 |CT_DoLog ALL
yann@571
    49
        CT_DoLog EXTRA "Installing wrapper script"
yann@1219
    50
        mkdir -p "${CT_DEBUGROOT_DIR}/usr/bin"
yann@571
    51
        # Install a simpler, smaller, safer wrapper than the one provided by D.U.M.A.
yann@635
    52
        sed -r -e 's:^LIBDUMA_SO=.*:LIBDUMA_SO=/usr/lib/'"${duma_so}"':;'   \
yann@635
    53
            "${CT_LIB_DIR}/scripts/build/debug/duma.in"                     \
yann@1219
    54
            >"${CT_DEBUGROOT_DIR}/usr/bin/duma"
yann@1219
    55
        chmod 755 "${CT_DEBUGROOT_DIR}/usr/bin/duma"
yann@479
    56
    fi
yann@479
    57
yann@571
    58
    CT_Popd
yann@479
    59
    CT_EndStep
yann@479
    60
}
yann@479
    61