scripts/build/debug/dmalloc.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Feb 17 22:08:06 2008 +0000 (2008-02-17)
changeset 431 8bde4c6ea47a
parent 161 be4484f10ac7
permissions -rw-r--r--
Robert P. J. DAY says:

apparently, the patchset for gcc 4.2.1 applies properly to the
source for gcc 4.2.2 and gcc 4.2.3. so, if you want, you can simply
add support for those last two just by augmenting menuconfig and
adding a couple symlinks for those two directories. seems like a
cheap way to add a couple new versions.
yann@103
     1
# Build script for the dmalloc debug library facility
yann@103
     2
yann@103
     3
is_enabled="${CT_DMALLOC}"
yann@103
     4
yann@161
     5
do_print_filename() {
yann@161
     6
    [ "${CT_DMALLOC}" = "y" ] || return 0
yann@161
     7
    echo "dmalloc-${CT_DMALLOC_VERSION}"
yann@161
     8
}
yann@161
     9
yann@103
    10
do_debug_dmalloc_get() {
yann@103
    11
    CT_GetFile "dmalloc-${CT_DMALLOC_VERSION}" http://dmalloc.com/releases/
yann@103
    12
}
yann@103
    13
yann@103
    14
do_debug_dmalloc_extract() {
yann@103
    15
    CT_ExtractAndPatch "dmalloc-${CT_DMALLOC_VERSION}"
yann@103
    16
}
yann@103
    17
yann@103
    18
do_debug_dmalloc_build() {
yann@103
    19
    CT_DoStep INFO "Installing dmalloc"
yann@103
    20
    CT_DoLog EXTRA "Configuring dmalloc"
yann@103
    21
yann@103
    22
    mkdir -p "${CT_BUILD_DIR}/build-dmalloc"
yann@103
    23
    cd "${CT_BUILD_DIR}/build-dmalloc"
yann@103
    24
yann@103
    25
    extra_config=
yann@103
    26
    case "${CT_CC_LANG_CXX}" in
yann@103
    27
        y)  extra_config="${extra_config} --enable-cxx";;
yann@103
    28
        *)  extra_config="${extra_config} --disable-cxx";;
yann@103
    29
    esac
yann@136
    30
    case "${CT_THREADS_NONE}" in
yann@103
    31
        y)  extra_config="${extra_config} --disable-threads";;
yann@103
    32
        *)  extra_config="${extra_config} --enable-threads";;
yann@103
    33
    esac
yann@103
    34
    case "${CT_SHARED_LIBS}" in
yann@103
    35
        y)  extra_config="${extra_config} --enable-shlib";;
yann@103
    36
        *)  extra_config="${extra_config} --disable-shlib";;
yann@103
    37
    esac
yann@103
    38
yann@103
    39
    CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
yann@103
    40
yann@103
    41
    LD="${CT_TARGET}-ld"                                        \
yann@103
    42
    AR="${CT_TARGET}-ar"                                        \
yann@103
    43
    "${CT_SRC_DIR}/dmalloc-${CT_DMALLOC_VERSION}/configure"     \
yann@103
    44
        --prefix=/usr                                           \
yann@103
    45
        --build="${CT_BUILD}"                                   \
yann@103
    46
        --host="${CT_TARGET}"                                   \
yann@103
    47
        ${extra_config}                                         2>&1 |CT_DoLog ALL
yann@103
    48
yann@103
    49
    CT_DoLog EXTRA "Building dmalloc"
yann@359
    50
    make 2>&1 |CT_DoLog ALL
yann@103
    51
yann@104
    52
    CT_DoLog EXTRA "Installing dmalloc"
yann@103
    53
    make DESTDIR="${CT_SYSROOT_DIR}"       installincs      \
yann@103
    54
                                           installlib       2>&1 |CT_DoLog ALL
yann@103
    55
    make DESTDIR="${CT_DEBUG_INSTALL_DIR}" installutil      2>&1 |CT_DoLog ALL
yann@103
    56
yann@103
    57
    CT_EndStep
yann@103
    58
}