diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/build/cc/gcc.sh | 8 | ||||
-rw-r--r-- | scripts/build/internals.sh | 4 | ||||
-rw-r--r-- | scripts/crosstool-NG.sh.in | 34 | ||||
-rw-r--r-- | scripts/saveSample.sh.in | 28 | ||||
-rwxr-xr-x | scripts/showSamples.sh | 24 |
5 files changed, 65 insertions, 33 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index 15dc5a55..e1f5d25c 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -41,6 +41,10 @@ do_cc_extract() { #------------------------------------------------------------------------------ # Core gcc pass 1 do_cc_core_pass_1() { + # If we're building a canadian compiler no use to build the CC + # core compiler, we're not using it + [ -n "${CT_CANADIAN}" ] && return 0 + # If we're building for bare metal, build the static core gcc, # with libgcc. # In case we're not bare metal, and we're NPTL, build the static core gcc. @@ -54,6 +58,10 @@ do_cc_core_pass_1() { # Core gcc pass 2 do_cc_core_pass_2() { + # If we're building a canadian compiler no use to build the CC + # core compiler, we're not using it + [ -n "${CT_CANADIAN}" ] && return 0 + # In case we're building for bare metal, do nothing, we already have # our compiler. # In case we're NPTL, build the shared core gcc and the target libgcc. diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh index 8a887bf4..a920c502 100644 --- a/scripts/build/internals.sh +++ b/scripts/build/internals.sh @@ -9,9 +9,7 @@ do_finish() { CT_DoStep INFO "Cleaning-up the toolchain's directory" CT_DoLog EXTRA "Removing access to the build system tools" - find "${CT_PREFIX_DIR}/bin" -name "${CT_BUILD}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG - find "${CT_PREFIX_DIR}/bin" -name "${CT_HOST}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG - CT_DoExecLog DEBUG rm -fv "${CT_PREFIX_DIR}/bin/makeinfo" + CT_DoExecLog DEBUG rm -rf "${CT_PREFIX_DIR}/buildtools" if [ "${CT_BARE_METAL}" != "y" ]; then CT_DoLog EXTRA "Installing the populate helper" diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index 2d893a3d..36c77bac 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -223,8 +223,10 @@ CT_DoExecLog ALL mkdir -p "${CT_BUILD_DIR}" 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_CC_CORE_STATIC_PREFIX_DIR}" -CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}" +if [ -z "${CT_CANADIAN}" ]; then + CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}" + CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}" +fi # 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}" @@ -320,9 +322,18 @@ if [ -z "${CT_RESTART}" ]; then # Prepare mangling patterns to later modify BUILD and HOST (see below) case "${CT_TOOLCHAIN_TYPE}" in cross) + # A cross-compiler runs on the same machine it is built on CT_HOST="${CT_BUILD}" build_mangle="build_" host_mangle="build_" + target_mangle="" + install_build_tools_for="BUILD HOST" + ;; + canadian) + build_mangle="build_" + host_mangle="host_" + target_mangle="" + install_build_tools_for="BUILD HOST TARGET" ;; *) CT_Abort "No code for '${CT_TOOLCHAIN_TYPE}' toolchain type!" ;; @@ -331,11 +342,13 @@ if [ -z "${CT_RESTART}" ]; then # Save the real tuples to generate shell-wrappers to the real tools CT_REAL_BUILD="${CT_BUILD}" CT_REAL_HOST="${CT_HOST}" + CT_REAL_TARGET="${CT_TARGET}" # Canonicalise CT_BUILD and CT_HOST # Not only will it give us full-qualified tuples, but it will also ensure # that they are valid tuples (in case of typo with user-provided tuples) # That's way better than trying to rewrite config.sub ourselves... + # CT_TARGET is already made canonical in CT_DoBuildTargetTuple CT_BUILD=$(CT_DoConfigSub "${CT_BUILD}") CT_HOST=$(CT_DoConfigSub "${CT_HOST}") @@ -345,12 +358,13 @@ if [ -z "${CT_RESTART}" ]; then # support canadain build, later... CT_BUILD="${CT_BUILD/-/-${build_mangle}}" CT_HOST="${CT_HOST/-/-${host_mangle}}" + CT_TARGET="${CT_TARGET/-/-${target_mangle}}" # Now we have mangled our BUILD and HOST tuples, we must fake the new # cross-tools for those mangled tuples. CT_DoLog DEBUG "Making build system tools available" - CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/bin" - for m in BUILD HOST; do + CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/buildtools" + for m in ${install_build_tools_for}; do r="CT_REAL_${m}" v="CT_${m}" p="CT_${m}_PREFIX" @@ -386,8 +400,8 @@ if [ -z "${CT_RESTART}" ]; then # bally needed if [ -n "${where}" ]; then CT_DoLog DEBUG " '${!v}-${tool}' -> '${where}'" - printf "#${BANG}${CT_SHELL}\nexec '${where}' \"\${@}\"\n" >"${CT_PREFIX_DIR}/bin/${!v}-${tool}" - CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/bin/${!v}-${tool}" + printf "#${BANG}${CT_SHELL}\nexec '${where}' \"\${@}\"\n" >"${CT_PREFIX_DIR}/buildtools/${!v}-${tool}" + CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/buildtools/${!v}-${tool}" else case "${tool}" in # We'll at least need some of them... @@ -417,7 +431,8 @@ if [ -z "${CT_RESTART}" ]; then # Of course, neither cross-native nor canadian can run on BUILD, # so don't add those PATHs in this case... case "${CT_TOOLCHAIN_TYPE}" in - cross) export PATH="${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}";; + cross) export PATH="${CT_PREFIX_DIR}/buildtools:${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}";; + canadian) export PATH="${CT_PREFIX_DIR}/buildtools:${PATH}";; *) ;; esac @@ -425,8 +440,8 @@ if [ -z "${CT_RESTART}" ]; then # Go ahead with those, by creating a wrapper that keeps partial files, and that # never fails: CT_DoLog DEBUG " 'makeinfo' -> '$(CT_Which makeinfo)'" - printf "#${BANG}${CT_SHELL}\n$(CT_Which makeinfo) --force \"\${@}\"\ntrue\n" >"${CT_PREFIX_DIR}/bin/makeinfo" - CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/bin/makeinfo" + printf "#${BANG}${CT_SHELL}\n$(CT_Which makeinfo) --force \"\${@}\"\ntrue\n" >"${CT_PREFIX_DIR}/buildtools/makeinfo" + CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/buildtools/makeinfo" # Help gcc CT_CFLAGS_FOR_HOST= @@ -446,6 +461,7 @@ if [ -z "${CT_RESTART}" ]; then export PARALLELMFLAGS CT_DoLog EXTRA "Installing user-supplied crosstool-NG configuration" + CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/bin" CT_DoExecLog DEBUG install -m 0755 "${CT_LIB_DIR}/scripts/toolchain-config.in" "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config" CT_DoExecLog DEBUG sed -r -i -e 's,@@grep@@,"'"${grep}"'",;' "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config" bzip2 -c -9 .config >>"${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config" diff --git a/scripts/saveSample.sh.in b/scripts/saveSample.sh.in index 6b3f2055..4ef71ce2 100644 --- a/scripts/saveSample.sh.in +++ b/scripts/saveSample.sh.in @@ -59,18 +59,22 @@ unset CT_LOG_PROGRESS_BAR CT_LOG_ERROR CT_LOG_INFO CT_LOG_EXTRA CT_LOG_DEBUG LOG CT_LOG_WARN=y CT_LOG_LEVEL_MAX="WARN" -# Create the sample directory -if [ ! -d "samples/${CT_TARGET}" ]; then - mkdir -p "samples/${CT_TARGET}" -fi +# Compute the name of the sample directory +case "${CT_TOOLCHAIN_TYPE}" in + cross) samp_name="${CT_TARGET}";; + canadian) samp_name="${CT_HOST},${CT_TARGET}";; + *) CT_Abort "Unsupported toolchain type '${CT_TOOLCHAIN_TYPE}'";; +esac +samp_dir="samples/${samp_name}" +mkdir -p "${samp_dir}" # Save the crosstool-NG config file -"${sed}" -r -e 's|^(CT_PREFIX_DIR)=.*|\1="${HOME}/x-tools/${CT_TARGET}"|;' \ +"${sed}" -r -e 's|^(CT_PREFIX_DIR)=.*|\1="${HOME}/x-tools/${samp_name}"|;' \ -e 's|^# CT_LOG_TO_FILE is not set$|CT_LOG_TO_FILE=y|;' \ -e 's|^# CT_LOG_FILE_COMPRESS is not set$|CT_LOG_FILE_COMPRESS=y|;' \ -e 's|^(CT_LOCAL_TARBALLS_DIR)=.*|\1="${HOME}/src"|;' \ <.config \ - >"samples/${CT_TARGET}/crosstool.config" + >"${samp_dir}/crosstool.config" # Function to copy a file to the sample directory # Needed in case the file is already there (think of a previously available sample) @@ -94,12 +98,12 @@ fi # Save the uClibc .config file if [ -n "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then # We save the file, and then point the saved sample to this file - CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config" - "${sed}" -r -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE)=.+$|\1="'"${samp_top_dir}"'/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"|;' \ - "samples/${CT_TARGET}/crosstool.config" + CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${samp_dir}/${CT_LIBC}-${CT_LIBC_VERSION}.config" + "${sed}" -r -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE)=.+$|\1="'"${samp_top_dir}"'/${samp_dir}/${CT_LIBC}-${CT_LIBC_VERSION}.config"|;' \ + "${samp_dir}/crosstool.config" else # remove any dangling files - for f in "samples/${CT_TARGET}/${CT_LIBC}-"*.config; do + for f in "${samp_dir}/${CT_LIBC}-"*.config; do if [ -f "${f}" ]; then rm -f "${f}"; fi done fi @@ -108,7 +112,7 @@ fi exec >&7 # Fill-in the reported-by info -[ -f "samples/${CT_TARGET}/reported.by" ] && . "samples/${CT_TARGET}/reported.by" +[ -f "${samp_dir}/reported.by" ] && . "${samp_dir}/reported.by" old_name="${reporter_name}" old_url="${reporter_url}" read -p "Reporter name [${reporter_name}]: " reporter_name @@ -123,4 +127,4 @@ reporter_comment=$(cat) ( echo "reporter_name=\"${reporter_name:=${old_name}}\"" echo "reporter_url=\"${reporter_url:=${old_url}}\"" printf "reporter_comment=\"${reporter_comment}\"\n" -) >"samples/${CT_TARGET}/reported.by" +) >"${samp_dir}/reported.by" diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh index f06a1838..e952d644 100755 --- a/scripts/showSamples.sh +++ b/scripts/showSamples.sh @@ -34,6 +34,12 @@ dump_single_sample() { [ "${CT_EXPERIMENTAL}" = "y" ] && printf "X" || printf " " echo "]" if [ ${verbose} -ne 0 ]; then + case "${CT_TOOLCHAIN_TYPE}" in + cross) ;; + canadian) + printf " Host : ${CT_HOST}\n" + ;; + esac echo " OS : ${CT_KERNEL}${CT_KERNEL_VERSION:+-}${CT_KERNEL_VERSION}" if [ "${CT_GMP_MPFR}" = "y" ]; then echo " GMP/MPFR : gmp-${CT_GMP_VERSION} / mpfr-${CT_MPFR_VERSION}" @@ -64,8 +70,13 @@ dump_single_sample() { printf "| " [ "${CT_EXPERIMENTAL}" = "y" ] && printf "X" [ -f "${sample_top}/samples/${sample}/broken" ] && printf "B" - printf ' ' - printf "| ''${CT_KERNEL}'' |" + printf ' | ' + case "${CT_TOOLCHAIN_TYPE}" in + cross) ;; + canadian) printf "${CT_HOST}";; + *) ;; + esac + printf " | ''${CT_KERNEL}'' |" if [ "${CT_KERNEL}" != "bare-metal" ];then if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" = "y" ]; then printf " //custom// " @@ -102,13 +113,7 @@ dump_single_sample() { printf "| [[http://ymorin.is-a-geek.org/|YEM]] " fi ) - sample_updated=$(date -u "+%Y%m%d" \ - -d "$(LC_ALL=C svn info ${sample_top}/samples/${sample} \ - |GREP_OPTIONS= "${grep}" -E '^Last Changed Date:' \ - |"${sed}" -r -e 's/^[^:]+: //;' \ - -e 's/^(.+:.. [+-][[:digit:]]{4}) \(.+\)$/\1/;' \ - )" \ - ) + sample_updated="$( hg log -l 1 --template '{date|shortdate}' "${sample_top}/samples/${sample}" )" printf "| ${sample_updated} " echo "|" fi @@ -124,6 +129,7 @@ if [ "${opt}" = -w ]; then echo "^ @@DATE@@ ^ |||||||||||||" printf "^ Target " printf "^ Status " + printf "^ Host " printf "^ Kernel headers\\\\\\\\ version ^" printf "^ binutils\\\\\\\\ version " printf "^ C compiler\\\\\\\\ version ^" |