From 2f718dd60c19a5d671e7fbef00c67c05ef98c9f4 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Mon, 25 Jul 2011 19:04:17 +0200 Subject: [PATCH] complibs: fixup the host complibs install dir It's easier to have as much as possible stuff in the same place to ease backup/restore, and make things easier to follow. Move the host companion libraries install dir as a sub-dir of the build-tools install dir (but not directly in it, it would break for canadian or cross-native). Signed-off-by: "Yann E. MORIN" --- scripts/build/cc/gcc.sh | 6 +++--- scripts/build/companion_libs/cloog.sh | 2 +- scripts/build/companion_libs/gmp.sh | 2 +- scripts/build/companion_libs/libelf.sh | 2 +- scripts/build/companion_libs/mpc.sh | 2 +- scripts/build/companion_libs/mpfr.sh | 2 +- scripts/build/companion_libs/ppl.sh | 2 +- scripts/crosstool-NG.sh.in | 15 +++++++++++++-- scripts/functions | 2 -- 9 files changed, 22 insertions(+), 13 deletions(-) diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index d1bb2749..b56b49cc 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -68,7 +68,7 @@ do_cc_core_pass_1() { do_core=y core_opts+=( "mode=static" ) core_opts+=( "host=${CT_BUILD}" ) - core_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) + core_opts+=( "complibs=${CT_BUILDTOOLS_PREFIX_DIR}" ) core_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" ) core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) ;; @@ -93,7 +93,7 @@ do_cc_core_pass_2() { # Common options: core_opts+=( "host=${CT_BUILD}" ) core_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" ) - core_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) + core_opts+=( "complibs=${CT_BUILDTOOLS_PREFIX_DIR}" ) core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) # Do nothing for canadian-crosses, we already have a target compiler. @@ -469,7 +469,7 @@ do_cc() { final_opts+=( "host=${CT_HOST}" ) final_opts+=( "prefix=${CT_PREFIX_DIR}" ) - final_opts+=( "complibs=${CT_COMPLIBS_DIR}" ) + final_opts+=( "complibs=${CT_HOST_COMPLIBS_DIR}" ) final_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) if [ "${CT_BUILD_MANUALS}" = "y" ]; then final_opts+=( "build_manuals=yes" ) diff --git a/scripts/build/companion_libs/cloog.sh b/scripts/build/companion_libs/cloog.sh index 5c2b421f..f83aa246 100644 --- a/scripts/build/companion_libs/cloog.sh +++ b/scripts/build/companion_libs/cloog.sh @@ -64,7 +64,7 @@ do_cloog_for_host() { CT_mkdir_pushd "${CT_BUILD_DIR}/build-cloog-ppl-host-${CT_HOST}" cloog_opts+=( "host=${CT_HOST}" ) - cloog_opts+=( "prefix=${CT_COMPLIBS_DIR}" ) + cloog_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" ) cloog_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) do_cloog_backend "${cloog_opts[@]}" diff --git a/scripts/build/companion_libs/gmp.sh b/scripts/build/companion_libs/gmp.sh index 04af002c..ebc095b6 100644 --- a/scripts/build/companion_libs/gmp.sh +++ b/scripts/build/companion_libs/gmp.sh @@ -51,7 +51,7 @@ do_gmp_for_host() { CT_mkdir_pushd "${CT_BUILD_DIR}/build-gmp-host-${CT_HOST}" gmp_opts+=( "host=${CT_HOST}" ) - gmp_opts+=( "prefix=${CT_COMPLIBS_DIR}" ) + gmp_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" ) gmp_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) do_gmp_backend "${gmp_opts[@]}" diff --git a/scripts/build/companion_libs/libelf.sh b/scripts/build/companion_libs/libelf.sh index c10a7bf3..e7b140b7 100644 --- a/scripts/build/companion_libs/libelf.sh +++ b/scripts/build/companion_libs/libelf.sh @@ -52,7 +52,7 @@ do_libelf_for_host() { CT_mkdir_pushd "${CT_BUILD_DIR}/build-libelf-host-${CT_HOST}" libelf_opts+=( "host=${CT_HOST}" ) - libelf_opts+=( "prefix=${CT_COMPLIBS_DIR}" ) + libelf_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" ) libelf_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) do_libelf_backend "${libelf_opts[@]}" diff --git a/scripts/build/companion_libs/mpc.sh b/scripts/build/companion_libs/mpc.sh index f45982dc..b035f4dd 100644 --- a/scripts/build/companion_libs/mpc.sh +++ b/scripts/build/companion_libs/mpc.sh @@ -52,7 +52,7 @@ do_mpc_for_host() { CT_mkdir_pushd "${CT_BUILD_DIR}/build-mpc-host-${CT_HOST}" mpc_opts+=( "host=${CT_HOST}" ) - mpc_opts+=( "prefix=${CT_COMPLIBS_DIR}" ) + mpc_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" ) mpc_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) do_mpc_backend "${mpc_opts[@]}" diff --git a/scripts/build/companion_libs/mpfr.sh b/scripts/build/companion_libs/mpfr.sh index b3467577..35a48491 100644 --- a/scripts/build/companion_libs/mpfr.sh +++ b/scripts/build/companion_libs/mpfr.sh @@ -94,7 +94,7 @@ do_mpfr_for_host() { CT_mkdir_pushd "${CT_BUILD_DIR}/build-mpfr-host-${CT_HOST}" mpfr_opts+=( "host=${CT_HOST}" ) - mpfr_opts+=( "prefix=${CT_COMPLIBS_DIR}" ) + mpfr_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" ) mpfr_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) do_mpfr_backend "${mpfr_opts[@]}" diff --git a/scripts/build/companion_libs/ppl.sh b/scripts/build/companion_libs/ppl.sh index da7fb1a5..90dcad36 100644 --- a/scripts/build/companion_libs/ppl.sh +++ b/scripts/build/companion_libs/ppl.sh @@ -54,7 +54,7 @@ do_ppl_for_host() { CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-host-${CT_HOST}" ppl_opts+=( "host=${CT_HOST}" ) - ppl_opts+=( "prefix=${CT_COMPLIBS_DIR}" ) + ppl_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" ) ppl_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) do_ppl_backend "${ppl_opts[@]}" diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index 7f18ae1a..c6834171 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -157,7 +157,18 @@ CT_BUILD_DIR="${CT_WORK_DIR}/${CT_TARGET}/build" CT_BUILDTOOLS_PREFIX_DIR="${CT_WORK_DIR}/${CT_TARGET}/buildtools" CT_STATE_DIR="${CT_WORK_DIR}/${CT_TARGET}/state" CT_CONFIG_DIR="${CT_BUILD_DIR}/configs" -CT_COMPLIBS_DIR="${CT_BUILD_DIR}/static" +# Note about HOST_COMPLIBS_DIR: it's always gonna be in the buildtools dir, or a +# sub-dir. So we won't have to save/restore it, not even create it. +# In case of cross or native, host-complibs are used for build-complibs; +# in case of canadian or cross-native, host-complibs are specific +case "${CT_TOOLCHAIN_TYPE}" in + native|cross) + CT_HOST_COMPLIBS_DIR="${CT_BUILDTOOLS_PREFIX_DIR}" + ;; + canadian|cross-native) + CT_HOST_COMPLIBS_DIR="${CT_BUILDTOOLS_PREFIX_DIR}/complibs-host" + ;; +esac # Compute test suite install directory CT_TEST_SUITE_DIR=${CT_INSTALL_DIR}/test-suite @@ -233,7 +244,7 @@ CT_DoExecLog ALL mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/bin" CT_DoExecLog ALL mkdir -p "${CT_CONFIG_DIR}" CT_DoExecLog ALL mkdir -p "${CT_INSTALL_DIR}" CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}" -CT_DoExecLog ALL mkdir -p "${CT_COMPLIBS_DIR}" +CT_DoExecLog ALL mkdir -p "${CT_HOST_COMPLIBS_DIR}" # Only create the state dir if asked for a restartable build [ -n "${CT_DEBUG_CT_SAVE_STEPS}" ] && CT_DoExecLog ALL mkdir -p "${CT_STATE_DIR}" diff --git a/scripts/functions b/scripts/functions index ad891940..4e236669 100644 --- a/scripts/functions +++ b/scripts/functions @@ -1146,7 +1146,6 @@ CT_DoSaveState() { /^(FUNCNAME|GROUPS|PPID|SHELLOPTS)=/d;' >"${state_dir}/env.sh" CT_DoTarballIfExists "${CT_BUILDTOOLS_PREFIX_DIR}" "${state_dir}/buildtools_dir" - CT_DoTarballIfExists "${CT_COMPLIBS_DIR}" "${state_dir}/complibs_dir" CT_DoTarballIfExists "${CT_CONFIG_DIR}" "${state_dir}/config_dir" CT_DoTarballIfExists "${CT_PREFIX_DIR}" "${state_dir}/prefix_dir" --exclude '*.log' @@ -1179,7 +1178,6 @@ CT_DoLoadState(){ CT_DoExtractTarballIfExists "${state_dir}/prefix_dir" "${CT_PREFIX_DIR}" CT_DoExtractTarballIfExists "${state_dir}/config_dir" "${CT_CONFIG_DIR}" - CT_DoExtractTarballIfExists "${state_dir}/complibs_dir" "${CT_COMPLIBS_DIR}" CT_DoExtractTarballIfExists "${state_dir}/buildtools_dir" "${CT_BUILDTOOLS_PREFIX_DIR}" # Restore the environment, discarding any error message