scripts/build/debug/200-duma.sh
changeset 479 05c62432ec19
child 523 010f6f4e4dd6
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/scripts/build/debug/200-duma.sh	Fri May 02 21:59:14 2008 +0000
     1.3 @@ -0,0 +1,64 @@
     1.4 +# Biuld script for D.U.M.A.
     1.5 +
     1.6 +is_enabled="${CT_DUMA}"
     1.7 +
     1.8 +do_print_filename() {
     1.9 +    [ "${CT_DUMA}" = "y" ] || return 0
    1.10 +    echo "duma_${CT_DUMA_VERSION}"
    1.11 +}
    1.12 +
    1.13 +do_debug_duma_get() {
    1.14 +    CT_GetFile "duma_${CT_DUMA_VERSION}" http://mesh.dl.sourceforge.net/sourceforge/duma/
    1.15 +    # D.U.M.A. doesn't separate its name from its version with a dash,
    1.16 +    # but with an underscore. Create a link so that crosstool-NG can
    1.17 +    # work correctly:
    1.18 +    cd "${CT_TARBALLS_DIR}"
    1.19 +    duma_ext=`CT_GetFileExtension "duma_${CT_DUMA_VERSION}"`
    1.20 +    rm -f "duma-${CT_DUMA_VERSION}${duma_ext}"
    1.21 +    ln -sf "duma_${CT_DUMA_VERSION}${duma_ext}" "duma-${CT_DUMA_VERSION}${duma_ext}"
    1.22 +}
    1.23 +
    1.24 +do_debug_duma_extract() {
    1.25 +    CT_ExtractAndPatch "duma-${CT_DUMA_VERSION}"
    1.26 +    cd "${CT_SRC_DIR}"
    1.27 +    rm -f "duma-${CT_DUMA_VERSION}"
    1.28 +    ln -sf "duma_${CT_DUMA_VERSION}" "duma-${CT_DUMA_VERSION}"
    1.29 +}
    1.30 +
    1.31 +do_debug_duma_build() {
    1.32 +    CT_DoStep INFO "Installing D.U.M.A."
    1.33 +    CT_DoLog EXTRA "Copying sources"
    1.34 +    cp -a "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}" "${CT_BUILD_DIR}/build-duma"
    1.35 +    CT_Pushd "${CT_BUILD_DIR}/build-duma"
    1.36 +
    1.37 +    DUMA_CPP=
    1.38 +    [ "${CT_CC_LANG_CXX}" = "y" ] && DUMA_CPP=1
    1.39 +
    1.40 +    libs=
    1.41 +    [ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
    1.42 +    [ "${CT_DUMA_SO}" = "y" ] && libs="${libs} libduma.so.0.0"
    1.43 +    for lib in ${libs}; do
    1.44 +        CT_DoLog EXTRA "Building library \"${lib}\""
    1.45 +        make HOSTCC="${CT_CC_NATIVE}"       \
    1.46 +             HOSTCXX="${CT_CC_NATIVE}"      \
    1.47 +             CC="${CT_TARGET}-${CT_CC}"     \
    1.48 +             CXX="${CT_TARGET}-${CT_CC}"    \
    1.49 +             DUMA_CPP="${DUMA_CPP}"         \
    1.50 +             ${libs}                        2>&1 |CT_DoLog ALL
    1.51 +        CT_DoLog EXTRA "Installing library \"${lib}\""
    1.52 +        install -m 644 "${lib}" "${CT_SYSROOT_DIR}/usr/lib" 2>&1 |CT_DoLog ALL
    1.53 +    done
    1.54 +    if [ "${CT_DUMA_SO}" = "y" ]; then
    1.55 +        CT_DoLog EXTRA "Installing shared library links"
    1.56 +        ln -vsf libduma.so.0.0 "${CT_SYSROOT_DIR}/usr/lib/libduma.so.0" 2>&1 |CT_DoLog ALL
    1.57 +        ln -vsf libduma.so.0.0 "${CT_SYSROOT_DIR}/usr/lib/libduma.so"   2>&1 |CT_DoLog ALL
    1.58 +    fi
    1.59 +    CT_DoLog EXTRA "Installing LD_PRELOAD wrapper script"
    1.60 +    mkdir -p "${CT_DEBUG_INSTALL_DIR}/usr/bin"
    1.61 +    cp -v duma.sh                               \
    1.62 +       "${CT_DEBUG_INSTALL_DIR}/usr/bin/duma"   2>&1 |CT_DoLog ALL
    1.63 +
    1.64 +    CT_EndStep
    1.65 +    CT_Popd
    1.66 +}
    1.67 +