2008-06-17 22:26:44 +00:00
|
|
|
# Build script for D.U.M.A.
|
2007-07-12 08:47:15 +00:00
|
|
|
|
|
|
|
do_debug_duma_get() {
|
|
|
|
CT_GetFile "duma_${CT_DUMA_VERSION}" http://mesh.dl.sourceforge.net/sourceforge/duma/
|
2008-07-22 14:17:10 +00:00
|
|
|
# Downloading from sourceforge leaves garbage, cleanup
|
2009-01-05 23:02:43 +00:00
|
|
|
CT_DoExecLog ALL rm -f "${CT_TARBALLS_DIR}/showfiles.php"*
|
2007-07-12 08:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_debug_duma_extract() {
|
2009-01-05 23:02:43 +00:00
|
|
|
CT_Extract "duma_${CT_DUMA_VERSION}"
|
|
|
|
CT_Pushd "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}"
|
|
|
|
# Even if DUMA uses _ and not -, crosstool-NG uses the dash to split the
|
|
|
|
# name from the version in order to find the appropriate patches
|
|
|
|
# YEM: FIXME: make CT_Patch more intelligent, Eg.: CT_Patch duma _ "${CT_DUMA_VERSION}"
|
2009-03-06 13:27:40 +00:00
|
|
|
CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.duma-${CT_DUMA_VERSION}.extracted"
|
2009-01-05 23:02:43 +00:00
|
|
|
CT_Patch "duma-${CT_DUMA_VERSION}" nochdir
|
|
|
|
CT_Popd
|
2007-07-12 08:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_debug_duma_build() {
|
|
|
|
CT_DoStep INFO "Installing D.U.M.A."
|
|
|
|
CT_DoLog EXTRA "Copying sources"
|
2009-01-05 21:09:37 +00:00
|
|
|
cp -a "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}" "${CT_BUILD_DIR}/build-duma"
|
2007-07-12 08:47:15 +00:00
|
|
|
CT_Pushd "${CT_BUILD_DIR}/build-duma"
|
|
|
|
|
|
|
|
DUMA_CPP=
|
|
|
|
[ "${CT_CC_LANG_CXX}" = "y" ] && DUMA_CPP=1
|
|
|
|
|
2008-06-17 22:26:44 +00:00
|
|
|
# The shared library needs some love: some version have libduma.so.0.0,
|
|
|
|
# while others have libduma.so.0.0.0
|
2009-03-08 17:09:39 +00:00
|
|
|
duma_so=$(make -n -p 2>&1 |grep -E '^libduma.so[^:]*:' |head -n 1 |cut -d : -f 1)
|
2008-06-17 22:26:44 +00:00
|
|
|
|
2007-07-12 08:47:15 +00:00
|
|
|
libs=
|
|
|
|
[ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
|
2008-06-17 22:26:44 +00:00
|
|
|
[ "${CT_DUMA_SO}" = "y" ] && libs="${libs} ${duma_so}"
|
|
|
|
libs="${libs# }"
|
|
|
|
CT_DoLog EXTRA "Building libraries '${libs}'"
|
2008-07-14 21:57:57 +00:00
|
|
|
CT_DoExecLog ALL \
|
2008-11-13 18:22:23 +00:00
|
|
|
make HOSTCC="${CT_BUILD}-gcc" \
|
2008-06-17 22:26:44 +00:00
|
|
|
CC="${CT_TARGET}-gcc" \
|
2008-06-19 15:30:01 +00:00
|
|
|
CXX="${CT_TARGET}-gcc" \
|
2008-06-17 22:26:44 +00:00
|
|
|
RANLIB="${CT_TARGET}-ranlib" \
|
|
|
|
DUMA_CPP="${DUMA_CPP}" \
|
2008-07-14 21:57:57 +00:00
|
|
|
${libs}
|
2008-06-17 22:26:44 +00:00
|
|
|
CT_DoLog EXTRA "Installing libraries '${libs}'"
|
2008-07-14 21:57:57 +00:00
|
|
|
CT_DoExecLog ALL install -m 644 ${libs} "${CT_SYSROOT_DIR}/usr/lib"
|
2007-07-12 08:47:15 +00:00
|
|
|
if [ "${CT_DUMA_SO}" = "y" ]; then
|
2008-06-17 22:26:44 +00:00
|
|
|
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"
|
2009-03-03 17:41:59 +00:00
|
|
|
mkdir -p "${CT_DEBUGROOT_DIR}/usr/bin"
|
2008-06-17 22:26:44 +00:00
|
|
|
# Install a simpler, smaller, safer wrapper than the one provided by D.U.M.A.
|
2008-06-30 20:37:14 +00:00
|
|
|
sed -r -e 's:^LIBDUMA_SO=.*:LIBDUMA_SO=/usr/lib/'"${duma_so}"':;' \
|
|
|
|
"${CT_LIB_DIR}/scripts/build/debug/duma.in" \
|
2009-03-03 17:41:59 +00:00
|
|
|
>"${CT_DEBUGROOT_DIR}/usr/bin/duma"
|
|
|
|
chmod 755 "${CT_DEBUGROOT_DIR}/usr/bin/duma"
|
2007-07-12 08:47:15 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
CT_Popd
|
2008-06-17 22:26:44 +00:00
|
|
|
CT_EndStep
|
2007-07-12 08:47:15 +00:00
|
|
|
}
|
|
|
|
|