scripts/build/tools/200-sstrip.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 1041 2573519c00d6
child 1126 1ab3d2e08c8b
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@479
     1
# This will build and install sstrip to run on host and sstrip target files
yann@479
     2
yann@479
     3
case "${CT_SSTRIP_FROM}" in
yann@479
     4
    ELFkickers)
yann@479
     5
        do_tools_sstrip_get() {
yann@479
     6
            CT_GetFile "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"     \
yann@479
     7
                       http://www.muppetlabs.com/~breadbox/pub/software
yann@479
     8
        }
yann@479
     9
        do_tools_sstrip_extract() {
yann@479
    10
            CT_ExtractAndPatch "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"
yann@479
    11
        }
yann@479
    12
        do_tools_sstrip_build() {
yann@479
    13
            CT_DoStep INFO "Installing sstrip"
yann@479
    14
            mkdir -p "${CT_BUILD_DIR}/build-strip"
yann@479
    15
            cd "${CT_BUILD_DIR}/build-strip"
yann@479
    16
            ( cd "${CT_SRC_DIR}/ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}/sstrip"; tar cf - . ) |tar xf -
yann@479
    17
yann@479
    18
            CT_DoLog EXTRA "Building sstrip"
yann@1041
    19
            CT_DoExecLog ALL make CC="${CT_HOST}-gcc" sstrip
yann@479
    20
            
yann@479
    21
            CT_DoLog EXTRA "Installing sstrip"
yann@669
    22
            CT_DoExecLog ALL install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip"
yann@479
    23
yann@479
    24
            CT_EndStep
yann@479
    25
        }
yann@479
    26
    ;;
yann@479
    27
yann@479
    28
    buildroot)
yann@479
    29
        do_tools_sstrip_get() {
yann@713
    30
            # Note: the space between sstrip and .c is on purpose.
yann@713
    31
            CT_GetFile sstrip .c    \
yann@713
    32
                       "http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/*checkout*/trunk/buildroot/toolchain/sstrip/"
yann@479
    33
        }
yann@479
    34
        do_tools_sstrip_extract() {
yann@479
    35
            # We'll let buildroot guys take care of sstrip maintenance and patching.
yann@479
    36
            mkdir -p "${CT_SRC_DIR}/sstrip"
yann@669
    37
            CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/sstrip.c" "${CT_SRC_DIR}/sstrip"
yann@479
    38
        }
yann@479
    39
        do_tools_sstrip_build() {
yann@479
    40
            CT_DoStep INFO "Installing sstrip"
yann@479
    41
            mkdir -p "${CT_BUILD_DIR}/build-sstrip"
yann@479
    42
            cd "${CT_BUILD_DIR}/build-sstrip"
yann@479
    43
yann@479
    44
            CT_DoLog EXTRA "Building sstrip"
yann@1041
    45
            CT_DoExecLog ALL "${CT_HOST}-gcc" -Wall -o sstrip "${CT_SRC_DIR}/sstrip/sstrip.c"
yann@479
    46
yann@479
    47
            CT_DoLog EXTRA "Installing sstrip"
yann@669
    48
            CT_DoExecLog ALL install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip"
yann@479
    49
yann@479
    50
            CT_EndStep
yann@479
    51
        }
yann@479
    52
    ;;
yann@479
    53
yann@1112
    54
    *)  do_tools_sstrip_get() {
yann@479
    55
            :
yann@479
    56
        }
yann@479
    57
        do_tools_sstrip_extract() {
yann@479
    58
            :
yann@479
    59
        }
yann@479
    60
        do_tools_sstrip_build() {
yann@479
    61
            :
yann@479
    62
        }
yann@479
    63
    ;;
yann@479
    64
esac