1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/scripts/build/tools/sstrip.sh Fri Jun 01 17:00:43 2007 +0000
1.3 @@ -0,0 +1,71 @@
1.4 +# This will build and install sstrip to run on host and sstrip target files
1.5 +
1.6 +is_enabled="${CT_SSTRIP}"
1.7 +
1.8 +case "${CT_SSTRIP_FROM}" in
1.9 + ELFkickers)
1.10 + do_tools_sstrip_get() {
1.11 + CT_GetFile "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}" \
1.12 + http://www.muppetlabs.com/~breadbox/pub/software
1.13 + }
1.14 + do_tools_sstrip_extract() {
1.15 + CT_ExtractAndPatch "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}"
1.16 + }
1.17 + do_tools_sstrip_build() {
1.18 + CT_DoStep INFO "Installing sstrip"
1.19 + mkdir -p "${CT_BUILD_DIR}/build-strip"
1.20 + cd "${CT_BUILD_DIR}/build-strip"
1.21 + ( cd "${CT_SRC_DIR}/ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}/sstrip"; tar cf - . ) |tar xf -
1.22 +
1.23 + CT_DoLog EXTRA "Building sstrip"
1.24 + make CC="${CT_CC_NATIVE}" sstrip 2>&1 |CT_DoLog ALL
1.25 +
1.26 + CT_DoLog EXTRA "Installing sstrip"
1.27 + install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip" 2>&1 |CT_DoLog ALL
1.28 +
1.29 + CT_EndStep
1.30 + }
1.31 + ;;
1.32 +
1.33 + buildroot)
1.34 + sstrip_url='http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/toolchain/sstrip/sstrip.c'
1.35 + do_tools_sstrip_get() {
1.36 + # With this one, we must handle the download by ourselves,
1.37 + # we can't leave the job to the classic CT_GetFile.
1.38 + if [ -f "${CT_SRC_DIR}/sstrip/sstrip.c" ]; then
1.39 + return 0
1.40 + fi
1.41 + CT_Pushd "${CT_SRC_DIR}"
1.42 + CT_DoLog EXTRA "Retrieving sstrip (buildroot)"
1.43 + mkdir -p sstrip
1.44 + cd sstrip
1.45 + http_data=`lynx -dump "${sstrip_url}"`
1.46 + link=`echo -en "${http_data}" \
1.47 + |egrep '\[[[:digit:]]+\]download' \
1.48 + |sed -r -e 's/.*\[([[:digit:]]+)\]download.*/\1/;'`
1.49 + rev_url=`echo -en "${http_data}" \
1.50 + |egrep '^ *8\.' \
1.51 + |sed -r -e 's/^ *'${link}'\. +(.+)$/\1/;'`
1.52 + CT_DoGetFile "${rev_url}" 2>&1 |CT_DoLog ALL
1.53 + mv sstrip.c?* sstrip.c
1.54 + CT_Popd
1.55 + }
1.56 + do_tools_sstrip_extract() {
1.57 + # We'll let buildroot guys take care of sstrip maintenance and patching.
1.58 + :
1.59 + }
1.60 + do_tools_sstrip_build() {
1.61 + CT_DoStep INFO "Installing sstrip"
1.62 + mkdir -p "${CT_BUILD_DIR}/build-sstrip"
1.63 + cd "${CT_BUILD_DIR}/build-sstrip"
1.64 +
1.65 + CT_DoLog EXTRA "Building sstrip"
1.66 + ${CT_CC_NATIVE} -Wall -o sstrip "${CT_SRC_DIR}/sstrip/sstrip.c" 2>&1 |CT_DoLog ALL
1.67 +
1.68 + CT_DoLog EXTRA "Installing sstrip"
1.69 + install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip" 2>&1 |CT_DoLog ALL
1.70 +
1.71 + CT_EndStep
1.72 + }
1.73 + ;;
1.74 +esac