From fbeb2255650c9493598f00e6acd2f6de002d046d Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Thu, 7 Jan 2016 18:54:35 +0100 Subject: ptxdist: use all tools via wrapper link --- bin/ptxdist | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'bin/ptxdist') diff --git a/bin/ptxdist b/bin/ptxdist index a5eb5e257..21eb49fe8 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -744,9 +744,10 @@ check_compiler() { } local compiler_ver_should + toolchain="$(readlink -f "${PTXDIST_TOOLCHAIN}")" compiler_ver_should="$(ptxd_get_ptxconf PTXCONF_CROSSCHAIN_CHECK)" && { local compiler="${compiler_prefix}gcc" - local compiler_ver_is="$(${compiler} -dumpversion 2> /dev/null || true)" + local compiler_ver_is="$(${toolchain}/${compiler} -dumpversion 2> /dev/null || true)" if [ -z "${compiler_ver_is}" ]; then echo @@ -765,14 +766,16 @@ check_compiler() { fi } - toolchain="$(readlink -f "${PTXDIST_TOOLCHAIN}")" ptxd_replace_link "${toolchain}" "${PTXDIST_PLATFORMDIR}/selected_toolchain" && for cc in gcc g++ cpp ld; do - ptxd_replace_link "$(which ${compiler_prefix}${cc})" "${wrapper_dir}/real/${compiler_prefix}${cc}" && + ptxd_replace_link "${toolchain}/${compiler_prefix}${cc}" "${wrapper_dir}/real/${compiler_prefix}${cc}" && ptxd_replace_link "${SCRIPTSDIR}/wrapper/${cc}-wrapper" "${wrapper_dir}/${compiler_prefix}${cc}" done && - for tool in ar as nm objcopy objdump ranlib readelf size strip ; do - ptxd_replace_link "$(which ${compiler_prefix}${tool})" "${wrapper_dir}/${compiler_prefix}${tool}" + for tool in "${toolchain}/${compiler_prefix}"* ; do + local toolname="$(basename "${tool}")" + if [ ! -e "${wrapper_dir}/${toolname}" ]; then + ptxd_replace_link "${tool}" "${wrapper_dir}/${toolname}" + fi done && PATH="${wrapper_dir}:${PATH}" && check_compiler_icecc -- cgit v1.2.3