diff options
author | Bryan Hundven <bryanhundven@gmail.com> | 2015-11-17 02:48:09 -0800 |
---|---|---|
committer | Bryan Hundven <bryanhundven@gmail.com> | 2015-11-17 02:48:09 -0800 |
commit | 6f8e89cb5ca061e899bf3feaaf3fecf30d366c3e (patch) | |
tree | 9eb19260dd694fa6b4852c46e3f0a93939db9a24 /scripts/build/libc | |
parent | 6ac8e31a519f41af7838bb5261e0fe989fb428bd (diff) | |
download | crosstool-ng-6f8e89cb5ca061e899bf3feaaf3fecf30d366c3e.tar.gz crosstool-ng-6f8e89cb5ca061e899bf3feaaf3fecf30d366c3e.tar.bz2 crosstool-ng-6f8e89cb5ca061e899bf3feaaf3fecf30d366c3e.zip |
consistency: Use exported variables of required tools
We check for apps:
* make
* sed
* grep
* awk
* libtool/libtoolize
* install
* patch
* and more
...during configure. Our scripts should be consistent about using the
variables that define where the found tool was found.
Of course, we do hard-link these tools in buildtools, but that should be
a backup for the components we are building. Our scripts should always
use the tools we find.
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
Diffstat (limited to 'scripts/build/libc')
-rw-r--r-- | scripts/build/libc/avr-libc.sh | 4 | ||||
-rw-r--r-- | scripts/build/libc/glibc.sh | 54 | ||||
-rw-r--r-- | scripts/build/libc/mingw.sh | 8 | ||||
-rw-r--r-- | scripts/build/libc/musl.sh | 8 | ||||
-rw-r--r-- | scripts/build/libc/newlib.sh | 8 | ||||
-rw-r--r-- | scripts/build/libc/uClibc.sh | 22 |
6 files changed, 52 insertions, 52 deletions
diff --git a/scripts/build/libc/avr-libc.sh b/scripts/build/libc/avr-libc.sh index 502beb8b..103a7951 100644 --- a/scripts/build/libc/avr-libc.sh +++ b/scripts/build/libc/avr-libc.sh @@ -62,10 +62,10 @@ do_libc_post_cc() { do_libc_configure CT_DoLog EXTRA "Building C library" - CT_DoExecLog ALL make ${JOBSFLAGS} + CT_DoExecLog ALL ${make} ${JOBSFLAGS} CT_DoLog EXTRA "Installing C library" - CT_DoExecLog ALL make install + CT_DoExecLog ALL ${make} install CT_EndStep } diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index cfdacf0b..126e9e0f 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -396,7 +396,7 @@ do_libc_backend_once() { # use the 'install-headers' makefile target to install the # headers - CT_DoExecLog ALL make ${JOBSFLAGS} \ + CT_DoExecLog ALL ${make} ${JOBSFLAGS} \ install_root=${CT_SYSROOT_DIR}${extra_dir} \ install-bootstrap-headers=yes \ "${extra_make_args[@]}" \ @@ -447,8 +447,8 @@ do_libc_backend_once() { # there are a few object files needed to link shared libraries, # which we build and install by hand CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}${extra_dir}/usr/lib" - CT_DoExecLog ALL make ${JOBSFLAGS} \ - "${extra_make_args[@]}" \ + CT_DoExecLog ALL ${make} ${JOBSFLAGS} \ + "${extra_make_args[@]}" \ csu/subdir_lib CT_DoExecLog ALL cp csu/crt1.o csu/crti.o csu/crtn.o \ "${CT_SYSROOT_DIR}${extra_dir}/usr/lib" @@ -467,12 +467,12 @@ do_libc_backend_once() { if [ "${libc_full}" = "y" ]; then CT_DoLog EXTRA "Building C library" - CT_DoExecLog ALL make ${JOBSFLAGS} \ - "${extra_make_args[@]}" \ + CT_DoExecLog ALL ${make} ${JOBSFLAGS} \ + "${extra_make_args[@]}" \ all CT_DoLog EXTRA "Installing C library" - CT_DoExecLog ALL make ${JOBSFLAGS} \ + CT_DoExecLog ALL ${make} ${JOBSFLAGS} \ "${extra_make_args[@]}" \ install_root="${CT_SYSROOT_DIR}${extra_dir}" \ install @@ -481,7 +481,7 @@ do_libc_backend_once() { CT_DoLog EXTRA "Building and installing the C library manual" # Omit JOBSFLAGS as GLIBC has problems building the # manuals in parallel - CT_DoExecLog ALL make pdf html + CT_DoExecLog ALL ${make} pdf html CT_DoExecLog ALL mkdir -p ${CT_PREFIX_DIR}/share/doc CT_DoExecLog ALL cp -av ${src_dir}/manual/*.pdf \ ${src_dir}/manual/libc \ @@ -497,8 +497,8 @@ do_libc_backend_once() { # Build up the addons list, separated with $1 do_libc_add_ons_list() { local sep="$1" - local addons_list="$( echo "${CT_LIBC_ADDONS_LIST}" \ - |sed -r -e "s/[[:space:],]/${sep}/g;" \ + local addons_list="$( echo "${CT_LIBC_ADDONS_LIST}" \ + |${sed} -r -e "s/[[:space:],]/${sep}/g;" \ )" if [ "${CT_LIBC_GLIBC_2_20_or_later}" != "y" ]; then case "${CT_THREADS}" in @@ -508,7 +508,7 @@ do_libc_add_ons_list() { fi [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && addons_list="${addons_list}${sep}ports" # Remove duplicate, leading and trailing separators - echo "${addons_list}" |sed -r -e "s/${sep}+/${sep}/g; s/^${sep}//; s/${sep}\$//;" + echo "${addons_list}" |${sed} -r -e "s/${sep}+/${sep}/g; s/^${sep}//; s/${sep}\$//;" } # Compute up the minimum supported Linux kernel version @@ -527,8 +527,8 @@ do_libc_min_kernel_config() { if [ ! -f "${version_code_file}" -o ! -r "${version_code_file}" ]; then CT_Abort "Linux version is unavailable in installed headers files" fi - version_code="$( grep -E LINUX_VERSION_CODE "${version_code_file}" \ - |cut -d ' ' -f 3 \ + version_code="$(${grep} -E LINUX_VERSION_CODE "${version_code_file}" \ + |cut -d' ' -f 3 \ )" version=$(((version_code>>16)&0xFF)) patchlevel=$(((version_code>>8)&0xFF)) @@ -536,8 +536,8 @@ do_libc_min_kernel_config() { min_kernel_config="${version}.${patchlevel}.${sublevel}" elif [ "${CT_LIBC_GLIBC_KERNEL_VERSION_CHOSEN}" = "y" ]; then # Trim the fourth part of the linux version, keeping only the first three numbers - min_kernel_config="$( echo "${CT_LIBC_GLIBC_MIN_KERNEL_VERSION}" \ - |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;' \ + min_kernel_config="$( echo "${CT_LIBC_GLIBC_MIN_KERNEL_VERSION}" \ + |${sed} -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;' \ )" fi echo "--enable-kernel=${min_kernel_config}" @@ -558,7 +558,7 @@ do_libc_get() { CT_GetCustom "glibc" "${CT_LIBC_VERSION}" "${CT_LIBC_GLIBC_CUSTOM_LOCATION}" CT_LIBC_CUSTOM_LOCATION="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}" else - if echo ${CT_LIBC_VERSION} |grep -q linaro; then + if echo ${CT_LIBC_VERSION} |${grep} -q linaro; then # Linaro glibc releases come from regular downloads... YYMM=`echo ${CT_LIBC_VERSION} |cut -d- -f3 |${sed} -e 's,^..,,'` CT_GetFile "glibc-${CT_LIBC_VERSION}" \ @@ -657,19 +657,19 @@ do_libc_locales() { # Configure with --prefix the way we want it on the target... - CT_DoExecLog CFG \ - CFLAGS="${glibc_cflags}" \ - "${src_dir}/configure" \ - --prefix=/usr \ - --cache-file="$(pwd)/config.cache" \ - --without-cvs \ - --disable-profile \ - --without-gd \ - --disable-debug \ + CT_DoExecLog CFG \ + CFLAGS="${glibc_cflags}" \ + "${src_dir}/configure" \ + --prefix=/usr \ + --cache-file="$(pwd)/config.cache" \ + --without-cvs \ + --disable-profile \ + --without-gd \ + --disable-debug \ "${extra_config[@]}" CT_DoLog EXTRA "Building C library localedef" - CT_DoExecLog ALL make ${JOBSFLAGS} + CT_DoExecLog ALL ${make} ${JOBSFLAGS} # The target's endianness and uint32_t alignment should be passed as options # to localedef, but glibc's localedef does not support these options, which @@ -677,8 +677,8 @@ do_libc_locales() { # only if it has the same endianness and uint32_t alignment as the host's. CT_DoLog EXTRA "Installing C library locales" - CT_DoExecLog ALL make ${JOBSFLAGS} \ - install_root="${CT_SYSROOT_DIR}" \ + CT_DoExecLog ALL ${make} ${JOBSFLAGS} \ + install_root="${CT_SYSROOT_DIR}" \ localedata/install-locales } diff --git a/scripts/build/libc/mingw.sh b/scripts/build/libc/mingw.sh index 19289dea..964a11d9 100644 --- a/scripts/build/libc/mingw.sh +++ b/scripts/build/libc/mingw.sh @@ -59,10 +59,10 @@ do_libc_start_files() { "${sdk_opts[@]}" CT_DoLog EXTRA "Compile Headers" - CT_DoExecLog ALL make + CT_DoExecLog ALL ${make} CT_DoLog EXTRA "Installing Headers" - CT_DoExecLog ALL make install DESTDIR=${CT_SYSROOT_DIR} + CT_DoExecLog ALL ${make} install DESTDIR=${CT_SYSROOT_DIR} CT_Popd @@ -108,10 +108,10 @@ do_libc() { # parallel build. See https://github.com/crosstool-ng/crosstool-ng/issues/246 # Do not pass ${JOBSFLAGS} - build serially. CT_DoLog EXTRA "Building mingw-w64-crt" - CT_DoExecLog ALL make + CT_DoExecLog ALL ${make} CT_DoLog EXTRA "Installing mingw-w64-crt" - CT_DoExecLog ALL make install DESTDIR=${CT_SYSROOT_DIR} + CT_DoExecLog ALL ${make} install DESTDIR=${CT_SYSROOT_DIR} CT_EndStep } diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh index 81a19d72..f8f135c1 100644 --- a/scripts/build/libc/musl.sh +++ b/scripts/build/libc/musl.sh @@ -84,9 +84,9 @@ do_libc_start_files() { do_libc_configure CT_DoLog EXTRA "Installing headers" - CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" install-headers + CT_DoExecLog ALL ${make} DESTDIR="${CT_SYSROOT_DIR}" install-headers - CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" \ + CT_DoExecLog ALL ${make} DESTDIR="${CT_SYSROOT_DIR}" \ crt/crt1.o crt/crti.o crt/crtn.o CT_DoExecLog ALL cp -av crt/crt*.o "${CT_SYSROOT_DIR}/usr/lib" CT_DoExecLog ALL ${CT_TARGET}-gcc -nostdlib \ @@ -106,10 +106,10 @@ do_libc() { do_libc_configure CT_DoLog EXTRA "Building C library" - CT_DoExecLog ALL make ${JOBSFLAGS} + CT_DoExecLog ALL ${make} ${JOBSFLAGS} CT_DoLog EXTRA "Installing C library" - CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" install + CT_DoExecLog ALL ${make} DESTDIR="${CT_SYSROOT_DIR}" install CT_EndStep } diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh index 4c395d0d..a4fe82e2 100644 --- a/scripts/build/libc/newlib.sh +++ b/scripts/build/libc/newlib.sh @@ -17,7 +17,7 @@ do_libc_get() { CT_GetCustom "newlib" "${CT_LIBC_VERSION}" \ "${CT_LIBC_NEWLIB_CUSTOM_LOCATION}" else # ! custom location - if echo ${CT_LIBC_VERSION} |grep -q linaro; then + if echo ${CT_LIBC_VERSION} |${grep} -q linaro; then YYMM=`echo ${CT_LIBC_VERSION} |cut -d- -f3 |${sed} -e 's,^..,,'` CT_GetFile "newlib-${CT_LIBC_VERSION}" ${libc_src} \ https://releases.linaro.org/${YYMM}/components/toolchain/newlib-linaro \ @@ -120,16 +120,16 @@ do_libc() { "${CT_LIBC_NEWLIB_EXTRA_CONFIG_ARRAY[@]}" CT_DoLog EXTRA "Building C library" - CT_DoExecLog ALL make ${JOBSFLAGS} + CT_DoExecLog ALL ${make} ${JOBSFLAGS} CT_DoLog EXTRA "Installing C library" - CT_DoExecLog ALL make install install_root="${CT_SYSROOT_DIR}" + CT_DoExecLog ALL ${make} install install_root="${CT_SYSROOT_DIR}" if [ "${CT_BUILD_MANUALS}" = "y" ]; then local -a doc_dir="${CT_BUILD_DIR}/build-libc/${CT_TARGET}" CT_DoLog EXTRA "Building and installing the C library manual" - CT_DoExecLog ALL make pdf html + CT_DoExecLog ALL ${make} pdf html # NEWLIB install-{pdf.html} fail for some versions CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/share/doc/newlib" diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh index f49fd082..07c1ec70 100644 --- a/scripts/build/libc/uClibc.sh +++ b/scripts/build/libc/uClibc.sh @@ -107,7 +107,7 @@ do_libc_start_files() { # newer ones that are referenced are not available CT_DoLog EXTRA "Applying configuration" CT_DoYes "" |CT_DoExecLog ALL \ - make CROSS_COMPILE="${cross}" \ + ${make} CROSS_COMPILE="${cross}" \ UCLIBC_EXTRA_CFLAGS="-pipe" \ PREFIX="${CT_SYSROOT_DIR}/" \ LOCALE_DATA_FILENAME="${uclibc_local_tarball}.tgz" \ @@ -115,7 +115,7 @@ do_libc_start_files() { CT_DoLog EXTRA "Building headers" CT_DoExecLog ALL \ - make ${CT_LIBC_UCLIBC_VERBOSITY} \ + ${make} ${CT_LIBC_UCLIBC_VERBOSITY} \ CROSS_COMPILE="${cross}" \ UCLIBC_EXTRA_CFLAGS="-pipe" \ PREFIX="${CT_SYSROOT_DIR}/" \ @@ -124,7 +124,7 @@ do_libc_start_files() { CT_DoLog EXTRA "Installing headers" CT_DoExecLog ALL \ - make ${CT_LIBC_UCLIBC_VERBOSITY} \ + ${make} ${CT_LIBC_UCLIBC_VERBOSITY} \ CROSS_COMPILE="${cross}" \ UCLIBC_EXTRA_CFLAGS="-pipe" \ PREFIX="${CT_SYSROOT_DIR}/" \ @@ -134,7 +134,7 @@ do_libc_start_files() { if [ "${CT_THREADS}" = "nptl" ]; then CT_DoLog EXTRA "Building start files" CT_DoExecLog ALL \ - make ${CT_LIBC_UCLIBC_PARALLEL:+${JOBSFLAGS}} \ + ${make} ${CT_LIBC_UCLIBC_PARALLEL:+${JOBSFLAGS}} \ CROSS_COMPILE="${cross}" \ UCLIBC_EXTRA_CFLAGS="-pipe" \ PREFIX="${CT_SYSROOT_DIR}/" \ @@ -154,12 +154,12 @@ do_libc_start_files() { -o libdummy.so CT_DoLog EXTRA "Installing start files" - CT_DoExecLog ALL install -m 0644 lib/crt1.o lib/crti.o lib/crtn.o \ + CT_DoExecLog ALL ${install} -m 0644 lib/crt1.o lib/crti.o lib/crtn.o \ "${CT_SYSROOT_DIR}/usr/lib" CT_DoLog EXTRA "Installing dummy shared libs" - CT_DoExecLog ALL install -m 0755 libdummy.so "${CT_SYSROOT_DIR}/usr/lib/libc.so" - CT_DoExecLog ALL install -m 0755 libdummy.so "${CT_SYSROOT_DIR}/usr/lib/libm.so" + CT_DoExecLog ALL ${install} -m 0755 libdummy.so "${CT_SYSROOT_DIR}/usr/lib/libc.so" + CT_DoExecLog ALL ${install} -m 0755 libdummy.so "${CT_SYSROOT_DIR}/usr/lib/libm.so" fi # CT_THREADS == nptl CT_EndStep @@ -187,7 +187,7 @@ do_libc() { # use LIBC_EXTRA_CFLAGS here. CT_DoLog EXTRA "Applying configuration" CT_DoYes "" |CT_DoExecLog CFG \ - make CROSS_COMPILE=${CT_TARGET}- \ + ${make} CROSS_COMPILE=${CT_TARGET}- \ UCLIBC_EXTRA_CFLAGS="-pipe" \ PREFIX="${CT_SYSROOT_DIR}/" \ LOCALE_DATA_FILENAME="${uclibc_local_tarball}.tgz" \ @@ -198,7 +198,7 @@ do_libc() { # /Old/ versions can not build in // CT_DoLog EXTRA "Building C library" CT_DoExecLog ALL \ - make -j1 \ + ${make} -j1 \ CROSS_COMPILE=${CT_TARGET}- \ UCLIBC_EXTRA_CFLAGS="-pipe" \ PREFIX="${CT_SYSROOT_DIR}/" \ @@ -207,7 +207,7 @@ do_libc() { LOCALE_DATA_FILENAME="${uclibc_local_tarball}.tgz" \ pregen CT_DoExecLog ALL \ - make ${CT_LIBC_UCLIBC_PARALLEL:+${JOBSFLAGS}} \ + ${make} ${CT_LIBC_UCLIBC_PARALLEL:+${JOBSFLAGS}} \ CROSS_COMPILE=${CT_TARGET}- \ UCLIBC_EXTRA_CFLAGS="-pipe" \ PREFIX="${CT_SYSROOT_DIR}/" \ @@ -232,7 +232,7 @@ do_libc() { # CT_DoLog EXTRA "Installing C library" CT_DoExecLog ALL \ - make CROSS_COMPILE=${CT_TARGET}- \ + ${make} CROSS_COMPILE=${CT_TARGET}- \ UCLIBC_EXTRA_CFLAGS="-pipe" \ PREFIX="${CT_SYSROOT_DIR}/" \ STRIPTOOL=true \ |