scripts/build/tools/200-sstrip.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Jan 06 22:34:36 2009 +0000 (2009-01-06)
changeset 1131 b62d14d45fc4
parent 1112 c72aecd1a9ef
child 1133 ff9c81b84c42
permissions -rw-r--r--
Add an option to forbid downloads.
Idea and code-base from Don Elwell <don@manifoldlabs.com>, adapted by me.

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