scripts/build/tools/200-sstrip.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 17 23:06:02 2010 +0100 (2010-01-17)
changeset 1740 c57458bb354d
parent 1334 f37bf01a94a3
permissions -rw-r--r--
configure: do not require hg when configuring in an hg clone

When configuring in an hg clone, we need hg to compute the version string.
It can happen that users do not have Mercurial (eg. if they got a snapshot
rather that they did a full clone). In this case, we can still run, of
course, so simply fill the version string with a sufficiently explicit
value, that does not require hg. The date is a good candidate.
     1 # This will build and install sstrip to run on host and sstrip target files
     2 
     3 case "${CT_SSTRIP_FROM}" in
     4     ELFkickers)
     5         do_tools_sstrip_get() {
     6             CT_GetFile "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"     \
     7                        http://www.muppetlabs.com/~breadbox/pub/software
     8         }
     9         do_tools_sstrip_extract() {
    10             CT_Extract "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"
    11             CT_Patch "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"
    12         }
    13         do_tools_sstrip_build() {
    14             CT_DoStep INFO "Installing sstrip"
    15             CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}/sstrip"   \
    16                                     "${CT_BUILD_DIR}/build-strip"
    17             cd "${CT_BUILD_DIR}/build-strip"
    18 
    19             CT_DoLog EXTRA "Building sstrip"
    20             CT_DoExecLog ALL make CC="${CT_HOST}-gcc" sstrip
    21             
    22             CT_DoLog EXTRA "Installing sstrip"
    23             CT_DoExecLog ALL install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip"
    24 
    25             CT_EndStep
    26         }
    27     ;;
    28 
    29     buildroot)
    30         do_tools_sstrip_get() {
    31             CT_GetFile sstrip .c http://git.buildroot.net/buildroot/plain/toolchain/sstrip
    32         }
    33         do_tools_sstrip_extract() {
    34             # We leave the sstrip maintenance to the buildroot people:
    35             # -> any fix-up goes directly there
    36             # -> we don't have patches for it
    37             # -> we don't need to patch it
    38             # -> just create a directory in src/, and copy it there.
    39             CT_DoExecLog DEBUG mkdir -p "${CT_SRC_DIR}/sstrip"
    40             CT_DoExecLog DEBUG cp -v "${CT_TARBALLS_DIR}/sstrip.c" "${CT_SRC_DIR}/sstrip"
    41         }
    42         do_tools_sstrip_build() {
    43             CT_DoStep INFO "Installing sstrip"
    44             mkdir -p "${CT_BUILD_DIR}/build-sstrip"
    45             cd "${CT_BUILD_DIR}/build-sstrip"
    46 
    47             CT_DoLog EXTRA "Building sstrip"
    48             CT_DoExecLog ALL "${CT_HOST}-gcc" -Wall -o sstrip "${CT_SRC_DIR}/sstrip/sstrip.c"
    49 
    50             CT_DoLog EXTRA "Installing sstrip"
    51             CT_DoExecLog ALL install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip"
    52 
    53             CT_EndStep
    54         }
    55     ;;
    56 
    57     *)  do_tools_sstrip_get() {
    58             :
    59         }
    60         do_tools_sstrip_extract() {
    61             :
    62         }
    63         do_tools_sstrip_build() {
    64             :
    65         }
    66     ;;
    67 esac