Skip to content

Commit

Permalink
Merge pull request #670 from stilor/cygwin-symlink
Browse files Browse the repository at this point in the history
Fix symlinking to multiarch tools on Cygwin
  • Loading branch information
stilor committed Apr 2, 2017
2 parents 88d28e6 + d6bf8e2 commit ba3d47b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
26 changes: 6 additions & 20 deletions scripts/build/binutils/binutils.sh
Expand Up @@ -82,7 +82,6 @@ do_binutils_for_build() {

# Build binutils for host -> target
do_binutils_for_host() {
local -a binutils_tools
local -a binutils_opts

CT_DoStep INFO "Installing binutils for host"
Expand Down Expand Up @@ -118,26 +117,13 @@ do_binutils_for_host() {
# are not executable on the build machine.
case "${CT_TOOLCHAIN_TYPE}" in
cross|native)
binutils_tools=( ar as ld ranlib strip )
if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
binutils_tools+=( elf2flt flthdr )
fi
case "${CT_BINUTILS_LINKERS_LIST}" in
ld) binutils_tools+=( ld.bfd ) ;;
gold) binutils_tools+=( ld.gold ) ;;
ld,gold) binutils_tools+=( ld.bfd ld.gold ) ;;
gold,ld) binutils_tools+=( ld.bfd ld.gold ) ;;
esac
mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin"
mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/bin"
for t in "${binutils_tools[@]}"; do
CT_DoExecLog ALL ln -sv \
"${CT_PREFIX_DIR}/${CT_TARGET}/bin/${t}" \
"${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
CT_DoExecLog ALL ln -sv \
"${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" \
"${CT_BUILDTOOLS_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
done
CT_SymlinkTools "${CT_BUILDTOOLS_PREFIX_DIR}/bin" \
"${CT_PREFIX_DIR}/bin" \
"${CT_TARGET}"
CT_DoExecLog ALL mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}"
CT_DoExecLog ALL ln -sv "${CT_PREFIX_DIR}/${CT_TARGET}/bin" \
"${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin"
;;
*) ;;
esac
Expand Down
6 changes: 5 additions & 1 deletion scripts/functions
Expand Up @@ -1784,7 +1784,11 @@ CT_SymlinkTools()

CT_Pushd "${srcdir}"
for t in "${CT_TARGET}-"*; do
if [ -n "${newpfx}" -a "${newpfx}" != "${CT_TARGET}" ]; then
if [ "${t}" = "${CT_TARGET}-*" ]; then
# No matching files
break
fi
if [ "${newpfx}" != "${CT_TARGET}" -o "${bindir}" != "${srcdir}" ]; then
_t="${newpfx}-${t#${CT_TARGET}-}"
CT_DoExecLog ALL ln -sfv "${dirpfx}${t}" "${bindir}/${_t}"
fi
Expand Down

0 comments on commit ba3d47b

Please sign in to comment.