scripts/build/internals.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Jun 11 21:47:19 2009 +0000 (2009-06-11)
branch1.4
changeset 1451 25d050084e98
parent 1281 12a2991fcffb
child 1401 604c5c80e24a
permissions -rw-r--r--
populate: fix installing dynamic linker 'ld.so'

The dynamic linker, ld.so, needs the execute bit to be set.
Detect tht the library being installed is in fact ld.so and
install it with 0755 instead of 0644.

Fix detecting src == dst.

Use a simpler command to copy src -> dst.

Also change echo to printf, get rid of 'echo -n', which is
highly non-portable.


-------- diffstat follows --------
/trunk/scripts/populate.in | 76 43 33 0 +++++++++++++++++++++++++++++-----------------------
1 file changed, 43 insertions(+), 33 deletions(-)
(transplanted from d7ddcb75e0f703e2ba6d17169167356389224870)
yann@1225
     1
# This file contains crosstool-NG internal steps
yann@1225
     2
yann@1225
     3
# This step is called once all components were built, to remove
yann@1225
     4
# un-wanted files, to add tuple aliases, and to add the final
yann@1225
     5
# crosstool-NG-provided files.
yann@1225
     6
do_finish() {
yann@1225
     7
    CT_DoStep INFO "Cleaning-up the toolchain's directory"
yann@1225
     8
yann@1225
     9
    CT_DoLog EXTRA "Removing access to the build system tools"
yann@1225
    10
    find "${CT_PREFIX_DIR}/bin" -name "${CT_BUILD}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
yann@1225
    11
    find "${CT_PREFIX_DIR}/bin" -name "${CT_HOST}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
yann@1225
    12
    CT_DoExecLog DEBUG rm -fv "${CT_PREFIX_DIR}/bin/makeinfo"
yann@1225
    13
yann@1225
    14
    if [ "${CT_BARE_METAL}" != "y" ]; then
yann@1225
    15
        CT_DoLog EXTRA "Installing the populate helper"
yann@1225
    16
        sed -r -e 's|@@CT_TARGET@@|'"${CT_TARGET}"'|g;' \
yann@1225
    17
               -e 's|@@CT_install@@|'"${install}"'|g;'  \
yann@1225
    18
               -e 's|@@CT_bash@@|'"${bash}"'|g;'        \
yann@1225
    19
               -e 's|@@CT_grep@@|'"${grep}"'|g;'        \
yann@1225
    20
               -e 's|@@CT_make@@|'"${make}"'|g;'        \
yann@1225
    21
               -e 's|@@CT_sed@@|'"${sed}"'|g;'          \
yann@1225
    22
               "${CT_LIB_DIR}/scripts/populate.in"      \
yann@1225
    23
               >"${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
yann@1225
    24
        CT_DoExecLog ALL chmod 755 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
yann@1225
    25
    fi
yann@1225
    26
yann@1225
    27
    # Create the aliases to the target tools
yann@1225
    28
    CT_DoLog EXTRA "Creating toolchain aliases"
yann@1225
    29
    CT_Pushd "${CT_PREFIX_DIR}/bin"
yann@1225
    30
    for t in "${CT_TARGET}-"*; do
yann@1225
    31
        if [ -n "${CT_TARGET_ALIAS}" ]; then
yann@1225
    32
            _t=$(echo "$t" |sed -r -e 's/^'"${CT_TARGET}"'-/'"${CT_TARGET_ALIAS}"'-/;')
yann@1225
    33
            CT_DoExecLog ALL ln -sv "${t}" "${_t}"
yann@1225
    34
        fi
yann@1225
    35
        if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then
yann@1225
    36
            _t=$(echo "$t" |sed -r -e "${CT_TARGET_ALIAS_SED_EXPR}")
yann@1225
    37
            CT_DoExecLog ALL ln -sv "${t}" "${_t}"
yann@1225
    38
        fi
yann@1225
    39
    done
yann@1225
    40
    CT_Popd
yann@1225
    41
yann@1225
    42
    # Remove the generated documentation files
yann@1225
    43
    if [ "${CT_REMOVE_DOCS}" = "y" ]; then
yann@1225
    44
        CT_DoLog EXTRA "Removing installed documentation"
yann@1225
    45
        CT_DoForceRmdir "${CT_PREFIX_DIR}/"{,usr/}{man,info}
yann@1225
    46
        CT_DoForceRmdir "${CT_SYSROOT_DIR}/"{,usr/}{man,info}
yann@1225
    47
        CT_DoForceRmdir "${CT_DEBUGROOT_DIR}/"{,usr/}{man,info}
yann@1225
    48
    fi
yann@1225
    49
yann@1225
    50
    CT_EndStep
yann@1225
    51
}