scripts/build/binutils/sstrip.sh
changeset 1854 02b74bd4373f
parent 1678 ac247da318a1
child 1856 e23ffb5c7928
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/scripts/build/binutils/sstrip.sh	Wed Mar 17 00:21:57 2010 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +# This will build and install sstrip to run on host and sstrip target files
     1.5 +
     1.6 +do_tools_sstrip_get() { :; }
     1.7 +do_tools_sstrip_extract() { :; }
     1.8 +do_tools_sstrip() { :; }
     1.9 +
    1.10 +case "${CT_SSTRIP_FROM}" in
    1.11 +    ELFkickers)
    1.12 +        do_sstrip_get() {
    1.13 +            CT_GetFile "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"     \
    1.14 +                       http://www.muppetlabs.com/~breadbox/pub/software
    1.15 +        }
    1.16 +        do_sstrip_extract() {
    1.17 +            CT_Extract "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"
    1.18 +            CT_Patch "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"
    1.19 +        }
    1.20 +        do_sstrip() {
    1.21 +            CT_DoStep INFO "Installing sstrip"
    1.22 +            CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}/sstrip"   \
    1.23 +                                    "${CT_BUILD_DIR}/build-strip"
    1.24 +            cd "${CT_BUILD_DIR}/build-strip"
    1.25 +
    1.26 +            CT_DoLog EXTRA "Building sstrip"
    1.27 +            CT_DoExecLog ALL make CC="${CT_HOST}-gcc" sstrip
    1.28 +            
    1.29 +            CT_DoLog EXTRA "Installing sstrip"
    1.30 +            CT_DoExecLog ALL install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip"
    1.31 +
    1.32 +            CT_EndStep
    1.33 +        }
    1.34 +    ;;
    1.35 +
    1.36 +    buildroot)
    1.37 +        do_sstrip_get() {
    1.38 +            CT_GetFile sstrip .c http://git.buildroot.net/buildroot/plain/toolchain/sstrip
    1.39 +        }
    1.40 +        do_sstrip_extract() {
    1.41 +            # We leave the sstrip maintenance to the buildroot people:
    1.42 +            # -> any fix-up goes directly there
    1.43 +            # -> we don't have patches for it
    1.44 +            # -> we don't need to patch it
    1.45 +            # -> just create a directory in src/, and copy it there.
    1.46 +            CT_DoExecLog DEBUG mkdir -p "${CT_SRC_DIR}/sstrip"
    1.47 +            CT_DoExecLog DEBUG cp -v "${CT_TARBALLS_DIR}/sstrip.c" "${CT_SRC_DIR}/sstrip"
    1.48 +        }
    1.49 +        do_sstrip() {
    1.50 +            CT_DoStep INFO "Installing sstrip"
    1.51 +            mkdir -p "${CT_BUILD_DIR}/build-sstrip"
    1.52 +            cd "${CT_BUILD_DIR}/build-sstrip"
    1.53 +
    1.54 +            CT_DoLog EXTRA "Building sstrip"
    1.55 +            CT_DoExecLog ALL "${CT_HOST}-gcc" -Wall -o sstrip "${CT_SRC_DIR}/sstrip/sstrip.c"
    1.56 +
    1.57 +            CT_DoLog EXTRA "Installing sstrip"
    1.58 +            CT_DoExecLog ALL install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip"
    1.59 +
    1.60 +            CT_EndStep
    1.61 +        }
    1.62 +    ;;
    1.63 +esac