scripts/build/binutils/sstrip.sh
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Tue Jul 31 22:27:29 2012 +0200 (2012-07-31)
changeset 3018 7776e8369284
parent 2324 68ec66ee2ff9
permissions -rw-r--r--
complibs/cloog: create missing m4 dir

Because we now patch configure.in and configure, the Makefile quicks
in a re-build rule as the source files are now more recent than the
bundled generated files, and that fails because the m4 directory
is missing, although on some systems where aclocal is not installed,
the re-build rule does nothing (except a warning).

Always create tht directory.

Reported-by: Per Arnold Blaasmo <per-arnold.blaasmo@atmel.com>
[Also thanks to Thomas De Schampheleire <patrickdepinguin@gmail.com>
for some digging works on this issue]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
yann@479
     1
# This will build and install sstrip to run on host and sstrip target files
yann@479
     2
yann@2926
     3
do_sstrip_get()      { :; }
yann@2926
     4
do_sstrip_extract()  { :; }
yann@2926
     5
do_sstrip_for_host() { :; }
yann@1854
     6
yann@1856
     7
if [ "${CT_SSTRIP}" = "y" ]; then
yann@1856
     8
    do_sstrip_get() {
yann@1856
     9
        CT_GetFile sstrip .c http://git.buildroot.net/buildroot/plain/toolchain/sstrip
yann@1856
    10
    }
yann@479
    11
yann@1856
    12
    do_sstrip_extract() {
yann@1856
    13
        # We leave the sstrip maintenance to the buildroot people:
yann@1856
    14
        # -> any fix-up goes directly there
yann@1856
    15
        # -> we don't have patches for it
yann@1856
    16
        # -> we don't need to patch it
yann@1856
    17
        # -> just create a directory in src/, and copy it there.
yann@1856
    18
        CT_DoExecLog DEBUG mkdir -p "${CT_SRC_DIR}/sstrip"
yann@1856
    19
        CT_DoExecLog DEBUG cp -v "${CT_TARBALLS_DIR}/sstrip.c" "${CT_SRC_DIR}/sstrip"
yann@1856
    20
    }
yann@479
    21
yann@2926
    22
    # Build sstrip for host -> target
yann@2926
    23
    # Note: we don't need sstrip to run on the build machine,
yann@2926
    24
    # so we do not need the frontend/backend stuff...
yann@2926
    25
    do_sstrip_for_host() {
yann@2324
    26
        local sstrip_cflags
yann@2926
    27
        CT_DoStep INFO "Installing sstrip for host"
yann@2926
    28
        CT_mkdir_pushd "${CT_BUILD_DIR}/build-sstrip-host"
yann@479
    29
yann@2324
    30
        if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
yann@2324
    31
            sstrip_cflags="-static"
yann@2324
    32
        fi
yann@2324
    33
yann@1856
    34
        CT_DoLog EXTRA "Building sstrip"
yann@2324
    35
        CT_DoExecLog ALL "${CT_HOST}-gcc" -Wall ${sstrip_cflags} -o sstrip "${CT_SRC_DIR}/sstrip/sstrip.c"
yann@479
    36
yann@1856
    37
        CT_DoLog EXTRA "Installing sstrip"
yann@1856
    38
        CT_DoExecLog ALL install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip"
yann@479
    39
yann@2926
    40
        CT_Popd
yann@1856
    41
        CT_EndStep
yann@1856
    42
    }
yann@1856
    43
fi