scripts/build/debug/200-duma.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jan 05 21:09:37 2009 +0000 (2009-01-05)
changeset 1125 44037ce2db6d
parent 1123 8c5881324a79
child 1126 1ab3d2e08c8b
permissions -rw-r--r--
Fix building DUMA:
- DUMA separates its name from its version with an underscore, not with a dash.

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