diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2007-07-12 08:47:15 +0000 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2007-07-12 08:47:15 +0000 |
commit | 21842b5910e7f62368e2cedb12e9920dc9b3c78c (patch) | |
tree | 0dc82b51897560a6d109007e95393aaa19f8f5dd /scripts/build/debug | |
parent | 429be50c73179ca2d14fae8ca61fb6432002c206 (diff) | |
download | crosstool-ng-21842b5910e7f62368e2cedb12e9920dc9b3c78c.tar.gz crosstool-ng-21842b5910e7f62368e2cedb12e9920dc9b3c78c.tar.bz2 crosstool-ng-21842b5910e7f62368e2cedb12e9920dc9b3c78c.zip |
Add D.U.M.A., the Electric Fence successor.
Diffstat (limited to 'scripts/build/debug')
-rw-r--r-- | scripts/build/debug/duma.sh | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/scripts/build/debug/duma.sh b/scripts/build/debug/duma.sh new file mode 100644 index 00000000..e657944a --- /dev/null +++ b/scripts/build/debug/duma.sh @@ -0,0 +1,64 @@ +# Biuld script for D.U.M.A. + +is_enabled="${CT_DUMA}" + +do_print_filename() { + [ "${CT_DUMA}" = "y" ] || return 0 + 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: + cd "${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}" +} + +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 + + libs= + [ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a" + [ "${CT_DUMA_SO}" = "y" ] && libs="${libs} libduma.so.0.0" + for lib in ${libs}; do + CT_DoLog EXTRA "Building library \"${lib}\"" + make HOSTCC="${CT_CC_NATIVE}" \ + HOSTCXX="${CT_CC_NATIVE}" \ + CC="${CT_TARGET}-gcc" \ + CXX="${CT_TARGET}-gcc" \ + DUMA_CPP="${DUMA_CPP}" \ + ${lib} 2>&1 |CT_DoLog ALL + CT_DoLog EXTRA "Installing library \"${lib}\"" + install -m 644 "${lib}" "${CT_SYSROOT_DIR}/usr/lib" 2>&1 |CT_DoLog ALL + done + if [ "${CT_DUMA_SO}" = "y" ]; then + CT_DoLog EXTRA "Installing shared library links" + ln -vsf libduma.so.0.0 "${CT_SYSROOT_DIR}/usr/lib/libduma.so.0" 2>&1 |CT_DoLog ALL + ln -vsf libduma.so.0.0 "${CT_SYSROOT_DIR}/usr/lib/libduma.so" 2>&1 |CT_DoLog ALL + fi + CT_DoLog EXTRA "Installing LD_PRELOAD wrapper script" + mkdir -p "${CT_DEBUG_INSTALL_DIR}/usr/bin" + cp -v duma.sh \ + "${CT_DEBUG_INSTALL_DIR}/usr/bin/duma" 2>&1 |CT_DoLog ALL + + CT_EndStep + CT_Popd +} + |