scripts/build/debug/100-dmalloc.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Aug 17 23:53:49 2011 +0200 (2011-08-17)
branch1.12
changeset 2634 e29a762bbadf
parent 2154 250cdcc86441
child 3200 0fc56e62cecf
permissions -rw-r--r--
debug/gdb: we don't care if the host tic is shared or static

Because we need our own host tic, we have to build it; and we do build
it statically for now.

But as MacOS/Darwin/Whatever-you-call-it does not support static linking
(what a shame!), it fails.

Anyway, we don't really care it being shared, in the end.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 41bd6777fa4f767d6264db7c58986920014fd708)
     1 # Build script for the dmalloc debug library facility
     2 
     3 do_debug_dmalloc_get() {
     4     CT_GetFile "dmalloc-${CT_DMALLOC_VERSION}" http://dmalloc.com/releases/
     5 }
     6 
     7 do_debug_dmalloc_extract() {
     8     CT_Extract "dmalloc-${CT_DMALLOC_VERSION}"
     9     CT_Patch "dmalloc" "${CT_DMALLOC_VERSION}"
    10 }
    11 
    12 do_debug_dmalloc_build() {
    13     local -a extra_config
    14 
    15     CT_DoStep INFO "Installing dmalloc"
    16     CT_DoLog EXTRA "Configuring dmalloc"
    17 
    18     mkdir -p "${CT_BUILD_DIR}/build-dmalloc"
    19     cd "${CT_BUILD_DIR}/build-dmalloc"
    20 
    21     case "${CT_CC_LANG_CXX}" in
    22         y)  extra_config+=("--enable-cxx");;
    23         *)  extra_config+=("--disable-cxx");;
    24     esac
    25     case "${CT_THREADS}" in
    26         none)   extra_config+=("--disable-threads");;
    27         *)      extra_config+=("--enable-threads");;
    28     esac
    29     case "${CT_SHARED_LIBS}" in
    30         y)  extra_config+=("--enable-shlib");;
    31         *)  extra_config+=("--disable-shlib");;
    32     esac
    33 
    34     CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
    35 
    36     CT_DoExecLog CFG                                            \
    37     LD="${CT_TARGET}-ld"                                        \
    38     AR="${CT_TARGET}-ar"                                        \
    39     CFLAGS=-fPIC                                                \
    40     "${CT_SRC_DIR}/dmalloc-${CT_DMALLOC_VERSION}/configure"     \
    41         --prefix=/usr                                           \
    42         --build="${CT_BUILD}"                                   \
    43         --host="${CT_TARGET}"                                   \
    44         "${extra_config[@]}"
    45 
    46     CT_DoLog EXTRA "Building dmalloc"
    47     CT_DoExecLog ALL make
    48 
    49     CT_DoLog EXTRA "Installing dmalloc"
    50     CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" installincs installlib
    51     CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" installutil
    52 
    53     CT_EndStep
    54 }