crosstool-ng/scripts/build/debug/200-duma.sh
Yann E. MORIN" 82c9d1aceb 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(-)
2008-10-10 14:30:44 +00:00

72 lines
2.6 KiB
Bash

# Build script for D.U.M.A.
do_print_filename() {
echo "duma_${CT_DUMA_VERSION}"
}
do_debug_duma_get() {
CT_GetFile "duma_${CT_DUMA_VERSION}" http://mesh.dl.sourceforge.net/sourceforge/duma/
# D.U.M.A. doesn't separate its name from its version with a dash,
# but with an underscore. Create a link so that crosstool-NG can
# work correctly:
CT_Pushd "${CT_TARBALLS_DIR}"
duma_ext=$(CT_GetFileExtension "duma_${CT_DUMA_VERSION}")
rm -f "duma-${CT_DUMA_VERSION}${duma_ext}"
ln -sf "duma_${CT_DUMA_VERSION}${duma_ext}" "duma-${CT_DUMA_VERSION}${duma_ext}"
# Downloading from sourceforge leaves garbage, cleanup
rm -f showfiles.php\?group_id\=*
CT_Popd
}
do_debug_duma_extract() {
CT_ExtractAndPatch "duma-${CT_DUMA_VERSION}"
cd "${CT_SRC_DIR}"
rm -f "duma-${CT_DUMA_VERSION}"
ln -sf "duma_${CT_DUMA_VERSION}" "duma-${CT_DUMA_VERSION}"
}
do_debug_duma_build() {
CT_DoStep INFO "Installing D.U.M.A."
CT_DoLog EXTRA "Copying sources"
cp -a "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}" "${CT_BUILD_DIR}/build-duma"
CT_Pushd "${CT_BUILD_DIR}/build-duma"
DUMA_CPP=
[ "${CT_CC_LANG_CXX}" = "y" ] && DUMA_CPP=1
# The shared library needs some love: some version have libduma.so.0.0,
# while others have libduma.so.0.0.0
duma_so=$(make -n -p 2>&1 |egrep '^libduma.so[^:]*:' |head -n 1 |cut -d : -f 1)
libs=
[ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
[ "${CT_DUMA_SO}" = "y" ] && libs="${libs} ${duma_so}"
libs="${libs# }"
CT_DoLog EXTRA "Building libraries '${libs}'"
CT_DoExecLog ALL \
make HOSTCC="${CT_CC_NATIVE}" \
HOSTCXX="${CT_CC_NATIVE}" \
CC="${CT_TARGET}-gcc" \
CXX="${CT_TARGET}-gcc" \
RANLIB="${CT_TARGET}-ranlib" \
DUMA_CPP="${DUMA_CPP}" \
${libs}
CT_DoLog EXTRA "Installing libraries '${libs}'"
CT_DoExecLog ALL install -m 644 ${libs} "${CT_SYSROOT_DIR}/usr/lib"
if [ "${CT_DUMA_SO}" = "y" ]; then
CT_DoLog EXTRA "Installing shared library link"
ln -vsf ${duma_so} "${CT_SYSROOT_DIR}/usr/lib/libduma.so" 2>&1 |CT_DoLog ALL
CT_DoLog EXTRA "Installing wrapper script"
mkdir -p "${CT_DEBUG_INSTALL_DIR}/usr/bin"
# Install a simpler, smaller, safer wrapper than the one provided by D.U.M.A.
sed -r -e 's:^LIBDUMA_SO=.*:LIBDUMA_SO=/usr/lib/'"${duma_so}"':;' \
"${CT_LIB_DIR}/scripts/build/debug/duma.in" \
>"${CT_DEBUG_INSTALL_DIR}/usr/bin/duma"
chmod 755 "${CT_DEBUG_INSTALL_DIR}/usr/bin/duma"
fi
CT_Popd
CT_EndStep
}