Skip to content

Commit

Permalink
Partially revert 6f8e89c.
Browse files Browse the repository at this point in the history
The referenced commit replaced 'make' with '${make}' everywhere. This is
wrong for at least the utilities that we may build as companion tools
(make, libtool): this will always invoke the version detected by configure
by supplying the absolute path. In other words, the wrappers in
.build/tools/bin are not fallbacks - they are either temporary (in case
a respective companion tool is built) or permanent redirectors.

This is the reason why the PATH= has .build/*/buildtools/bin at higher
precedence than .build/tools/bin; the latter has the versions detected by
configure and the former has the versions built as companion tools.

Revert the rest of the gang (grep/sed/...) for consistency. After all,
we may decide to supply some of them as well (awk, for instance).

Signed-off-by: Alexey Neyman <stilor@att.net>
  • Loading branch information
stilor committed Nov 21, 2016
1 parent 6cb9e62 commit 488b27f
Show file tree
Hide file tree
Showing 34 changed files with 186 additions and 186 deletions.
2 changes: 1 addition & 1 deletion scripts/build/arch.sh
Expand Up @@ -23,7 +23,7 @@ CT_DoArchUClibcSelectArch() {
local cfg="${1}"
local arch="${2}"

${sed} -i -r -e '/^TARGET_.*/d' "${cfg}"
sed -i -r -e '/^TARGET_.*/d' "${cfg}"
CT_KconfigEnableOption "TARGET_${arch}" "${cfg}"
CT_KconfigSetOption "TARGET_ARCH" "${arch}" "${cfg}"
}
Expand Down
24 changes: 12 additions & 12 deletions scripts/build/binutils/binutils.sh
Expand Up @@ -8,8 +8,8 @@ do_binutils_get() {
CT_GetCustom "binutils" "${CT_BINUTILS_CUSTOM_VERSION}" \
"${CT_BINUTILS_CUSTOM_LOCATION}"
else
if echo ${CT_BINUTILS_VERSION} |${grep} -q linaro; then
YYMM=`echo ${CT_BINUTILS_VERSION} |cut -d- -f3 |${sed} -e 's,^..,,'`
if echo ${CT_BINUTILS_VERSION} |grep -q linaro; then
YYMM=`echo ${CT_BINUTILS_VERSION} |cut -d- -f3 |sed -e 's,^..,,'`
CT_GetFile "binutils-${CT_BINUTILS_VERSION}" \
https://releases.linaro.org/${YYMM}/components/toolchain/binutils-linaro \
http://cbuild.validation.linaro.org/snapshots
Expand Down Expand Up @@ -230,14 +230,14 @@ do_binutils_backend() {
if [ "${static_build}" = "y" ]; then
extra_make_flags+=("LDFLAGS=${ldflags} -all-static")
CT_DoLog EXTRA "Prepare binutils for static build"
CT_DoExecLog ALL ${make} ${JOBSFLAGS} configure-host
CT_DoExecLog ALL make ${JOBSFLAGS} configure-host
fi

CT_DoLog EXTRA "Building binutils"
CT_DoExecLog ALL ${make} "${extra_make_flags[@]}" ${JOBSFLAGS}
CT_DoExecLog ALL make "${extra_make_flags[@]}" ${JOBSFLAGS}

CT_DoLog EXTRA "Installing binutils"
CT_DoExecLog ALL ${make} install
CT_DoExecLog ALL make install

if [ "${build_manuals}" = "y" ]; then
CT_DoLog EXTRA "Building and installing the binutils manuals"
Expand All @@ -247,16 +247,16 @@ do_binutils_backend() {
fi
manuals_install=( "${manuals_for[@]/\#/install-pdf-}" )
manuals_install+=( "${manuals_for[@]/\#/install-html-}" )
CT_DoExecLog ALL ${make} ${JOBSFLAGS} pdf html
CT_DoExecLog ALL ${make} "${manuals_install[@]}"
CT_DoExecLog ALL make ${JOBSFLAGS} pdf html
CT_DoExecLog ALL make "${manuals_install[@]}"
fi

# Install the wrapper if needed
if [ "${CT_BINUTILS_LD_WRAPPER}" = "y" ]; then
CT_DoLog EXTRA "Installing ld wrapper"
rm -f "${prefix}/bin/${CT_TARGET}-ld"
rm -f "${prefix}/${CT_TARGET}/bin/ld"
${sed} -r -e "s/@@DEFAULT_LD@@/${CT_BINUTILS_LINKER_DEFAULT}/" \
sed -r -e "s/@@DEFAULT_LD@@/${CT_BINUTILS_LINKER_DEFAULT}/" \
"${CT_LIB_DIR}/scripts/build/binutils/binutils-ld.in" \
>"${prefix}/bin/${CT_TARGET}-ld"
chmod +x "${prefix}/bin/${CT_TARGET}-ld"
Expand Down Expand Up @@ -314,10 +314,10 @@ do_elf2flt_backend() {
"${CT_ELF2FLT_EXTRA_CONFIG_ARRAY[@]}"

CT_DoLog EXTRA "Building elf2flt"
CT_DoExecLog ALL ${make} ${JOBSFLAGS}
CT_DoExecLog ALL make ${JOBSFLAGS}

CT_DoLog EXTRA "Installing elf2flt"
CT_DoExecLog ALL ${make} install
CT_DoExecLog ALL make install
}

# Now on for the target libraries
Expand Down Expand Up @@ -372,9 +372,9 @@ do_binutils_for_target() {
"${CT_BINUTILS_EXTRA_CONFIG_ARRAY[@]}"

CT_DoLog EXTRA "Building binutils' libraries (${targets[*]}) for target"
CT_DoExecLog ALL ${make} ${JOBSFLAGS} "${build_targets[@]}"
CT_DoExecLog ALL make ${JOBSFLAGS} "${build_targets[@]}"
CT_DoLog EXTRA "Installing binutils' libraries (${targets[*]}) for target"
CT_DoExecLog ALL ${make} DESTDIR="${CT_SYSROOT_DIR}" "${install_targets[@]}"
CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" "${install_targets[@]}"

CT_Popd
CT_EndStep
Expand Down
54 changes: 27 additions & 27 deletions scripts/build/cc/100-gcc.sh
Expand Up @@ -13,10 +13,10 @@ do_gcc_get() {
else
# Account for the Linaro versioning
linaro_version="$( echo "${CT_CC_GCC_VERSION}" \
|${sed} -r -e 's/^linaro-//;' \
|sed -r -e 's/^linaro-//;' \
)"
linaro_series="$( echo "${linaro_version}" \
|${sed} -r -e 's/-.*//;' \
|sed -r -e 's/-.*//;' \
)"

# The official gcc hosts put gcc under a gcc/release/ directory,
Expand All @@ -27,7 +27,7 @@ do_gcc_get() {
{http,ftp,https}://ftp.gnu.org/gnu/gcc/gcc-${CT_CC_GCC_VERSION} \
ftp://{gcc.gnu.org,sourceware.org}/pub/gcc/releases/gcc-${CT_CC_GCC_VERSION}
else
YYMM=`echo ${CT_CC_GCC_VERSION} |cut -d- -f3 |${sed} -e 's,^..,,'`
YYMM=`echo ${CT_CC_GCC_VERSION} |cut -d- -f3 |sed -e 's,^..,,'`
CT_GetFile "gcc-${CT_CC_GCC_VERSION}" \
"https://releases.linaro.org/components/toolchain/gcc-linaro/${linaro_version}" \
"https://releases.linaro.org/${YYMM}/components/toolchain/gcc-linaro/${linaro_series}" \
Expand Down Expand Up @@ -185,7 +185,7 @@ cc_gcc_multilib_housekeeping() {

# sed: prepend dashes or do nothing if default is empty string
multilib_defaults=( $( cc_gcc_get_spec multilib_defaults "${cc}" | \
${sed} 's/\(^\|[[:space:]]\+\)\([^[:space:]]\)/ -\2/g' ) )
sed 's/\(^\|[[:space:]]\+\)\([^[:space:]]\)/ -\2/g' ) )
CT_DoLog EXTRA "gcc default flags: '${multilib_defaults}'"

multilibs=( $( "${cc}" -print-multi-lib ) )
Expand Down Expand Up @@ -238,7 +238,7 @@ cc_gcc_multilib_housekeeping() {
sysroot=$( "${cc}" -print-sysroot )
if [ -n "${base}" ]; then
CT_DoExecLog ALL mkdir -p "${sysroot}${base}"
lnk=$( echo "${base#/}" | ${sed} -e 's,[^/]*,..,g' )
lnk=$( echo "${base#/}" | sed -e 's,[^/]*,..,g' )
else
lnk=.
fi
Expand Down Expand Up @@ -629,23 +629,23 @@ do_gcc_core_backend() {
# Next we have to configure gcc, create libgcc.mk then edit it...
# So much easier if we just edit the source tree, but hey...
if [ ! -f "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/BASE-VER" ]; then
CT_DoExecLog CFG ${make} ${JOBSFLAGS} configure-libiberty
CT_DoExecLog ALL ${make} ${JOBSFLAGS} -C libiberty libiberty.a
CT_DoExecLog CFG ${make} ${JOBSFLAGS} configure-gcc configure-libcpp
CT_DoExecLog ALL ${make} ${JOBSFLAGS} all-libcpp
CT_DoExecLog CFG make ${JOBSFLAGS} configure-libiberty
CT_DoExecLog ALL make ${JOBSFLAGS} -C libiberty libiberty.a
CT_DoExecLog CFG make ${JOBSFLAGS} configure-gcc configure-libcpp
CT_DoExecLog ALL make ${JOBSFLAGS} all-libcpp
else
CT_DoExecLog CFG ${make} ${JOBSFLAGS} configure-gcc configure-libcpp configure-build-libiberty
CT_DoExecLog ALL ${make} ${JOBSFLAGS} all-libcpp all-build-libiberty
CT_DoExecLog CFG make ${JOBSFLAGS} configure-gcc configure-libcpp configure-build-libiberty
CT_DoExecLog ALL make ${JOBSFLAGS} all-libcpp all-build-libiberty
fi
# HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here.
if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/libdecnumber" ]; then
CT_DoExecLog CFG ${make} ${JOBSFLAGS} configure-libdecnumber
CT_DoExecLog ALL ${make} ${JOBSFLAGS} -C libdecnumber libdecnumber.a
CT_DoExecLog CFG make ${JOBSFLAGS} configure-libdecnumber
CT_DoExecLog ALL make ${JOBSFLAGS} -C libdecnumber libdecnumber.a
fi
# HACK: gcc-4.8 uses libbacktrace to make libgcc.mvars, so make it here.
if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/libbacktrace" ]; then
CT_DoExecLog CFG ${make} ${JOBSFLAGS} configure-libbacktrace
CT_DoExecLog ALL ${make} ${JOBSFLAGS} -C libbacktrace
CT_DoExecLog CFG make ${JOBSFLAGS} configure-libbacktrace
CT_DoExecLog ALL make ${JOBSFLAGS} -C libbacktrace
fi

libgcc_rule="libgcc.mvars"
Expand All @@ -663,9 +663,9 @@ do_gcc_core_backend() {
repair_cc=""
fi

CT_DoExecLog ALL ${make} ${JOBSFLAGS} -C gcc ${libgcc_rule} \
CT_DoExecLog ALL make ${JOBSFLAGS} -C gcc ${libgcc_rule} \
${repair_cc}
${sed} -r -i -e 's@-lc@@g' gcc/${libgcc_rule}
sed -r -i -e 's@-lc@@g' gcc/${libgcc_rule}
else # build_libgcc
core_targets=( gcc )
fi # ! build libgcc
Expand Down Expand Up @@ -694,7 +694,7 @@ do_gcc_core_backend() {
esac

CT_DoLog EXTRA "Building ${log_txt}"
CT_DoExecLog ALL ${make} ${JOBSFLAGS} ${core_targets_all}
CT_DoExecLog ALL make ${JOBSFLAGS} ${core_targets_all}

# Do not pass ${JOBSFLAGS} here: recent GCC builds have been failing
# in parallel 'make install' at random locations: libitm, libcilk,
Expand All @@ -705,7 +705,7 @@ do_gcc_core_backend() {
# attempts to remove the destination and re-create it, but another
# install gets in the way.
CT_DoLog EXTRA "Installing ${log_txt}"
CT_DoExecLog ALL ${make} ${core_targets_install}
CT_DoExecLog ALL make ${core_targets_install}

# Remove the libtool "pseudo-libraries": having them in the installed
# tree makes the libtoolized utilities that are built next assume
Expand All @@ -718,9 +718,9 @@ do_gcc_core_backend() {

if [ "${build_manuals}" = "yes" ]; then
CT_DoLog EXTRA "Building the GCC manuals"
CT_DoExecLog ALL ${make} pdf html
CT_DoExecLog ALL make pdf html
CT_DoLog EXTRA "Installing the GCC manuals"
CT_DoExecLog ALL ${make} install-{pdf,html}-gcc
CT_DoExecLog ALL make install-{pdf,html}-gcc
fi

# Create a symlink ${CT_TARGET}-cc to ${CT_TARGET}-gcc to always be able
Expand Down Expand Up @@ -1130,18 +1130,18 @@ do_gcc_backend() {

if [ "${CT_CANADIAN}" = "y" ]; then
CT_DoLog EXTRA "Building libiberty"
CT_DoExecLog ALL ${make} ${JOBSFLAGS} all-build-libiberty
CT_DoExecLog ALL make ${JOBSFLAGS} all-build-libiberty
fi

CT_DoLog EXTRA "Building final gcc compiler"
CT_DoExecLog ALL ${make} ${JOBSFLAGS} all
CT_DoExecLog ALL make ${JOBSFLAGS} all

# See the note on issues with parallel 'make install' in GCC above.
CT_DoLog EXTRA "Installing final gcc compiler"
if [ "${CT_STRIP_TARGET_TOOLCHAIN_EXECUTABLES}" = "y" ]; then
CT_DoExecLog ALL ${make} install-strip
CT_DoExecLog ALL make install-strip
else
CT_DoExecLog ALL ${make} install
CT_DoExecLog ALL make install
fi

# Remove the libtool "pseudo-libraries": having them in the installed
Expand All @@ -1155,9 +1155,9 @@ do_gcc_backend() {

if [ "${build_manuals}" = "yes" ]; then
CT_DoLog EXTRA "Building the GCC manuals"
CT_DoExecLog ALL ${make} pdf html
CT_DoExecLog ALL make pdf html
CT_DoLog EXTRA "Installing the GCC manuals"
CT_DoExecLog ALL ${make} install-{pdf,html}-gcc
CT_DoExecLog ALL make install-{pdf,html}-gcc
fi

# Create a symlink ${CT_TARGET}-cc to ${CT_TARGET}-gcc to always be able
Expand Down
6 changes: 3 additions & 3 deletions scripts/build/companion_libs/100-gmp.sh
Expand Up @@ -103,15 +103,15 @@ do_gmp_backend() {
"${extra_config}"

CT_DoLog EXTRA "Building GMP"
CT_DoExecLog ALL ${make} ${JOBSFLAGS}
CT_DoExecLog ALL make ${JOBSFLAGS}

if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
CT_DoLog EXTRA "Checking GMP"
CT_DoExecLog ALL ${make} ${JOBSFLAGS} -s check
CT_DoExecLog ALL make ${JOBSFLAGS} -s check
fi

CT_DoLog EXTRA "Installing GMP"
CT_DoExecLog ALL ${make} install
CT_DoExecLog ALL make install
}

fi # CT_GMP
10 changes: 5 additions & 5 deletions scripts/build/companion_libs/110-mpfr.sh
Expand Up @@ -53,12 +53,12 @@ do_mpfr_extract() {
# See: http://sourceware.org/ml/crossgcc/2008-11/msg00046.html
# and: http://sourceware.org/ml/crossgcc/2008-11/msg00048.html
libtoolize_opt=
case "$(${libtoolize} --version |head -n 1 |${awk} '{ print $(NF); }')" in
case "$(libtoolize --version |head -n 1 |awk '{ print $(NF); }')" in
0.*) ;;
1.*) ;;
*) libtoolize_opt=-i;;
esac
CT_DoExecLog ALL ${libtoolize} -f ${libtoolize_opt}
CT_DoExecLog ALL libtoolize -f ${libtoolize_opt}
touch .autotools.ct-ng
fi
CT_Popd
Expand Down Expand Up @@ -146,15 +146,15 @@ do_mpfr_backend() {
--enable-static

CT_DoLog EXTRA "Building MPFR"
CT_DoExecLog ALL ${make} ${JOBSFLAGS}
CT_DoExecLog ALL make ${JOBSFLAGS}

if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
CT_DoLog EXTRA "Checking MPFR"
CT_DoExecLog ALL ${make} ${JOBSFLAGS} -s check
CT_DoExecLog ALL make ${JOBSFLAGS} -s check
fi

CT_DoLog EXTRA "Installing MPFR"
CT_DoExecLog ALL ${make} install
CT_DoExecLog ALL make install
}

fi # CT_MPFR
6 changes: 3 additions & 3 deletions scripts/build/companion_libs/121-isl.sh
Expand Up @@ -122,15 +122,15 @@ do_isl_backend() {
--with-clang=no

CT_DoLog EXTRA "Building ISL"
CT_DoExecLog ALL ${make} ${JOBSFLAGS}
CT_DoExecLog ALL make ${JOBSFLAGS}

if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
CT_DoLog EXTRA "Checking ISL"
CT_DoExecLog ALL ${make} ${JOBSFLAGS} -s check
CT_DoExecLog ALL make ${JOBSFLAGS} -s check
fi

CT_DoLog EXTRA "Installing ISL"
CT_DoExecLog ALL ${make} install
CT_DoExecLog ALL make install
}

fi # CT_ISL
6 changes: 3 additions & 3 deletions scripts/build/companion_libs/130-cloog.sh
Expand Up @@ -109,15 +109,15 @@ do_cloog_backend() {
"${cloog_opts[@]}"

CT_DoLog EXTRA "Building CLooG"
CT_DoExecLog ALL ${make} ${JOBSFLAGS}
CT_DoExecLog ALL make ${JOBSFLAGS}

if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
CT_DoLog EXTRA "Checking CLooG"
CT_DoExecLog ALL ${make} ${JOBSFLAGS} -s check
CT_DoExecLog ALL make ${JOBSFLAGS} -s check
fi

CT_DoLog EXTRA "Installing CLooG"
CT_DoExecLog ALL ${make} install
CT_DoExecLog ALL make install
}

fi # CT_CLOOG
6 changes: 3 additions & 3 deletions scripts/build/companion_libs/140-mpc.sh
Expand Up @@ -97,15 +97,15 @@ do_mpc_backend() {
--enable-static

CT_DoLog EXTRA "Building MPC"
CT_DoExecLog ALL ${make} ${JOBSFLAGS}
CT_DoExecLog ALL make ${JOBSFLAGS}

if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
CT_DoLog EXTRA "Checking MPC"
CT_DoExecLog ALL ${make} ${JOBSFLAGS} -s check
CT_DoExecLog ALL make ${JOBSFLAGS} -s check
fi

CT_DoLog EXTRA "Installing MPC"
CT_DoExecLog ALL ${make} install
CT_DoExecLog ALL make install
}

fi # CT_MPC
4 changes: 2 additions & 2 deletions scripts/build/companion_libs/200-libelf.sh
Expand Up @@ -132,7 +132,7 @@ do_libelf_backend() {
"${extra_config[@]}"

CT_DoLog EXTRA "Building libelf"
CT_DoExecLog ALL ${make}
CT_DoExecLog ALL make

CT_DoLog EXTRA "Installing libelf"

Expand All @@ -142,7 +142,7 @@ do_libelf_backend() {
destdir=
fi

CT_DoExecLog ALL ${make} instroot="${destdir}" install
CT_DoExecLog ALL make instroot="${destdir}" install
}

fi # CT_LIBELF || CT_LIBELF_TARGET
4 changes: 2 additions & 2 deletions scripts/build/companion_libs/210-expat.sh
Expand Up @@ -93,9 +93,9 @@ do_expat_backend() {
"${extra_config[@]}"

CT_DoLog EXTRA "Building expat"
CT_DoExecLog ALL ${make} ${JOBSFLAGS}
CT_DoExecLog ALL make ${JOBSFLAGS}
CT_DoLog EXTRA "Installing expat"
CT_DoExecLog ALL ${make} install INSTALL_ROOT="${destdir}"
CT_DoExecLog ALL make install INSTALL_ROOT="${destdir}"
}

fi
4 changes: 2 additions & 2 deletions scripts/build/companion_libs/220-ncurses.sh
Expand Up @@ -148,9 +148,9 @@ do_ncurses_backend() {
# it also builds ncurses anyway, and dedicated targets (install.includes and
# install.progs) do not do well with parallel make (-jX).
CT_DoLog EXTRA "Building ncurses"
CT_DoExecLog ALL ${make} ${JOBSFLAGS}
CT_DoExecLog ALL make ${JOBSFLAGS}
CT_DoLog EXTRA "Installing ncurses"
CT_DoExecLog ALL ${make} install
CT_DoExecLog ALL make install
}

fi
4 changes: 2 additions & 2 deletions scripts/build/companion_libs/320-libiconv.sh
Expand Up @@ -106,10 +106,10 @@ do_libiconv_backend() {
"${extra_config[@]}" \

CT_DoLog EXTRA "Building libiconv"
CT_DoExecLog ALL ${make} CC="${host}-gcc ${cflags}" ${JOBSFLAGS}
CT_DoExecLog ALL make CC="${host}-gcc ${cflags}" ${JOBSFLAGS}

CT_DoLog EXTRA "Installing libiconv"
CT_DoExecLog ALL ${make} install CC="${host}-gcc ${cflags}"
CT_DoExecLog ALL make install CC="${host}-gcc ${cflags}"
}

fi

0 comments on commit 488b27f

Please sign in to comment.