From afbd17874a802b0903e47f0923ef520200c2baf6 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Fri, 29 May 2015 21:40:52 +0100 Subject: scripts: Update crosstool-NG internals for multiple compilers. This change updates the CC.* references to CC_GCC.* in the internal scripts. Signed-off-by: Ray Donnelly Reviewed-by: Bryan Hundven Reviewed-by: Yann Diorcet diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh index c7eb4c8..21f6472 100644 --- a/scripts/build/internals.sh +++ b/scripts/build/internals.sh @@ -28,33 +28,35 @@ do_finish() { CT_DoExecLog ALL "${CT_TARGET}-strip" ${strip_args} \ "${CT_TARGET}/debug-root/usr/bin/gdbserver" fi - # We can not use the version in CT_CC_VERSION because - # of the Linaro stuff. So, harvest the version string - # directly from the gcc sources... - # All gcc 4.x seem to have the version in gcc/BASE-VER - # while version prior to 4.x have the version in gcc/version.c - # Of course, here is not the better place to do that... - if [ -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then - gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ) - else - gcc_version=$( sed -r -e '/version_string/!d; s/^.+= "([^"]+)".*$/\1/;' \ - "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/version.c" \ - ) + if [ "${CT_CC_gcc}" = "y" ]; then + # We can not use the version in CT_CC_GCC_VERSION because + # of the Linaro stuff. So, harvest the version string + # directly from the gcc sources... + # All gcc 4.x seem to have the version in gcc/BASE-VER + # while version prior to 4.x have the version in gcc/version.c + # Of course, here is not the better place to do that... + if [ -f "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/BASE-VER" ]; then + gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/BASE-VER" ) + else + gcc_version=$( sed -r -e '/version_string/!d; s/^.+= "([^"]+)".*$/\1/;' \ + "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/version.c" \ + ) + fi + for _t in "bin/${CT_TARGET}-"* \ + "${CT_TARGET}/bin/"* \ + "libexec/gcc/${CT_TARGET}/${gcc_version}/"* \ + "libexec/gcc/${CT_TARGET}/${gcc_version}/install-tools/"* \ + ; do + _type="$( file "${_t}" |cut -d ' ' -f 2- )" + case "${_type}" in + *script*executable*) + ;; + *executable*) + CT_DoExecLog ALL ${CT_HOST}-strip ${strip_args} "${_t}" + ;; + esac + done fi - for _t in "bin/${CT_TARGET}-"* \ - "${CT_TARGET}/bin/"* \ - "libexec/gcc/${CT_TARGET}/${gcc_version}/"* \ - "libexec/gcc/${CT_TARGET}/${gcc_version}/install-tools/"* \ - ; do - _type="$( file "${_t}" |cut -d ' ' -f 2- )" - case "${_type}" in - *script*executable*) - ;; - *executable*) - CT_DoExecLog ALL ${CT_HOST}-strip ${strip_args} "${_t}" - ;; - esac - done CT_Popd fi diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index 78abd96..ab654da 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -165,8 +165,8 @@ CT_PREFIX_DIR="$( "${sed}" -r -e 's:/+:/:g; s:/*$::;' <<<"${CT_PREFIX_DIR}" )" # Put user-supplied flags at the end, so that they take precedence. CT_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_TARGET_CFLAGS}" CT_TARGET_LDFLAGS="${CT_ARCH_TARGET_LDFLAGS} ${CT_TARGET_LDFLAGS}" -CT_CC_CORE_EXTRA_CONFIG_ARRAY=( ${CT_ARCH_CC_CORE_EXTRA_CONFIG} "${CT_CC_CORE_EXTRA_CONFIG_ARRAY[@]}" ) -CT_CC_EXTRA_CONFIG_ARRAY=( ${CT_ARCH_CC_EXTRA_CONFIG} "${CT_CC_EXTRA_CONFIG_ARRAY[@]}" ) +CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=( ${CT_ARCH_CC_CORE_EXTRA_CONFIG} "${CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY[@]}" ) +CT_CC_GCC_EXTRA_CONFIG_ARRAY=( ${CT_ARCH_CC_EXTRA_CONFIG} "${CT_CC_GCC_EXTRA_CONFIG_ARRAY[@]}" ) # Compute the package version string CT_PKGVERSION="crosstool-NG ${CT_VERSION}${CT_TOOLCHAIN_PKGVERSION:+ - ${CT_TOOLCHAIN_PKGVERSION}}" @@ -548,8 +548,8 @@ if [ -z "${CT_RESTART}" ]; then CT_EndStep fi - if [ "${CT_CC_STATIC_LIBSTDCXX}" = "y" ]; then - CT_DoStep DEBUG "Checking that gcc can statically link libstdc++ (CT_CC_STATIC_LIBSTDCXX)" + if [ "${CT_CC_GCC_STATIC_LIBSTDCXX}" = "y" ]; then + CT_DoStep DEBUG "Checking that gcc can statically link libstdc++ (CT_CC_GCC_STATIC_LIBSTDCXX)" CT_DoLog DEBUG "You may need to ensure that libstdc++.a is installed on your system" CT_DoExecLog DEBUG "${CT_HOST}-gcc" ${CT_CFLAGS_FOR_HOST} ${CT_LDFLAGS_FOR_HOST} "${testc}" -static -lstdc++ -o "${gccout}" rm -f "${gccout}" -- cgit v0.10.2-6-g49f6