1 # Build script for the dmalloc debug library facility
3 is_enabled="${CT_DMALLOC}"
5 do_debug_dmalloc_get() {
6 CT_GetFile "dmalloc-${CT_DMALLOC_VERSION}" http://dmalloc.com/releases/
9 do_debug_dmalloc_extract() {
10 CT_ExtractAndPatch "dmalloc-${CT_DMALLOC_VERSION}"
13 do_debug_dmalloc_build() {
14 CT_DoStep INFO "Installing dmalloc"
15 CT_DoLog EXTRA "Configuring dmalloc"
17 mkdir -p "${CT_BUILD_DIR}/build-dmalloc"
18 cd "${CT_BUILD_DIR}/build-dmalloc"
21 case "${CT_CC_LANG_CXX}" in
22 y) extra_config="${extra_config} --enable-cxx";;
23 *) extra_config="${extra_config} --disable-cxx";;
25 case "${CT_LIBC_THREADS_NONE}" in
26 y) extra_config="${extra_config} --disable-threads";;
27 *) extra_config="${extra_config} --enable-threads";;
29 case "${CT_SHARED_LIBS}" in
30 y) extra_config="${extra_config} --enable-shlib";;
31 *) extra_config="${extra_config} --disable-shlib";;
34 CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
36 LD="${CT_TARGET}-ld" \
37 AR="${CT_TARGET}-ar" \
38 "${CT_SRC_DIR}/dmalloc-${CT_DMALLOC_VERSION}/configure" \
40 --build="${CT_BUILD}" \
41 --host="${CT_TARGET}" \
42 ${extra_config} 2>&1 |CT_DoLog ALL
44 CT_DoLog EXTRA "Building dmalloc"
45 make ${PARALLELMFLAGS} 2>&1 |CT_DoLog ALL
47 CT_DoLog EXTRA "Installing dmalloc"
48 make DESTDIR="${CT_SYSROOT_DIR}" installincs \
49 installlib 2>&1 |CT_DoLog ALL
50 make DESTDIR="${CT_DEBUG_INSTALL_DIR}" installutil 2>&1 |CT_DoLog ALL