scripts/build/binutils/sstrip.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Mar 17 00:21:57 2010 +0100 (2010-03-17)
changeset 1854 02b74bd4373f
parent 1678 scripts/build/tools/200-sstrip.sh@ac247da318a1
child 1856 e23ffb5c7928
permissions -rw-r--r--
tools: move sstrip to the binary utilities menu

sstrip is now alone in its 'tools' menu, and we will probably never gain
any other 'tool'. Besides, sstrip is just strip, but a little bit more
agressive, so it deserves going to the 'binary utilities' menu.
yann@479
     1
# This will build and install sstrip to run on host and sstrip target files
yann@479
     2
yann@1854
     3
do_tools_sstrip_get() { :; }
yann@1854
     4
do_tools_sstrip_extract() { :; }
yann@1854
     5
do_tools_sstrip() { :; }
yann@1854
     6
yann@479
     7
case "${CT_SSTRIP_FROM}" in
yann@479
     8
    ELFkickers)
yann@1854
     9
        do_sstrip_get() {
yann@479
    10
            CT_GetFile "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"     \
yann@479
    11
                       http://www.muppetlabs.com/~breadbox/pub/software
yann@479
    12
        }
yann@1854
    13
        do_sstrip_extract() {
yann@1126
    14
            CT_Extract "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"
yann@1126
    15
            CT_Patch "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"
yann@479
    16
        }
yann@1854
    17
        do_sstrip() {
yann@479
    18
            CT_DoStep INFO "Installing sstrip"
yann@1678
    19
            CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}/sstrip"   \
yann@1678
    20
                                    "${CT_BUILD_DIR}/build-strip"
yann@479
    21
            cd "${CT_BUILD_DIR}/build-strip"
yann@479
    22
yann@479
    23
            CT_DoLog EXTRA "Building sstrip"
yann@1041
    24
            CT_DoExecLog ALL make CC="${CT_HOST}-gcc" sstrip
yann@479
    25
            
yann@479
    26
            CT_DoLog EXTRA "Installing sstrip"
yann@669
    27
            CT_DoExecLog ALL install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip"
yann@479
    28
yann@479
    29
            CT_EndStep
yann@479
    30
        }
yann@479
    31
    ;;
yann@479
    32
yann@479
    33
    buildroot)
yann@1854
    34
        do_sstrip_get() {
yann@1334
    35
            CT_GetFile sstrip .c http://git.buildroot.net/buildroot/plain/toolchain/sstrip
yann@479
    36
        }
yann@1854
    37
        do_sstrip_extract() {
yann@1334
    38
            # We leave the sstrip maintenance to the buildroot people:
yann@1334
    39
            # -> any fix-up goes directly there
yann@1334
    40
            # -> we don't have patches for it
yann@1334
    41
            # -> we don't need to patch it
yann@1334
    42
            # -> just create a directory in src/, and copy it there.
yann@1334
    43
            CT_DoExecLog DEBUG mkdir -p "${CT_SRC_DIR}/sstrip"
yann@1334
    44
            CT_DoExecLog DEBUG cp -v "${CT_TARBALLS_DIR}/sstrip.c" "${CT_SRC_DIR}/sstrip"
yann@479
    45
        }
yann@1854
    46
        do_sstrip() {
yann@479
    47
            CT_DoStep INFO "Installing sstrip"
yann@479
    48
            mkdir -p "${CT_BUILD_DIR}/build-sstrip"
yann@479
    49
            cd "${CT_BUILD_DIR}/build-sstrip"
yann@479
    50
yann@479
    51
            CT_DoLog EXTRA "Building sstrip"
yann@1041
    52
            CT_DoExecLog ALL "${CT_HOST}-gcc" -Wall -o sstrip "${CT_SRC_DIR}/sstrip/sstrip.c"
yann@479
    53
yann@479
    54
            CT_DoLog EXTRA "Installing sstrip"
yann@669
    55
            CT_DoExecLog ALL install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip"
yann@479
    56
yann@479
    57
            CT_EndStep
yann@479
    58
        }
yann@479
    59
    ;;
yann@479
    60
esac