scripts/build/debug/duma.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Feb 17 22:08:06 2008 +0000 (2008-02-17)
changeset 431 8bde4c6ea47a
parent 237 131ee309e740
permissions -rw-r--r--
Robert P. J. DAY says:

apparently, the patchset for gcc 4.2.1 applies properly to the
source for gcc 4.2.2 and gcc 4.2.3. so, if you want, you can simply
add support for those last two just by augmenting menuconfig and
adding a couple symlinks for those two directories. seems like a
cheap way to add a couple new versions.
     1 # Biuld script for D.U.M.A.
     2 
     3 is_enabled="${CT_DUMA}"
     4 
     5 do_print_filename() {
     6     [ "${CT_DUMA}" = "y" ] || return 0
     7     echo "duma_${CT_DUMA_VERSION}"
     8 }
     9 
    10 do_debug_duma_get() {
    11     CT_GetFile "duma_${CT_DUMA_VERSION}" http://mesh.dl.sourceforge.net/sourceforge/duma/
    12     # D.U.M.A. doesn't separate its name from its version with a dash,
    13     # but with an underscore. Create a link so that crosstool-NG can
    14     # work correctly:
    15     cd "${CT_TARBALLS_DIR}"
    16     duma_ext=`CT_GetFileExtension "duma_${CT_DUMA_VERSION}"`
    17     rm -f "duma-${CT_DUMA_VERSION}${duma_ext}"
    18     ln -sf "duma_${CT_DUMA_VERSION}${duma_ext}" "duma-${CT_DUMA_VERSION}${duma_ext}"
    19 }
    20 
    21 do_debug_duma_extract() {
    22     CT_ExtractAndPatch "duma-${CT_DUMA_VERSION}"
    23     cd "${CT_SRC_DIR}"
    24     rm -f "duma-${CT_DUMA_VERSION}"
    25     ln -sf "duma_${CT_DUMA_VERSION}" "duma-${CT_DUMA_VERSION}"
    26 }
    27 
    28 do_debug_duma_build() {
    29     CT_DoStep INFO "Installing D.U.M.A."
    30     CT_DoLog EXTRA "Copying sources"
    31     cp -a "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}" "${CT_BUILD_DIR}/build-duma"
    32     CT_Pushd "${CT_BUILD_DIR}/build-duma"
    33 
    34     DUMA_CPP=
    35     [ "${CT_CC_LANG_CXX}" = "y" ] && DUMA_CPP=1
    36 
    37     libs=
    38     [ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
    39     [ "${CT_DUMA_SO}" = "y" ] && libs="${libs} libduma.so.0.0"
    40     for lib in ${libs}; do
    41         CT_DoLog EXTRA "Building library \"${lib}\""
    42         make HOSTCC="${CT_CC_NATIVE}"       \
    43              HOSTCXX="${CT_CC_NATIVE}"      \
    44              CC="${CT_TARGET}-${CT_CC}"     \
    45              CXX="${CT_TARGET}-${CT_CC}"    \
    46              DUMA_CPP="${DUMA_CPP}"         \
    47              ${libs}                        2>&1 |CT_DoLog ALL
    48         CT_DoLog EXTRA "Installing library \"${lib}\""
    49         install -m 644 "${lib}" "${CT_SYSROOT_DIR}/usr/lib" 2>&1 |CT_DoLog ALL
    50     done
    51     if [ "${CT_DUMA_SO}" = "y" ]; then
    52         CT_DoLog EXTRA "Installing shared library links"
    53         ln -vsf libduma.so.0.0 "${CT_SYSROOT_DIR}/usr/lib/libduma.so.0" 2>&1 |CT_DoLog ALL
    54         ln -vsf libduma.so.0.0 "${CT_SYSROOT_DIR}/usr/lib/libduma.so"   2>&1 |CT_DoLog ALL
    55     fi
    56     CT_DoLog EXTRA "Installing LD_PRELOAD wrapper script"
    57     mkdir -p "${CT_DEBUG_INSTALL_DIR}/usr/bin"
    58     cp -v duma.sh                               \
    59        "${CT_DEBUG_INSTALL_DIR}/usr/bin/duma"   2>&1 |CT_DoLog ALL
    60 
    61     CT_EndStep
    62     CT_Popd
    63 }
    64