scripts/build/debug/100-dmalloc.sh
author "Samuel Martin" <s.martin49@gmail.com>
Sat Mar 16 15:33:44 2013 +0100 (2013-03-16)
changeset 3200 0fc56e62cecf
parent 2343 91ac39ceb2db
permissions -rw-r--r--
debug/dmalloc: enforce cross-compilation

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Message-Id: <69772732f551aa342a2c.1363446264@laptop>
Patchwork-Id: 228221
     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     CC="${CT_TARGET}-gcc"                                       \
    38     CXX="${CT_TARGET}-g++"                                      \
    39     CPP="${CT_TARGET}-cpp"                                      \
    40     LD="${CT_TARGET}-ld"                                        \
    41     AR="${CT_TARGET}-ar"                                        \
    42     CFLAGS=-fPIC                                                \
    43     "${CT_SRC_DIR}/dmalloc-${CT_DMALLOC_VERSION}/configure"     \
    44         --prefix=/usr                                           \
    45         --build="${CT_BUILD}"                                   \
    46         --host="${CT_TARGET}"                                   \
    47         "${extra_config[@]}"
    48 
    49     CT_DoLog EXTRA "Building dmalloc"
    50     CT_DoExecLog ALL make
    51 
    52     CT_DoLog EXTRA "Installing dmalloc"
    53     CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" installincs installlib
    54     CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" installutil
    55 
    56     CT_EndStep
    57 }