scripts/build/debug/200-duma.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Oct 10 14:30:44 2008 +0000 (2008-10-10)
changeset 916 68af6b83ff7e
parent 711 c9bb5606a265
child 1041 2573519c00d6
permissions -rw-r--r--
Simplify the Tools and Debug facilities menu entries:
- each config file no longer have to define their own 'menuconfig foo - if FOO - endif' gym
- each build script no longer has to say wether they are enabled
- generation of the 'menuconfig' entries for the Tools and Debug facilities now uses the same code
Some re-ordering of the code to be consistent with the steps ordering (tools, then debug).

/trunk/kconfig/kconfig.mk | 66 43 23 0 +++++++++++++++++++++++-------------
/trunk/scripts/build/debug.sh | 14 9 5 0 +++++---
/trunk/scripts/build/tools/000-template.sh | 7 0 7 0 ----
/trunk/scripts/build/tools/100-libelf.sh | 3 0 3 0 --
/trunk/scripts/build/tools/200-sstrip.sh | 2 0 2 0 -
/trunk/scripts/build/debug/000-template.sh | 7 0 7 0 ----
/trunk/scripts/build/debug/100-dmalloc.sh | 3 0 3 0 --
/trunk/scripts/build/debug/400-ltrace.sh | 3 0 3 0 --
/trunk/scripts/build/debug/300-gdb.sh | 3 0 3 0 --
/trunk/scripts/build/debug/500-strace.sh | 3 0 3 0 --
/trunk/scripts/build/debug/200-duma.sh | 3 0 3 0 --
/trunk/scripts/build/tools.sh | 14 9 5 0 +++++---
/trunk/scripts/crosstool.sh | 2 1 1 0
/trunk/config/debug/ltrace.in | 14 3 11 0 ++------
/trunk/config/debug/dmalloc.in | 9 1 8 0 +----
/trunk/config/debug/gdb.in | 9 1 8 0 +----
/trunk/config/debug/strace.in | 10 1 9 0 -----
/trunk/config/debug/duma.in | 10 1 9 0 -----
/trunk/config/tools/libelf.in | 12 2 10 0 +------
/trunk/config/tools/sstrip.in | 10 1 9 0 -----
/trunk/config/config.in | 4 2 2 0 +-
21 files changed, 74 insertions(+), 134 deletions(-)
yann@571
     1
# Build script for D.U.M.A.
yann@479
     2
yann@479
     3
do_print_filename() {
yann@479
     4
    echo "duma_${CT_DUMA_VERSION}"
yann@479
     5
}
yann@479
     6
yann@479
     7
do_debug_duma_get() {
yann@479
     8
    CT_GetFile "duma_${CT_DUMA_VERSION}" http://mesh.dl.sourceforge.net/sourceforge/duma/
yann@479
     9
    # D.U.M.A. doesn't separate its name from its version with a dash,
yann@479
    10
    # but with an underscore. Create a link so that crosstool-NG can
yann@479
    11
    # work correctly:
yann@711
    12
    CT_Pushd "${CT_TARBALLS_DIR}"
yann@523
    13
    duma_ext=$(CT_GetFileExtension "duma_${CT_DUMA_VERSION}")
yann@479
    14
    rm -f "duma-${CT_DUMA_VERSION}${duma_ext}"
yann@479
    15
    ln -sf "duma_${CT_DUMA_VERSION}${duma_ext}" "duma-${CT_DUMA_VERSION}${duma_ext}"
yann@711
    16
    # Downloading from sourceforge leaves garbage, cleanup
yann@711
    17
    rm -f showfiles.php\?group_id\=*
yann@711
    18
    CT_Popd
yann@479
    19
}
yann@479
    20
yann@479
    21
do_debug_duma_extract() {
yann@479
    22
    CT_ExtractAndPatch "duma-${CT_DUMA_VERSION}"
yann@479
    23
    cd "${CT_SRC_DIR}"
yann@479
    24
    rm -f "duma-${CT_DUMA_VERSION}"
yann@479
    25
    ln -sf "duma_${CT_DUMA_VERSION}" "duma-${CT_DUMA_VERSION}"
yann@479
    26
}
yann@479
    27
yann@479
    28
do_debug_duma_build() {
yann@479
    29
    CT_DoStep INFO "Installing D.U.M.A."
yann@479
    30
    CT_DoLog EXTRA "Copying sources"
yann@479
    31
    cp -a "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}" "${CT_BUILD_DIR}/build-duma"
yann@479
    32
    CT_Pushd "${CT_BUILD_DIR}/build-duma"
yann@479
    33
yann@479
    34
    DUMA_CPP=
yann@479
    35
    [ "${CT_CC_LANG_CXX}" = "y" ] && DUMA_CPP=1
yann@479
    36
yann@571
    37
    # The shared library needs some love: some version have libduma.so.0.0,
yann@571
    38
    # while others have libduma.so.0.0.0
yann@571
    39
    duma_so=$(make -n -p 2>&1 |egrep '^libduma.so[^:]*:' |head -n 1 |cut -d : -f 1)
yann@571
    40
yann@479
    41
    libs=
yann@479
    42
    [ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
yann@571
    43
    [ "${CT_DUMA_SO}" = "y" ] && libs="${libs} ${duma_so}"
yann@571
    44
    libs="${libs# }"
yann@571
    45
    CT_DoLog EXTRA "Building libraries '${libs}'"
yann@669
    46
    CT_DoExecLog ALL                    \
yann@571
    47
    make HOSTCC="${CT_CC_NATIVE}"       \
yann@571
    48
         HOSTCXX="${CT_CC_NATIVE}"      \
yann@571
    49
         CC="${CT_TARGET}-gcc"          \
yann@581
    50
         CXX="${CT_TARGET}-gcc"         \
yann@571
    51
         RANLIB="${CT_TARGET}-ranlib"   \
yann@571
    52
         DUMA_CPP="${DUMA_CPP}"         \
yann@669
    53
         ${libs}
yann@571
    54
    CT_DoLog EXTRA "Installing libraries '${libs}'"
yann@669
    55
    CT_DoExecLog ALL install -m 644 ${libs} "${CT_SYSROOT_DIR}/usr/lib"
yann@479
    56
    if [ "${CT_DUMA_SO}" = "y" ]; then
yann@571
    57
        CT_DoLog EXTRA "Installing shared library link"
yann@571
    58
        ln -vsf ${duma_so} "${CT_SYSROOT_DIR}/usr/lib/libduma.so"   2>&1 |CT_DoLog ALL
yann@571
    59
        CT_DoLog EXTRA "Installing wrapper script"
yann@571
    60
        mkdir -p "${CT_DEBUG_INSTALL_DIR}/usr/bin"
yann@571
    61
        # Install a simpler, smaller, safer wrapper than the one provided by D.U.M.A.
yann@635
    62
        sed -r -e 's:^LIBDUMA_SO=.*:LIBDUMA_SO=/usr/lib/'"${duma_so}"':;'   \
yann@635
    63
            "${CT_LIB_DIR}/scripts/build/debug/duma.in"                     \
yann@635
    64
            >"${CT_DEBUG_INSTALL_DIR}/usr/bin/duma"
yann@571
    65
        chmod 755 "${CT_DEBUG_INSTALL_DIR}/usr/bin/duma"
yann@479
    66
    fi
yann@479
    67
yann@571
    68
    CT_Popd
yann@479
    69
    CT_EndStep
yann@479
    70
}
yann@479
    71