Skip to content

Commit

Permalink
scripts: Update crosstool-NG internals for multiple compilers.
Browse files Browse the repository at this point in the history
This change updates the CC.* references to CC_GCC.* in the internal
scripts.

Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
Reviewed-by: Bryan Hundven <bryanhundven@gmail.com>
Reviewed-by: Yann Diorcet <diorcetyann@gmail.com>
  • Loading branch information
mingwandroid committed Jun 1, 2015
1 parent 9cdbc7b commit afbd178
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
54 changes: 28 additions & 26 deletions scripts/build/internals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions scripts/crosstool-NG.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit afbd178

Please sign in to comment.