scripts/build/tools/200-sstrip.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat May 03 17:51:16 2008 +0000 (2008-05-03)
changeset 486 92f6149c4275
child 523 010f6f4e4dd6
permissions -rw-r--r--
Some people are reposrting that ftp does not work on their network, probably due to proxies, while http does work.
Some (most) of the sites we use toretrieve tarballs have http equivallent for the ftp service. Use http as a failover.
There's no solution for those sites that do not have such an http equivalent.

/trunk/scripts/build/binutils.sh | 5 2 3 0 ++---
/trunk/scripts/build/libc_glibc.sh | 4 2 2 0 ++--
/trunk/scripts/build/libc_uClibc.sh | 2 1 1 0 +-
/trunk/scripts/build/debug/400-ltrace.sh | 2 1 1 0 +-
/trunk/scripts/build/debug/300-gdb.sh | 8 3 5 0 +++-----
/trunk/scripts/build/kernel_linux.sh | 7 2 5 0 ++-----
/trunk/scripts/build/cc_gcc.sh | 6 2 4 0 ++----
/trunk/scripts/build/gmp.sh | 4 1 3 0 +---
8 files changed, 14 insertions(+), 24 deletions(-)
     1 # This will build and install sstrip to run on host and sstrip target files
     2 
     3 is_enabled="${CT_SSTRIP}"
     4 
     5 case "${CT_SSTRIP_FROM}" in
     6     ELFkickers)
     7         do_print_filename() {
     8             echo "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"
     9         }
    10         do_tools_sstrip_get() {
    11             CT_GetFile "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"     \
    12                        http://www.muppetlabs.com/~breadbox/pub/software
    13         }
    14         do_tools_sstrip_extract() {
    15             CT_ExtractAndPatch "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"
    16         }
    17         do_tools_sstrip_build() {
    18             CT_DoStep INFO "Installing sstrip"
    19             mkdir -p "${CT_BUILD_DIR}/build-strip"
    20             cd "${CT_BUILD_DIR}/build-strip"
    21             ( cd "${CT_SRC_DIR}/ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}/sstrip"; tar cf - . ) |tar xf -
    22 
    23             CT_DoLog EXTRA "Building sstrip"
    24             make CC="${CT_CC_NATIVE}" sstrip 2>&1 |CT_DoLog ALL
    25             
    26             CT_DoLog EXTRA "Installing sstrip"
    27             install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip" 2>&1 |CT_DoLog ALL
    28 
    29             CT_EndStep
    30         }
    31     ;;
    32 
    33     buildroot)
    34         sstrip_url='http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/toolchain/sstrip/sstrip.c'
    35         do_print_filename() {
    36             echo "sstrip.c"
    37         }
    38         do_tools_sstrip_get() {
    39             # With this one, we must handle the download by ourselves,
    40             # we can't leave the job to the classic CT_GetFile.
    41             if [ -f "${CT_TARBALLS_DIR}/sstrip.c" ]; then
    42                 return 0
    43             fi
    44             if [ -f "${CT_LOCAL_TARBALLS_DIR}/sstrip.c" ]; then
    45                 CT_DoLog EXTRA "Using \"sstrip\" from local storage"
    46                 ln -sf "${CT_LOCAL_TARBALLS_DIR}/sstrip.c"  \
    47                        "${CT_TARBALLS_DIR}/sstrip.c"        2>&1 |CT_DoLog ALL
    48                 return 0
    49             fi
    50             CT_Pushd "${CT_TARBALLS_DIR}"
    51             CT_DoLog EXTRA "Retrieving \"sstrip\" from network"
    52             http_data=`lynx -dump "${sstrip_url}"`
    53             link=`echo -en "${http_data}"                           \
    54                   |egrep '\[[[:digit:]]+\]download'                 \
    55                   |sed -r -e 's/.*\[([[:digit:]]+)\]download.*/\1/;'`
    56             rev_url=`echo -en "${http_data}"                        \
    57                      |egrep '^ *8\.'                                \
    58                      |sed -r -e 's/^ *'${link}'\. +(.+)$/\1/;'`
    59             CT_DoGetFile "${rev_url}" 2>&1 |CT_DoLog ALL
    60             mv -v sstrip.c?* sstrip.c 2>&1 |CT_DoLog DEBUG
    61             if [ "${CT_SAVE_TARBALLS}" = "y" ]; then
    62                 CT_DoLog EXTRA "Saving \"sstrip.c\" to local storage"
    63                 cp -v sstrip.c "${CT_LOCAL_TARBALLS_DIR}" 2>&1 |CT_DoLog DEBUG
    64             fi
    65             CT_Popd
    66         }
    67         do_tools_sstrip_extract() {
    68             # We'll let buildroot guys take care of sstrip maintenance and patching.
    69             mkdir -p "${CT_SRC_DIR}/sstrip"
    70             cp -v "${CT_TARBALLS_DIR}/sstrip.c" "${CT_SRC_DIR}/sstrip" |CT_DoLog ALL
    71         }
    72         do_tools_sstrip_build() {
    73             CT_DoStep INFO "Installing sstrip"
    74             mkdir -p "${CT_BUILD_DIR}/build-sstrip"
    75             cd "${CT_BUILD_DIR}/build-sstrip"
    76 
    77             CT_DoLog EXTRA "Building sstrip"
    78             ${CT_CC_NATIVE} -Wall -o sstrip "${CT_SRC_DIR}/sstrip/sstrip.c" 2>&1 |CT_DoLog ALL
    79 
    80             CT_DoLog EXTRA "Installing sstrip"
    81             install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip" 2>&1 |CT_DoLog ALL
    82 
    83             CT_EndStep
    84         }
    85     ;;
    86 
    87     *)  do_print_filename() {
    88             :
    89         }
    90         do_tools_sstrip_get() {
    91             :
    92         }
    93         do_tools_sstrip_extract() {
    94             :
    95         }
    96         do_tools_sstrip_build() {
    97             :
    98         }
    99     ;;
   100 esac