scripts/build/binutils/sstrip.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Mar 20 00:02:21 2011 +0100 (2011-03-20)
changeset 2339 730e2d63296b
parent 1858 43d14939d956
child 2926 d304c8a7bfa8
permissions -rw-r--r--
scripts: leave changelog in build dir, copy to install dir

Users tend to look for the build log in the current working directory,
rather than in the toolchain's installation dir. While bundling the build
log in the toolchain installation dir is nice for distribution and review,
it can be easier to have the build log readily available in the working
directory, as it is quicker to get to it.

So, the build log stays in the working directory until the toolchain is
completely and successfully built, and then a (compressed) copy is made.

Reported-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     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         local sstrip_cflags
    24         CT_DoStep INFO "Installing sstrip"
    25         mkdir -p "${CT_BUILD_DIR}/build-sstrip"
    26         cd "${CT_BUILD_DIR}/build-sstrip"
    27 
    28         if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
    29             sstrip_cflags="-static"
    30         fi
    31 
    32         CT_DoLog EXTRA "Building sstrip"
    33         CT_DoExecLog ALL "${CT_HOST}-gcc" -Wall ${sstrip_cflags} -o sstrip "${CT_SRC_DIR}/sstrip/sstrip.c"
    34 
    35         CT_DoLog EXTRA "Installing sstrip"
    36         CT_DoExecLog ALL install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip"
    37 
    38         CT_EndStep
    39     }
    40 fi