scripts/build/debug/200-duma.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 04 22:17:53 2009 +0000 (2009-01-04)
changeset 1123 8c5881324a79
parent 1112 c72aecd1a9ef
child 1125 44037ce2db6d
permissions -rw-r--r--
Get rid of CT_LIBC_FILE, remove useless CT_MakeAbsolutePath.

CT_LIBC_FILE:
- that one was not easy, as it had sneaked into CT_ExtractAndPatch
- which in turn made CT_ExtractAndPatch have references to C library addons
- which in turn relieved the C library _extract functions from doing their own job
- which in turn imposed some nasty tricks in CT_ExtractAndPatch
- which in turn made life easier for the DUMA _get and _extract functions
- which unveiled some bizare behavior for pushd and popd:
- if using smthg ike: 'pushd foo |bar':
- the directory is *neither* changed
- *nor* is it pushed onto the stack
- which made popd fail

CT_MakeAbsolutePath:
- used only to make CT_LOCAL_TARBALLS_DIR canonical
- which is ((almost) useless:
- hopefully, the user entered a full path already
- if it's not the case, too bad...

/trunk/scripts/build/debug/200-duma.sh | 5 1 4 0 +--
/trunk/scripts/build/libc/glibc.sh | 61 32 29 0 +++++++++++++++++---------------
/trunk/scripts/build/libc/uClibc.sh | 16 10 6 0 +++++---
/trunk/scripts/build/libc/eglibc.sh | 48 26 22 0 ++++++++++++++-----------
/trunk/scripts/crosstool.sh | 8 0 8 0 ----
/trunk/scripts/functions | 77 15 62 0 ++++++++--------------------------------
6 files changed, 84 insertions(+), 131 deletions(-)
yann@571
     1
# Build script for D.U.M.A.
yann@479
     2
yann@479
     3
do_debug_duma_get() {
yann@479
     4
    CT_GetFile "duma_${CT_DUMA_VERSION}" http://mesh.dl.sourceforge.net/sourceforge/duma/
yann@479
     5
    # D.U.M.A. doesn't separate its name from its version with a dash,
yann@479
     6
    # but with an underscore. Create a link so that crosstool-NG can
yann@479
     7
    # work correctly:
yann@711
     8
    CT_Pushd "${CT_TARBALLS_DIR}"
yann@523
     9
    duma_ext=$(CT_GetFileExtension "duma_${CT_DUMA_VERSION}")
yann@479
    10
    rm -f "duma-${CT_DUMA_VERSION}${duma_ext}"
yann@479
    11
    ln -sf "duma_${CT_DUMA_VERSION}${duma_ext}" "duma-${CT_DUMA_VERSION}${duma_ext}"
yann@711
    12
    # Downloading from sourceforge leaves garbage, cleanup
yann@711
    13
    rm -f showfiles.php\?group_id\=*
yann@711
    14
    CT_Popd
yann@479
    15
}
yann@479
    16
yann@479
    17
do_debug_duma_extract() {
yann@479
    18
    CT_ExtractAndPatch "duma-${CT_DUMA_VERSION}"
yann@479
    19
}
yann@479
    20
yann@479
    21
do_debug_duma_build() {
yann@479
    22
    CT_DoStep INFO "Installing D.U.M.A."
yann@479
    23
    CT_DoLog EXTRA "Copying sources"
yann@1123
    24
    cp -a "${CT_SRC_DIR}/duma-${CT_DUMA_VERSION}" "${CT_BUILD_DIR}/build-duma"
yann@479
    25
    CT_Pushd "${CT_BUILD_DIR}/build-duma"
yann@479
    26
yann@479
    27
    DUMA_CPP=
yann@479
    28
    [ "${CT_CC_LANG_CXX}" = "y" ] && DUMA_CPP=1
yann@479
    29
yann@571
    30
    # The shared library needs some love: some version have libduma.so.0.0,
yann@571
    31
    # while others have libduma.so.0.0.0
yann@571
    32
    duma_so=$(make -n -p 2>&1 |egrep '^libduma.so[^:]*:' |head -n 1 |cut -d : -f 1)
yann@571
    33
yann@479
    34
    libs=
yann@479
    35
    [ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
yann@571
    36
    [ "${CT_DUMA_SO}" = "y" ] && libs="${libs} ${duma_so}"
yann@571
    37
    libs="${libs# }"
yann@571
    38
    CT_DoLog EXTRA "Building libraries '${libs}'"
yann@669
    39
    CT_DoExecLog ALL                    \
yann@1041
    40
    make HOSTCC="${CT_BUILD}-gcc"       \
yann@571
    41
         CC="${CT_TARGET}-gcc"          \
yann@581
    42
         CXX="${CT_TARGET}-gcc"         \
yann@571
    43
         RANLIB="${CT_TARGET}-ranlib"   \
yann@571
    44
         DUMA_CPP="${DUMA_CPP}"         \
yann@669
    45
         ${libs}
yann@571
    46
    CT_DoLog EXTRA "Installing libraries '${libs}'"
yann@669
    47
    CT_DoExecLog ALL install -m 644 ${libs} "${CT_SYSROOT_DIR}/usr/lib"
yann@479
    48
    if [ "${CT_DUMA_SO}" = "y" ]; then
yann@571
    49
        CT_DoLog EXTRA "Installing shared library link"
yann@571
    50
        ln -vsf ${duma_so} "${CT_SYSROOT_DIR}/usr/lib/libduma.so"   2>&1 |CT_DoLog ALL
yann@571
    51
        CT_DoLog EXTRA "Installing wrapper script"
yann@571
    52
        mkdir -p "${CT_DEBUG_INSTALL_DIR}/usr/bin"
yann@571
    53
        # Install a simpler, smaller, safer wrapper than the one provided by D.U.M.A.
yann@635
    54
        sed -r -e 's:^LIBDUMA_SO=.*:LIBDUMA_SO=/usr/lib/'"${duma_so}"':;'   \
yann@635
    55
            "${CT_LIB_DIR}/scripts/build/debug/duma.in"                     \
yann@635
    56
            >"${CT_DEBUG_INSTALL_DIR}/usr/bin/duma"
yann@571
    57
        chmod 755 "${CT_DEBUG_INSTALL_DIR}/usr/bin/duma"
yann@479
    58
    fi
yann@479
    59
yann@571
    60
    CT_Popd
yann@479
    61
    CT_EndStep
yann@479
    62
}
yann@479
    63