scripts/build/binutils/sstrip.sh
author Remy Bohmer <linux@bohmer.net>
Thu May 27 23:18:19 2010 +0200 (2010-05-27)
changeset 2060 51e4597b07fc
parent 1856 e23ffb5c7928
child 2324 68ec66ee2ff9
permissions -rw-r--r--
scripts: add option to strip all toolchain executables

To reduce filesizes of the toolchain and even improve build times
of projects to be build with this toolchain it is usefull to strip
the delivered toolchain executables. Since it is not likely that we
will debug the toolchain executables itself we do not need the
debug information inside the executables itself.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
     1 # This will build and install sstrip to run on host and sstrip target files
     2 
     3 do_sstrip_get() { :; }
     4 do_sstrip_extract() { :; }
     5 do_sstrip() { :; }
     6 
     7 if [ "${CT_SSTRIP}" = "y" ]; then
     8     do_sstrip_get() {
     9         CT_GetFile sstrip .c http://git.buildroot.net/buildroot/plain/toolchain/sstrip
    10     }
    11 
    12     do_sstrip_extract() {
    13         # We leave the sstrip maintenance to the buildroot people:
    14         # -> any fix-up goes directly there
    15         # -> we don't have patches for it
    16         # -> we don't need to patch it
    17         # -> just create a directory in src/, and copy it there.
    18         CT_DoExecLog DEBUG mkdir -p "${CT_SRC_DIR}/sstrip"
    19         CT_DoExecLog DEBUG cp -v "${CT_TARBALLS_DIR}/sstrip.c" "${CT_SRC_DIR}/sstrip"
    20     }
    21 
    22     do_sstrip() {
    23         CT_DoStep INFO "Installing sstrip"
    24         mkdir -p "${CT_BUILD_DIR}/build-sstrip"
    25         cd "${CT_BUILD_DIR}/build-sstrip"
    26 
    27         CT_DoLog EXTRA "Building sstrip"
    28         CT_DoExecLog ALL "${CT_HOST}-gcc" -Wall -o sstrip "${CT_SRC_DIR}/sstrip/sstrip.c"
    29 
    30         CT_DoLog EXTRA "Installing sstrip"
    31         CT_DoExecLog ALL install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip"
    32 
    33         CT_EndStep
    34     }
    35 fi