diff options
author | Alexey Neyman <stilor@att.net> | 2017-03-12 23:01:23 -0700 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2017-03-13 01:08:13 -0700 |
commit | 11b52ab6d7aef83f624dccc81e0b479c5155fe31 (patch) | |
tree | d733452d526801596917ceb6958c51ae63ae56ac /scripts/build/internals.sh | |
parent | b090e0f74d1ca0c0c45ec416c139f709a8e28f61 (diff) | |
download | crosstool-ng-11b52ab6d7aef83f624dccc81e0b479c5155fe31.tar.gz crosstool-ng-11b52ab6d7aef83f624dccc81e0b479c5155fe31.tar.bz2 crosstool-ng-11b52ab6d7aef83f624dccc81e0b479c5155fe31.zip |
Create ld.so.conf
Also a fix for CT_IterateMultilibs: it didn't pass multi_os_dir_gcc, so
it only worked if the caller did *not* declare it as a local variable.
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/build/internals.sh')
-rw-r--r-- | scripts/build/internals.sh | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh index 7d91d781..a1c9b555 100644 --- a/scripts/build/internals.sh +++ b/scripts/build/internals.sh @@ -1,5 +1,27 @@ # This file contains crosstool-NG internal steps +create_ldso_conf() +{ + local multi_dir multi_os_dir multi_os_dir_gcc multi_root multi_flags multi_index multi_count multi_target + local b d + + for arg in "$@"; do + eval "${arg// /\\ }" + done + + CT_DoExecLog ALL mkdir -p "${multi_root}/etc" + for b in /lib /usr/lib /usr/local/lib; do + d="${b}/${multi_os_dir}" + CT_SanitizeVarDir d + echo "${d}" >> "${multi_root}/etc/ld.so.conf" + if [ "${multi_os_dir}" != "${multi_os_dir_gcc}" ]; then + d="${b}/${multi_os_dir_gcc}" + CT_SanitizeVarDir d + echo "${d}" >> "${multi_root}/etc/ld.so.conf" + fi + done +} + # This step is called once all components were built, to remove # un-wanted files, to add tuple aliases, and to add the final # crosstool-NG-provided files. @@ -10,7 +32,14 @@ do_finish() { local gcc_version local exe_suffix - CT_DoStep INFO "Cleaning-up the toolchain's directory" + CT_DoStep INFO "Finalizing the toolchain's directory" + + if [ "${CT_SHARED_LIBS}" = "y" ]; then + # Create /etc/ld.so.conf + CT_mkdir_pushd "${CT_BUILD_DIR}/build-create-ldso" + CT_IterateMultilibs create_ldso_conf create-ldso + CT_Popd + fi if [ "${CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES}" = "y" ]; then case "$CT_HOST" in |