scripts/build/debug/200-duma.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed May 20 20:13:13 2009 +0000 (2009-05-20)
changeset 1345 27fec561af53
parent 1238 73c8b86a05b1
child 1489 8c45efc97e7f
permissions -rw-r--r--
Merge the uClinux/noMMU stuff back to /trunk:
- merge Linux and uClinux back to a single kernel
- add ARCH_USE_MMU and acquainted config options that
architectures can auto-select
- make binutils and elf2flt two "Binary utilities" that
go in a single common sub-{menu,directory} structure

-------- diffstat follows --------
/trunk/scripts/build/kernel/uclinux.sh | 2 0 2 0 -
/trunk/scripts/build/kernel/linux.sh | 206 204 2 0 +++++++++++++++++++++++++++++
/trunk/scripts/build/kernel/linux-common.sh | 198 0 198 0 ----------------------------
/trunk/scripts/build/binutils.sh | 232 0 232 0 --------------------------------
/trunk/scripts/build/elf2flt.sh | 150 0 150 0 ---------------------
/trunk/scripts/crosstool-NG.sh.in | 6 4 2 0 +
/trunk/config/kernel/linux.in | 249 249 0 0 +++++++++++++++++++++++++++++++++++
/trunk/config/kernel/linux.in-common | 252 0 252 0 -----------------------------------
/trunk/config/kernel/uclinux.in | 21 0 21 0 ---
/trunk/config/target.in | 23 22 1 0 +++
/trunk/config/elf2flt.in | 49 0 49 0 -------
/trunk/config/libc/glibc.in | 2 1 1 0
/trunk/config/libc/eglibc.in | 2 1 1 0
/trunk/config/config.in | 1 0 1 0 -
/trunk/config/arch/sh.in | 1 1 0 0 +
/trunk/config/arch/arm.in | 2 1 1 0
/trunk/config/arch/powerpc.in | 1 1 0 0 +
/trunk/config/arch/ia64.in | 1 1 0 0 +
/trunk/config/arch/alpha.in | 1 1 0 0 +
/trunk/config/arch/x86.in | 1 1 0 0 +
/trunk/config/arch/mips.in | 1 1 0 0 +
/trunk/config/arch/powerpc64.in | 1 1 0 0 +
22 files changed, 489 insertions(+), 913 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@711
     5
    # Downloading from sourceforge leaves garbage, cleanup
yann@1126
     6
    CT_DoExecLog ALL rm -f "${CT_TARBALLS_DIR}/showfiles.php"*
yann@479
     7
}
yann@479
     8
yann@479
     9
do_debug_duma_extract() {
yann@1126
    10
    CT_Extract "duma_${CT_DUMA_VERSION}"
yann@1126
    11
    CT_Pushd "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}"
yann@1126
    12
    # Even if DUMA uses _ and not -, crosstool-NG uses the dash to split the
yann@1126
    13
    # name from the version in order to find the appropriate patches
yann@1126
    14
    # YEM: FIXME: make CT_Patch more intelligent, Eg.: CT_Patch duma _ "${CT_DUMA_VERSION}"
yann@1238
    15
    CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.duma-${CT_DUMA_VERSION}.extracted"
yann@1126
    16
    CT_Patch "duma-${CT_DUMA_VERSION}" nochdir
yann@1126
    17
    CT_Popd
yann@479
    18
}
yann@479
    19
yann@479
    20
do_debug_duma_build() {
yann@479
    21
    CT_DoStep INFO "Installing D.U.M.A."
yann@479
    22
    CT_DoLog EXTRA "Copying sources"
yann@1125
    23
    cp -a "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}" "${CT_BUILD_DIR}/build-duma"
yann@479
    24
    CT_Pushd "${CT_BUILD_DIR}/build-duma"
yann@479
    25
yann@479
    26
    DUMA_CPP=
yann@479
    27
    [ "${CT_CC_LANG_CXX}" = "y" ] && DUMA_CPP=1
yann@479
    28
yann@571
    29
    # The shared library needs some love: some version have libduma.so.0.0,
yann@571
    30
    # while others have libduma.so.0.0.0
yann@1247
    31
    duma_so=$(make -n -p 2>&1 |grep -E '^libduma.so[^:]*:' |head -n 1 |cut -d : -f 1)
yann@571
    32
yann@479
    33
    libs=
yann@479
    34
    [ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
yann@571
    35
    [ "${CT_DUMA_SO}" = "y" ] && libs="${libs} ${duma_so}"
yann@571
    36
    libs="${libs# }"
yann@571
    37
    CT_DoLog EXTRA "Building libraries '${libs}'"
yann@669
    38
    CT_DoExecLog ALL                    \
yann@1041
    39
    make HOSTCC="${CT_BUILD}-gcc"       \
yann@571
    40
         CC="${CT_TARGET}-gcc"          \
yann@581
    41
         CXX="${CT_TARGET}-gcc"         \
yann@571
    42
         RANLIB="${CT_TARGET}-ranlib"   \
yann@571
    43
         DUMA_CPP="${DUMA_CPP}"         \
yann@669
    44
         ${libs}
yann@571
    45
    CT_DoLog EXTRA "Installing libraries '${libs}'"
yann@669
    46
    CT_DoExecLog ALL install -m 644 ${libs} "${CT_SYSROOT_DIR}/usr/lib"
yann@479
    47
    if [ "${CT_DUMA_SO}" = "y" ]; then
yann@571
    48
        CT_DoLog EXTRA "Installing shared library link"
yann@571
    49
        ln -vsf ${duma_so} "${CT_SYSROOT_DIR}/usr/lib/libduma.so"   2>&1 |CT_DoLog ALL
yann@571
    50
        CT_DoLog EXTRA "Installing wrapper script"
yann@1219
    51
        mkdir -p "${CT_DEBUGROOT_DIR}/usr/bin"
yann@571
    52
        # Install a simpler, smaller, safer wrapper than the one provided by D.U.M.A.
yann@635
    53
        sed -r -e 's:^LIBDUMA_SO=.*:LIBDUMA_SO=/usr/lib/'"${duma_so}"':;'   \
yann@635
    54
            "${CT_LIB_DIR}/scripts/build/debug/duma.in"                     \
yann@1219
    55
            >"${CT_DEBUGROOT_DIR}/usr/bin/duma"
yann@1219
    56
        chmod 755 "${CT_DEBUGROOT_DIR}/usr/bin/duma"
yann@479
    57
    fi
yann@479
    58
yann@571
    59
    CT_Popd
yann@479
    60
    CT_EndStep
yann@479
    61
}
yann@479
    62