summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/build/cc_gcc.sh14
-rw-r--r--scripts/build/debug/100-dmalloc.sh2
-rw-r--r--scripts/build/debug/200-duma.sh6
-rw-r--r--scripts/build/debug/300-gdb.sh8
-rw-r--r--scripts/build/debug/400-ltrace.sh2
-rw-r--r--scripts/build/kernel_linux.sh30
-rw-r--r--scripts/build/libc_glibc.sh50
-rw-r--r--scripts/build/libc_uClibc.sh4
-rw-r--r--scripts/build/tools/200-sstrip.sh16
-rwxr-xr-xscripts/crosstool.sh54
-rw-r--r--scripts/functions128
-rwxr-xr-xscripts/saveSample.sh4
-rwxr-xr-xscripts/tarball.sh.broken20
-rwxr-xr-xtools/addToolVersion.sh8
-rw-r--r--tools/populate.in18
15 files changed, 182 insertions, 182 deletions
diff --git a/scripts/build/cc_gcc.sh b/scripts/build/cc_gcc.sh
index 49ef922..7818173 100644
--- a/scripts/build/cc_gcc.sh
+++ b/scripts/build/cc_gcc.sh
@@ -62,7 +62,7 @@ do_cc_core_static() {
[ "${CT_CC_CXA_ATEXIT}" = "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
[ "${CT_CC_GCC_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
- CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
+ CT_DoLog DEBUG "Extra config passed: '${extra_config}'"
# Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
CC_FOR_BUILD="${CT_CC_NATIVE}" \
@@ -117,7 +117,7 @@ do_cc_core_shared() {
[ "${CT_CC_CXA_ATEXIT}" = "y" ] && extra_config="${extra_config} --enable-__cxa_atexit"
[ "${CT_CC_GCC_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
- CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
+ CT_DoLog DEBUG "Extra config passed: '${extra_config}'"
CC_FOR_BUILD="${CT_CC_NATIVE}" \
CFLAGS="${CT_CFLAGS_FOR_HOST}" \
@@ -210,7 +210,7 @@ do_cc() {
CT_Test "Building Objective-C language is not yet supported. Will try..." "${CT_CC_LANG_OBJC}" = "y"
CT_Test "Building Objective-C++ language is not yet supported. Will try..." "${CT_CC_LANG_OBJCXX}" = "y"
CT_Test "Building ${CT_CC_LANG_OTHERS//,/ } language(s) is not yet supported. Will try..." -n "${CT_CC_LANG_OTHERS}"
- lang_opt=`echo "${lang_opt},${CT_CC_LANG_OTHERS}" |sed -r -e 's/,+/,/g; s/,*$//;'`
+ lang_opt=$(echo "${lang_opt},${CT_CC_LANG_OTHERS}" |sed -r -e 's/,+/,/g; s/,*$//;')
extra_config="--enable-languages=${lang_opt}"
extra_config="${extra_config} ${CT_ARCH_WITH_ARCH} ${CT_ARCH_WITH_ABI} ${CT_ARCH_WITH_CPU} ${CT_ARCH_WITH_TUNE} ${CT_ARCH_WITH_FPU} ${CT_ARCH_WITH_FLOAT}"
@@ -223,7 +223,7 @@ do_cc() {
fi
[ "${CT_CC_GCC_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
- CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
+ CT_DoLog DEBUG "Extra config passed: '${extra_config}'"
# --enable-symvers=gnu really only needed for sh4 to work around a
# detection problem only matters for gcc-3.2.x and later, I think.
@@ -262,10 +262,10 @@ do_cc() {
gcc-3.3.[34])
case "${CT_TARGET}" in
powerpc64-unknown-linux-gnu|x86_64-unknown-linux-gnu)
- for d in `find "${CT_SYSROOT_DIR}" -name lib -type d -empty`; do
- if [ -d `dirname "${d}"`/lib64 ] ; then
+ for d in $(find "${CT_SYSROOT_DIR}" -name lib -type d -empty); do
+ if [ -d $(dirname "${d}")/lib64 ] ; then
rm -rf "${d}"
- ln -s `dirname "${d}"`/lib64 "${d}"
+ ln -s $(dirname "${d}")/lib64 "${d}"
fi
done ;;
*) ;;
diff --git a/scripts/build/debug/100-dmalloc.sh b/scripts/build/debug/100-dmalloc.sh
index ff54373..46dd728 100644
--- a/scripts/build/debug/100-dmalloc.sh
+++ b/scripts/build/debug/100-dmalloc.sh
@@ -36,7 +36,7 @@ do_debug_dmalloc_build() {
*) extra_config="${extra_config} --disable-shlib";;
esac
- CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
+ CT_DoLog DEBUG "Extra config passed: '${extra_config}'"
LD="${CT_TARGET}-ld" \
AR="${CT_TARGET}-ar" \
diff --git a/scripts/build/debug/200-duma.sh b/scripts/build/debug/200-duma.sh
index fa3708b..b9c1ac6 100644
--- a/scripts/build/debug/200-duma.sh
+++ b/scripts/build/debug/200-duma.sh
@@ -13,7 +13,7 @@ do_debug_duma_get() {
# but with an underscore. Create a link so that crosstool-NG can
# work correctly:
cd "${CT_TARBALLS_DIR}"
- duma_ext=`CT_GetFileExtension "duma_${CT_DUMA_VERSION}"`
+ duma_ext=$(CT_GetFileExtension "duma_${CT_DUMA_VERSION}")
rm -f "duma-${CT_DUMA_VERSION}${duma_ext}"
ln -sf "duma_${CT_DUMA_VERSION}${duma_ext}" "duma-${CT_DUMA_VERSION}${duma_ext}"
}
@@ -38,14 +38,14 @@ do_debug_duma_build() {
[ "${CT_DUMA_A}" = "y" ] && libs="${libs} libduma.a"
[ "${CT_DUMA_SO}" = "y" ] && libs="${libs} libduma.so.0.0"
for lib in ${libs}; do
- CT_DoLog EXTRA "Building library \"${lib}\""
+ CT_DoLog EXTRA "Building library '${lib}'"
make HOSTCC="${CT_CC_NATIVE}" \
HOSTCXX="${CT_CC_NATIVE}" \
CC="${CT_TARGET}-${CT_CC}" \
CXX="${CT_TARGET}-${CT_CC}" \
DUMA_CPP="${DUMA_CPP}" \
${libs} 2>&1 |CT_DoLog ALL
- CT_DoLog EXTRA "Installing library \"${lib}\""
+ CT_DoLog EXTRA "Installing library '${lib}'"
install -m 644 "${lib}" "${CT_SYSROOT_DIR}/usr/lib" 2>&1 |CT_DoLog ALL
done
if [ "${CT_DUMA_SO}" = "y" ]; then
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh
index 2c27398..aa26e97 100644
--- a/scripts/build/debug/300-gdb.sh
+++ b/scripts/build/debug/300-gdb.sh
@@ -4,7 +4,7 @@ is_enabled="${CT_GDB}"
do_print_filename() {
[ "${CT_GDB}" = "y" ] || return 0
- echo "gdb`do_debug_gdb_suffix`"
+ echo "gdb$(do_debug_gdb_suffix)"
}
do_debug_gdb_suffix() {
@@ -15,17 +15,17 @@ do_debug_gdb_suffix() {
}
do_debug_gdb_get() {
- CT_GetFile "gdb`do_debug_gdb_suffix`" \
+ CT_GetFile "gdb$(do_debug_gdb_suffix)" \
{ftp,http}://ftp.gnu.org/pub/gnu/gdb \
ftp://sources.redhat.com/pub/gdb/{{,old-}releases,snapshots/current}
}
do_debug_gdb_extract() {
- CT_ExtractAndPatch "gdb`do_debug_gdb_suffix`"
+ CT_ExtractAndPatch "gdb$(do_debug_gdb_suffix)"
}
do_debug_gdb_build() {
- gdb_src_dir="${CT_SRC_DIR}/gdb`do_debug_gdb_suffix`"
+ gdb_src_dir="${CT_SRC_DIR}/gdb$(do_debug_gdb_suffix)"
extra_config=
# Version 6.3 and below behave badly with gdbmi
diff --git a/scripts/build/debug/400-ltrace.sh b/scripts/build/debug/400-ltrace.sh
index d64dc80..12bc092 100644
--- a/scripts/build/debug/400-ltrace.sh
+++ b/scripts/build/debug/400-ltrace.sh
@@ -11,7 +11,7 @@ do_debug_ltrace_get() {
CT_GetFile "ltrace_${CT_LTRACE_VERSION}.orig" {ftp,http}://ftp.de.debian.org/debian/pool/main/l/ltrace/
# Create a link so that the following steps are easier to do:
cd "${CT_TARBALLS_DIR}"
- ltrace_ext=`CT_GetFileExtension "ltrace_${CT_LTRACE_VERSION}.orig"`
+ ltrace_ext=$(CT_GetFileExtension "ltrace_${CT_LTRACE_VERSION}.orig")
ln -sf "ltrace_${CT_LTRACE_VERSION}.orig${ltrace_ext}" "ltrace-${CT_LTRACE_VERSION}${ltrace_ext}"
}
diff --git a/scripts/build/kernel_linux.sh b/scripts/build/kernel_linux.sh
index 07005e0..745282a 100644
--- a/scripts/build/kernel_linux.sh
+++ b/scripts/build/kernel_linux.sh
@@ -44,10 +44,10 @@ do_kernel_check_config() {
mkdir -p "${CT_BUILD_DIR}/build-kernel-defconfig"
cd "${CT_BUILD_DIR}/build-kernel-defconfig"
- make -C "${CT_SRC_DIR}/${CT_KERNEL_FILE}" O=`pwd` \
+ make -C "${CT_SRC_DIR}/${CT_KERNEL_FILE}" O=$(pwd) \
ARCH=${CT_KERNEL_ARCH} defconfig 2>&1 |CT_DoLog ALL
- CT_KERNEL_LINUX_CONFIG_FILE="`pwd`/.config"
+ CT_KERNEL_LINUX_CONFIG_FILE="$(pwd)/.config"
CT_EndStep
fi
@@ -64,20 +64,20 @@ do_kernel_headers() {
# We need to enter this directory to find the kernel version strings
cd "${CT_SRC_DIR}/${CT_KERNEL_FILE}"
if [ "${CT_KERNEL_LINUX_HEADERS_SANITISED}" != "y" ]; then
- k_version=`awk '/^VERSION =/ { print $3 }' Makefile`
- k_patchlevel=`awk '/^PATCHLEVEL =/ { print $3 }' Makefile`
- k_sublevel=`awk '/^SUBLEVEL =/ { print $3 }' Makefile`
- k_extraversion=`awk '/^EXTRAVERSION =/ { print $3 }' Makefile`
+ k_version=$(awk '/^VERSION =/ { print $3 }' Makefile)
+ k_patchlevel=$(awk '/^PATCHLEVEL =/ { print $3 }' Makefile)
+ k_sublevel=$(awk '/^SUBLEVEL =/ { print $3 }' Makefile)
+ k_extraversion=$(awk '/^EXTRAVERSION =/ { print $3 }' Makefile)
else
- k_version=`echo "${CT_KERNEL_VERSION}." |cut -d . -f 1`
- k_patchlevel=`echo "${CT_KERNEL_VERSION}." |cut -d . -f 2`
- k_sublevel=`echo "${CT_KERNEL_VERSION}." |cut -d . -f 3`
- k_extraversion=`echo "${CT_KERNEL_VERSION}." |cut -d . -f 4`
+ k_version=$(echo "${CT_KERNEL_VERSION}." |cut -d . -f 1)
+ k_patchlevel=$(echo "${CT_KERNEL_VERSION}." |cut -d . -f 2)
+ k_sublevel=$(echo "${CT_KERNEL_VERSION}." |cut -d . -f 3)
+ k_extraversion=$(echo "${CT_KERNEL_VERSION}." |cut -d . -f 4)
fi
case "${k_version}.${k_patchlevel}" in
2.2|2.4|2.6) ;;
- *) CT_Abort "Unsupported kernel version \"linux-${k_version}.${k_patchlevel}\".";;
+ *) CT_Abort "Unsupported kernel version 'linux-${k_version}.${k_patchlevel}'.";;
esac
# Kernel version that support verbosity will use this, others will ignore it:
@@ -109,7 +109,7 @@ do_kernel_install() {
CT_DoLog EXTRA "Installing kernel headers"
make -C "${CT_SRC_DIR}/${CT_KERNEL_FILE}" \
- O="`pwd`" \
+ O=$(pwd) \
ARCH=${CT_KERNEL_ARCH} \
INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \
${V_OPT} \
@@ -118,7 +118,7 @@ do_kernel_install() {
if [ "${CT_KERNEL_LINUX_HEADERS_INSTALL_CHECK}" = "y" ]; then
CT_DoLog EXTRA "Checking installed headers"
make -C "${CT_SRC_DIR}/${CT_KERNEL_FILE}" \
- O="`pwd`" \
+ O=$(pwd) \
ARCH=${CT_KERNEL_ARCH} \
INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \
${V_OPT} \
@@ -154,7 +154,7 @@ do_kernel_copy() {
cd "${CT_BUILD_DIR}/build-kernel-headers"
cp "${CT_KERNEL_LINUX_CONFIG_FILE}" .config
CT_DoYes "" |make -C "${CT_SRC_DIR}/${CT_KERNEL_FILE}" \
- O="`pwd`" ${V_OPT} ARCH=${CT_KERNEL_ARCH} \
+ O=$(pwd) ${V_OPT} ARCH=${CT_KERNEL_ARCH} \
oldconfig
case "${CT_KERNEL_ARCH}" in
sh*) # sh does secret stuff in 'make prepare' that can't be
@@ -166,7 +166,7 @@ do_kernel_copy() {
ARCH=${CT_KERNEL_ARCH} ${V_OPT} \
prepare include/linux/version.h
;;
- arm*|cris*) make ${PARALLELMFLAGS} \
+ arm*|cris*) make ${PARALLELMFLAGS} \
ARCH=${CT_KERNEL_ARCH} ${V_OPT} \
include/asm include/linux/version.h \
include/asm-${CT_KERNEL_ARCH}/.arch
diff --git a/scripts/build/libc_glibc.sh b/scripts/build/libc_glibc.sh
index b7410cd..2d9568a 100644
--- a/scripts/build/libc_glibc.sh
+++ b/scripts/build/libc_glibc.sh
@@ -5,7 +5,7 @@
do_print_filename() {
[ "${CT_LIBC}" = "glibc" ] || return 0
echo "glibc-${CT_LIBC_VERSION}"
- for addon in `do_libc_add_ons_list " "`; do
+ for addon in $(do_libc_add_ons_list " "); do
# NPTL addon is not to be downloaded, in any case
[ "${addon}" = "nptl" ] && continue || true
echo "glibc-${addon}-${CT_LIBC_VERSION}"
@@ -20,7 +20,7 @@ do_libc_get() {
CT_GetFile "${CT_LIBC_FILE}" {ftp,http}://ftp.gnu.org/gnu/glibc
# C library addons
- for addon in `do_libc_add_ons_list " "`; do
+ for addon in $(do_libc_add_ons_list " "); do
# NPTL addon is not to be downloaded, in any case
[ "${addon}" = "nptl" ] && continue || true
CT_GetFile "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" {ftp,http}://ftp.gnu.org/gnu/glibc
@@ -34,7 +34,7 @@ do_libc_extract() {
CT_ExtractAndPatch "${CT_LIBC_FILE}"
# C library addons
- for addon in `do_libc_add_ons_list " "`; do
+ for addon in $(do_libc_add_ons_list " "); do
# NPTL addon is not to be extracted, in any case
[ "${addon}" = "nptl" ] && continue || true
CT_ExtractAndPatch "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}"
@@ -77,15 +77,15 @@ do_libc_headers() {
# Override libc_cv_ppc_machine so glibc-cvs doesn't complain
# 'a version of binutils that supports .machine "altivec" is needed'.
- addons_config="--enable-add-ons=`do_libc_add_ons_list ,`"
+ addons_config="--enable-add-ons=$(do_libc_add_ons_list ,)"
# We need to remove any threading addon when installing headers
addons_config="${addons_config//nptl/}"
addons_config="${addons_config//linuxthreads/}"
- addons_config=`echo "${addons_config}" |sed -r -e 's/^,+//; s/,+$//; s/,+/,/g;'`
+ addons_config=$(echo "${addons_config}" |sed -r -e 's/^,+//; s/,+$//; s/,+/,/g;')
- cross_cc=`CT_Which "${CT_TARGET}-gcc"`
- CT_DoLog DEBUG "Using gcc for target: \"${cross_cc}\""
- CT_DoLog DEBUG "Extra config passed : \"${addons_config}\""
+ cross_cc=$(CT_Which "${CT_TARGET}-gcc")
+ CT_DoLog DEBUG "Using gcc for target: '${cross_cc}'"
+ CT_DoLog DEBUG "Extra config passed : '${addons_config}'"
libc_cv_ppc_machine=yes \
CC=${cross_cc} \
@@ -196,7 +196,7 @@ do_libc_start_files() {
extra_config=""
case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
*enable-kernel*) ;;
- *) extra_config="${extra_config} --enable-kernel=`echo ${CT_KERNEL_VERSION} |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;'`"
+ *) extra_config="${extra_config} --enable-kernel=$(echo ${CT_KERNEL_VERSION} |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;')"
esac
case "${CT_LIBC_GLIBC_EXTRA_CONFIG}" in
*-tls*) ;;
@@ -213,7 +213,7 @@ do_libc_start_files() {
# Obviously, we want threads, as we come here only for NPTL
extra_config="${extra_config} --with-__thread"
- addons_config="--enable-add-ons=`do_libc_add_ons_list ,`"
+ addons_config="--enable-add-ons=$(do_libc_add_ons_list ,)"
extra_config="${extra_config} ${addons_config}"
# Add some default CC args
@@ -229,11 +229,11 @@ do_libc_start_files() {
fi
extra_cc_args="${extra_cc_args} ${CT_ARCH_ENDIAN_OPT}"
- cross_cc=`CT_Which "${CT_TARGET}-gcc"`
- CT_DoLog DEBUG "Using gcc for target : \"${cross_cc}\""
- CT_DoLog DEBUG "Configuring with addons : \"`do_libc_add_ons_list ,`\""
- CT_DoLog DEBUG "Extra config args passed: \"${extra_config}\""
- CT_DoLog DEBUG "Extra CC args passed : \"${extra_cc_args}\""
+ cross_cc=$(CT_Which "${CT_TARGET}-gcc")
+ CT_DoLog DEBUG "Using gcc for target : '${cross_cc}'"
+ CT_DoLog DEBUG "Configuring with addons : '$(do_libc_add_ons_list ,)'"
+ CT_DoLog DEBUG "Extra config args passed: '${extra_config}'"
+ CT_DoLog DEBUG "Extra CC args passed : '${extra_cc_args}'"
# Super-H really needs to set configparms as of gcc-3.4/glibc-2.3.2
# note: this is awkward, doesn't work well if you need more than one
@@ -292,7 +292,7 @@ do_libc() {
# We don't need to be conditional on wether the user did set different
# values, as they CT_LIBC_GLIBC_EXTRA_CONFIG is passed after extra_config
- extra_config="--enable-kernel=`echo ${CT_KERNEL_VERSION} |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;'`"
+ extra_config="--enable-kernel=$(echo ${CT_KERNEL_VERSION} |sed -r -e 's/^([^.]+\.[^.]+\.[^.]+)(|\.[^.]+)$/\1/;')"
case "${CT_THREADS}" in
nptl) extra_config="${extra_config} --with-__thread --with-tls";;
@@ -315,9 +315,9 @@ do_libc() {
,y) extra_config="${extra_config} --without-fp";;
esac
- case "`do_libc_add_ons_list ,`" in
+ case "$(do_libc_add_ons_list ,)" in
"") ;;
- *) extra_config="${extra_config} --enable-add-ons=`do_libc_add_ons_list ,`";;
+ *) extra_config="${extra_config} --enable-add-ons=$(do_libc_add_ons_list ,)";;
esac
@@ -334,11 +334,11 @@ do_libc() {
fi
extra_cc_args="${extra_cc_args} ${CT_ARCH_ENDIAN_OPT}"
- cross_cc=`CT_Which "${CT_TARGET}-gcc"`
- CT_DoLog DEBUG "Using gcc for target : \"${cross_cc}\""
- CT_DoLog DEBUG "Configuring with addons : \"`do_libc_add_ons_list ,`\""
- CT_DoLog DEBUG "Extra config args passed: \"${extra_config}\""
- CT_DoLog DEBUG "Extra CC args passed : \"${extra_cc_args}\""
+ cross_cc=$(CT_Which "${CT_TARGET}-gcc")
+ CT_DoLog DEBUG "Using gcc for target : '${cross_cc}'"
+ CT_DoLog DEBUG "Configuring with addons : '$(do_libc_add_ons_list ,)'"
+ CT_DoLog DEBUG "Extra config args passed: '${extra_config}'"
+ CT_DoLog DEBUG "Extra CC args passed : '${extra_cc_args}'"
# sh3 and sh4 really need to set configparms as of gcc-3.4/glibc-2.3.2
# note: this is awkward, doesn't work well if you need more than one line in configparms
@@ -446,7 +446,7 @@ do_libc() {
for dir in lib lib64 usr/lib usr/lib64; do
if [ -f "${CT_SYSROOT_DIR}/${dir}/${file}" -a ! -L ${CT_SYSROOT_DIR}/$lib/$file ]; then
cp "${CT_SYSROOT_DIR}/${dir}/${file}" "${CT_SYSROOT_DIR}/${dir}/${file}_orig"
- CT_DoLog DEBUG "Fixing \"${CT_SYS_ROOT_DIR}/${dir}/${file}\""
+ CT_DoLog DEBUG "Fixing '${CT_SYS_ROOT_DIR}/${dir}/${file}'"
sed -i -r -e 's,/usr/lib/,,g;
s,/usr/lib64/,,g;
s,/lib/,,g;
@@ -488,7 +488,7 @@ do_libc_finish() {
# Build up the addons list, separated with $1
do_libc_add_ons_list() {
local sep="$1"
- local addons_list=`echo "${CT_LIBC_ADDONS_LIST//,/${sep}}" |tr -s ,`
+ local addons_list=$(echo "${CT_LIBC_ADDONS_LIST//,/${sep}}" |tr -s ,)
case "${CT_THREADS}" in
none) ;;
*) addons_list="${addons_list}${sep}${CT_THREADS}";;
diff --git a/scripts/build/libc_uClibc.sh b/scripts/build/libc_uClibc.sh
index 42ac5d9..41dc62f 100644
--- a/scripts/build/libc_uClibc.sh
+++ b/scripts/build/libc_uClibc.sh
@@ -218,8 +218,8 @@ ENDSED
# From http://www.uclibc.org/cgi-bin/viewcvs.cgi?rev=16846&view=rev
# " we just want the kernel headers, not the whole kernel source ...
# " so people may need to update their paths slightly
- quoted_kernel_source=`echo "${CT_HEADERS_DIR}" | sed -r -e 's,/include/?$,,; s,/,\\\\/,g;'`
- quoted_headers_dir=`echo ${CT_HEADERS_DIR} | sed -r -e 's,/,\\\\/,g;'`
+ quoted_kernel_source=$(echo "${CT_HEADERS_DIR}" | sed -r -e 's,/include/?$,,; s,/,\\/,g;')
+ quoted_headers_dir=$(echo "${CT_HEADERS_DIR}" | sed -r -e 's,/,\\/,g;')
# CROSS_COMPILER_PREFIX is left as is, as the CROSS parameter is forced on the command line
# DEVEL_PREFIX is left as '/usr/' because it is post-pended to $PREFIX, wich is the correct value of ${PREFIX}/${TARGET}
# Some (old) versions of uClibc use KERNEL_SOURCE (which is _wrong_), and
diff --git a/scripts/build/tools/200-sstrip.sh b/scripts/build/tools/200-sstrip.sh
index 5afdcb0..5be5b40 100644
--- a/scripts/build/tools/200-sstrip.sh
+++ b/scripts/build/tools/200-sstrip.sh
@@ -42,24 +42,24 @@ case "${CT_SSTRIP_FROM}" in
return 0
fi
if [ -f "${CT_LOCAL_TARBALLS_DIR}/sstrip.c" ]; then
- CT_DoLog EXTRA "Using \"sstrip\" from local storage"
+ CT_DoLog EXTRA "Using 'sstrip' from local storage"
ln -sf "${CT_LOCAL_TARBALLS_DIR}/sstrip.c" \
"${CT_TARBALLS_DIR}/sstrip.c" 2>&1 |CT_DoLog ALL
return 0
fi
CT_Pushd "${CT_TARBALLS_DIR}"
- CT_DoLog EXTRA "Retrieving \"sstrip\" from network"
- http_data=`lynx -dump "${sstrip_url}"`
- link=`echo -en "${http_data}" \
+ CT_DoLog EXTRA "Retrieving 'sstrip' from network"
+ http_data=$(lynx -dump "${sstrip_url}")
+ link=$(echo -en "${http_data}" \
|egrep '\[[[:digit:]]+\]download' \
- |sed -r -e 's/.*\[([[:digit:]]+)\]download.*/\1/;'`
- rev_url=`echo -en "${http_data}" \
+ |sed -r -e 's/.*\[([[:digit:]]+)\]download.*/\1/;')
+ rev_url=$(echo -en "${http_data}" \
|egrep '^ *8\.' \
- |sed -r -e 's/^ *'${link}'\. +(.+)$/\1/;'`
+ |sed -r -e 's/^ *'${link}'\. +(.+)$/\1/;')
CT_DoGetFile "${rev_url}" 2>&1 |CT_DoLog ALL
mv -v sstrip.c?* sstrip.c 2>&1 |CT_DoLog DEBUG
if [ "${CT_SAVE_TARBALLS}" = "y" ]; then
- CT_DoLog EXTRA "Saving \"sstrip.c\" to local storage"
+ CT_DoLog EXTRA "Saving 'sstrip.c' to local storage"
cp -v sstrip.c "${CT_LOCAL_TARBALLS_DIR}" 2>&1 |CT_DoLog DEBUG
fi
CT_Popd
diff --git a/scripts/crosstool.sh b/scripts/crosstool.sh
index 529e553..5f5b497 100755
--- a/scripts/crosstool.sh
+++ b/scripts/crosstool.sh
@@ -20,8 +20,8 @@
# - initialise logging.
. "${CT_LIB_DIR}/scripts/functions"
-CT_STAR_DATE=`CT_DoDate +%s%N`
-CT_STAR_DATE_HUMAN=`CT_DoDate +%Y%m%d.%H%M%S`
+CT_STAR_DATE=$(CT_DoDate +%s%N)
+CT_STAR_DATE_HUMAN=$(CT_DoDate +%Y%m%d.%H%M%S)
# Are we configured? We'll need that later...
CT_TestOrAbort "Configuration file not found. Please create one." -f "${CT_TOP_DIR}/.config"
@@ -104,12 +104,12 @@ if [ -n "${CT_RESTART}" -a ! -d "${CT_STATE_DIR}" ]; then
fi
# Make all path absolute, it so much easier!
-CT_LOCAL_TARBALLS_DIR="`CT_MakeAbsolutePath \"${CT_LOCAL_TARBALLS_DIR}\"`"
+CT_LOCAL_TARBALLS_DIR=$(CT_MakeAbsolutePath "${CT_LOCAL_TARBALLS_DIR}")
# If the local tarball directory does not exist, say so, and don't try to save there!
if [ ! -d "${CT_LOCAL_TARBALLS_DIR}" ]; then
- CT_DoLog WARN "Directory \"${CT_LOCAL_TARBALLS_DIR}\" does not exist. Will not save downloaded tarballs to local storage."
- CT_SAVE_TARBALLS=""
+ CT_DoLog WARN "Directory '${CT_LOCAL_TARBALLS_DIR}' does not exist. Will not save downloaded tarballs to local storage."
+ CT_SAVE_TARBALLS=
fi
# Some more sanity checks now that we have all paths set up
@@ -119,23 +119,23 @@ esac
# Check now if we can write to the destination directory:
if [ -d "${CT_INSTALL_DIR}" ]; then
- CT_TestAndAbort "Destination directory \"${CT_INSTALL_DIR}\" is not removable" ! -w `dirname "${CT_INSTALL_DIR}"`
+ CT_TestAndAbort "Destination directory '${CT_INSTALL_DIR}' is not removable" ! -w $(dirname "${CT_INSTALL_DIR}")
fi
# Good, now grab a bit of informations on the system we're being run on,
# just in case something goes awok, and it's not our fault:
-CT_SYS_USER="`id -un`"
-CT_SYS_HOSTNAME=`hostname -f 2>/dev/null || true`
+CT_SYS_USER=$(id -un)
+CT_SYS_HOSTNAME=$(hostname -f 2>/dev/null || true)
# Hmmm. Some non-DHCP-enabled machines do not have an FQDN... Fall back to node name.
-CT_SYS_HOSTNAME="${CT_SYS_HOSTNAME:-`uname -n`}"
-CT_SYS_KERNEL=`uname -s`
-CT_SYS_REVISION=`uname -r`
+CT_SYS_HOSTNAME="${CT_SYS_HOSTNAME:-$(uname -n)}"
+CT_SYS_KERNEL=$(uname -s)
+CT_SYS_REVISION=$(uname -r)
# MacOS X lacks '-o' :
-CT_SYS_OS=`uname -o || echo "Unknown (maybe MacOS-X)"`
-CT_SYS_MACHINE=`uname -m`
-CT_SYS_PROCESSOR=`uname -p`
-CT_SYS_GCC=`gcc -dumpversion`
-CT_SYS_TARGET=`CT_DoConfigGuess`
+CT_SYS_OS=$(uname -o || echo "Unknown (maybe MacOS-X)")
+CT_SYS_MACHINE=$(uname -m)
+CT_SYS_PROCESSOR=$(uname -p)
+CT_SYS_GCC=$(gcc -dumpversion)
+CT_SYS_TARGET=$(CT_DoConfigGuess)
CT_TOOLCHAIN_ID="crosstool-${CT_VERSION} build ${CT_STAR_DATE_HUMAN} by ${CT_SYS_USER}@${CT_SYS_HOSTNAME}"
CT_DoLog EXTRA "Preparing working directories"
@@ -315,8 +315,8 @@ esac
if [ -z "${CT_RESTART}" ]; then
# Determine build system if not set by the user
CT_Test "You did not specify the build system. That's OK, I can guess..." -z "${CT_BUILD}"
- CT_BUILD="${CT_BUILD:-`CT_DoConfigGuess`}"
- CT_BUILD=`CT_DoConfigSub "${CT_BUILD}"`
+ CT_BUILD="${CT_BUILD:-$(CT_DoConfigGuess)}"
+ CT_BUILD=$(CT_DoConfigSub "${CT_BUILD}")
# Arrange paths depending on wether we use sys-root or not.
if [ "${CT_USE_SYSROOT}" = "y" ]; then
@@ -352,7 +352,7 @@ if [ -z "${CT_RESTART}" ]; then
mkdir -p "${CT_SYSROOT_DIR}/usr/lib"
# Canadian-cross are really picky on the way they are built. Tweak the values.
- CT_UNIQ_BUILD=`echo "${CT_BUILD}" |sed -r -e 's/-/-build_/'`
+ CT_UNIQ_BUILD=$(echo "${CT_BUILD}" |sed -r -e 's/-/-build_/')
if [ "${CT_CANADIAN}" = "y" ]; then
# Arrange so that gcc never, ever think that build system == host system
CT_CANADIAN_OPT="--build=${CT_UNIQ_BUILD}"
@@ -383,7 +383,7 @@ if [ -z "${CT_RESTART}" ]; then
# (Copied almost as-is from original crosstool):
case "${CT_KERNEL},${CT_CANADIAN}" in
cygwin,y) ;;
- *,y) CT_HOST="`echo \"${CT_HOST}\" |sed -r -e 's/-/-host_/;'`";;
+ *,y) CT_HOST=$(echo "${CT_HOST}" |sed -r -e 's/-/-host_/;');;
esac
# Ah! Recent versions of binutils need some of the build and/or host system
@@ -392,7 +392,7 @@ if [ -z "${CT_RESTART}" ]; then
CT_DoLog DEBUG "Making build system tools available"
mkdir -p "${CT_PREFIX_DIR}/bin"
for tool in ar as dlltool ${CT_CC_NATIVE:=gcc} gnatbind gnatmake ld nm ranlib strip windres objcopy objdump; do
- tmp=`CT_Which ${tool}`
+ tmp=$(CT_Which ${tool})
if [ -n "${tmp}" ]; then
ln -sfv "${tmp}" "${CT_PREFIX_DIR}/bin/${CT_BUILD}-${tool}"
ln -sfv "${tmp}" "${CT_PREFIX_DIR}/bin/${CT_UNIQ_BUILD}-${tool}"
@@ -480,7 +480,7 @@ if [ "${CT_ONLY_DOWNLOAD}" != "y" -a "${CT_ONLY_EXTRACT}" != "y" ]; then
else
CT_DoSaveState ${step}
if [ ${do_stop} -eq 1 ]; then
- CT_DoLog ERROR "Stopping just after step \"${prev_step}\", as requested."
+ CT_DoLog ERROR "Stopping just after step '${prev_step}', as requested."
exit 0
fi
fi
@@ -490,7 +490,7 @@ if [ "${CT_ONLY_DOWNLOAD}" != "y" -a "${CT_ONLY_EXTRACT}" != "y" ]; then
do_stop=1
fi
if [ "${CTDEBUG_CT_PAUSE_STEPS}" = "y" ]; then
- CT_DoPause "Step \"${step}\" finished"
+ CT_DoPause "Step '${step}' finished"
fi
fi
prev_step="${step}"
@@ -513,13 +513,13 @@ if [ "${CT_ONLY_DOWNLOAD}" != "y" -a "${CT_ONLY_EXTRACT}" != "y" ]; then
CT_Pushd "${CT_PREFIX_DIR}/bin"
for t in "${CT_TARGET}-"*; do
if [ -n "${CT_TARGET_ALIAS}" ]; then
- _t="`echo \"$t\" |sed -r -e 's/^'\"${CT_TARGET}\"'-/'\"${CT_TARGET_ALIAS}\"'-/;'`"
- CT_DoLog DEBUG "Linking \"${_t}\" -> \"${t}\""
+ _t=$(echo "$t" |sed -r -e 's/^'"${CT_TARGET}"'-/'"${CT_TARGET_ALIAS}"'-/;')
+ CT_DoLog DEBUG "Linking '${_t}' -> '${t}'"
ln -sv "${t}" "${_t}" 2>&1 |CT_DoLog ALL
fi
if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then
- _t="`echo \"$t\" |sed -r -e \"${CT_TARGET_ALIAS_SED_EXPR}\"`"
- CT_DoLog DEBUG "Linking \"${_t}\" -> \"${t}\""
+ _t=$(echo "$t" |sed -r -e "${CT_TARGET_ALIAS_SED_EXPR}")
+ CT_DoLog DEBUG "Linking '${_t}' -> '${t}'"
ln -sv "${t}" "${_t}" 2>&1 |CT_DoLog ALL
fi
done
diff --git a/scripts/functions b/scripts/functions
index 2779c4c..e4f6107 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -5,15 +5,15 @@
# Prepare the fault handler
CT_OnError() {
ret=$?
- CT_DoLog ERROR "Build failed in step \"${CT_STEP_MESSAGE[${CT_STEP_COUNT}]}\""
+ CT_DoLog ERROR "Build failed in step '${CT_STEP_MESSAGE[${CT_STEP_COUNT}]}'"
for((step=(CT_STEP_COUNT-1); step>1; step--)); do
- CT_DoLog ERROR " called in step \"${CT_STEP_MESSAGE[${step}]}\""
+ CT_DoLog ERROR " called in step '${CT_STEP_MESSAGE[${step}]}'"
done
- CT_DoLog ERROR "Error happened in \"${BASH_SOURCE[1]}\" in function \"${FUNCNAME[1]}\" (line unknown, sorry)"
+ CT_DoLog ERROR "Error happened in '${BASH_SOURCE[1]}' in function '${FUNCNAME[1]}' (line unknown, sorry)"
for((depth=2; ${BASH_LINENO[$((${depth}-1))]}>0; depth++)); do
- CT_DoLog ERROR " called from \"${BASH_SOURCE[${depth}]}\" at line # ${BASH_LINENO[${depth}-1]} in function \"${FUNCNAME[${depth}]}\""
+ CT_DoLog ERROR " called from '${BASH_SOURCE[${depth}]}' at line # ${BASH_LINENO[${depth}-1]} in function '${FUNCNAME[${depth}]}'"
done
- [ "${CT_LOG_TO_FILE}" = "y" ] && CT_DoLog ERROR "Look at \"${CT_LOG_FILE}\" for more info on this error."
+ [ "${CT_LOG_TO_FILE}" = "y" ] && CT_DoLog ERROR "Look at '${CT_LOG_FILE}' for more info on this error."
CT_STEP_COUNT=1
CT_DoEnd ERROR
exit $ret
@@ -75,7 +75,11 @@ CT_DoLog() {
else
echo "${1}"
fi |( IFS="\n" # We want the full lines, even leading spaces
- CT_PROG_BAR_CPT=0
+ _prog_bar_cpt=0
+ _prog_bar[0]='/'
+ _prog_bar[1]='-'
+ _prog_bar[2]='\'
+ _prog_bar[3]='|'
indent=$((2*CT_STEP_COUNT))
while read line; do
case "${CT_LOG_SEE_TOOLS_WARN},${line}" in
@@ -85,19 +89,15 @@ CT_DoLog() {
*"make["?*"]:"*"Stop.") cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};;
*) cur_L="${LEVEL}"; cur_l="${level}";;
esac
- l="`printf \"[%-5s]%*s%s%s\" \"${cur_L}\" \"${indent}\" \" \" \"${line}\"`"
- # There will always be a log file, be it /dev/null
- echo -e "${l}"
+ # There will always be a log file (stdout, fd #1), be it /dev/null
+ printf "[%-5s]%*s%s%s\n" "${cur_L}" "${indent}" " " "${line}"
if [ ${cur_l} -le ${max_level} ]; then
- echo -e "\r${l}" >&6
+ # Only print to console (fd #6) if log level is high enough.
+ printf "\r[%-5s]%*s%s%s\n" "${cur_L}" "${indent}" " " "${line}" >&6
fi
if [ "${CT_LOG_PROGRESS_BAR}" = "y" ]; then
- [ ${CT_PROG_BAR_CPT} -eq 0 ] && bar="/"
- [ ${CT_PROG_BAR_CPT} -eq 10 ] && bar="-"
- [ ${CT_PROG_BAR_CPT} -eq 20 ] && bar="\\"
- [ ${CT_PROG_BAR_CPT} -eq 30 ] && bar="|"
- printf "\r[%02d:%02d] %s " $((SECONDS/60)) $((SECONDS%60)) "${bar}" >&6
- CT_PROG_BAR_CPT=$(((CT_PROG_BAR_CPT+1)%40))
+ printf "\r[%02d:%02d] %s " $((SECONDS/60)) $((SECONDS%60)) "${_prog_bar[$((_prog_bar_cpt/10))]}" >&6
+ _prog_bar_cpt=$(((_prog_bar_cpt+1)%40))
fi
done
)
@@ -110,13 +110,13 @@ CT_DoLog() {
CT_DoEnd()
{
local level="$1"
- CT_STOP_DATE=`CT_DoDate +%s%N`
- CT_STOP_DATE_HUMAN=`CT_DoDate +%Y%m%d.%H%M%S`
+ CT_STOP_DATE=$(CT_DoDate +%s%N)
+ CT_STOP_DATE_HUMAN=$(CT_DoDate +%Y%m%d.%H%M%S)
CT_DoLog "${level:-INFO}" "Build completed at ${CT_STOP_DATE_HUMAN}"
elapsed=$((CT_STOP_DATE-CT_STAR_DATE))
elapsed_min=$((elapsed/(60*1000*1000*1000)))
- elapsed_sec=`printf "%02d" $(((elapsed%(60*1000*1000*1000))/(1000*1000*1000)))`
- elapsed_csec=`printf "%02d" $(((elapsed%(1000*1000*1000))/(10*1000*1000)))`
+ elapsed_sec=$(printf "%02d" $(((elapsed%(60*1000*1000*1000))/(1000*1000*1000))))
+ elapsed_csec=$(printf "%02d" $(((elapsed%(1000*1000*1000))/(10*1000*1000))))
CT_DoLog ${level:-INFO} "(elapsed: ${elapsed_min}:${elapsed_sec}.${elapsed_csec})"
}
@@ -158,7 +158,7 @@ CT_TestOrAbort() {
# Test the presence of a tool, or abort if not found
# Usage: CT_HasOrAbort <tool>
CT_HasOrAbort() {
- CT_TestAndAbort "\"${1}\" not found and needed for successful toolchain build." -z "`CT_Which \"${1}\"`"
+ CT_TestAndAbort "'${1}' not found and needed for successful toolchain build." -z ""$(CT_Which "${1}")
return 0
}
@@ -183,7 +183,7 @@ CT_STEP_MESSAGE[${CT_STEP_COUNT}]="<none>"
# Memorise a step being done so that any error is caught
# Usage: CT_DoStep <loglevel> <message>
CT_DoStep() {
- local start=`CT_DoDate +%s%N`
+ local start=$(CT_DoDate +%s%N)
CT_DoLog "$1" "================================================================="
CT_DoLog "$1" "$2"
CT_STEP_COUNT=$((CT_STEP_COUNT+1))
@@ -196,8 +196,8 @@ CT_DoStep() {
# End the step just being done
# Usage: CT_EndStep
CT_EndStep() {
- local stop=`CT_DoDate +%s%N`
- local duration=`printf "%032d" $((stop-${CT_STEP_START[${CT_STEP_COUNT}]})) |sed -r -e 's/([[:digit:]]{2})[[:digit:]]{7}$/\.\1/; s/^0+//; s/^\./0\./;'`
+ local stop=$(CT_DoDate +%s%N)
+ local duration=$(printf "%032d" $((stop-${CT_STEP_START[${CT_STEP_COUNT}]})) |sed -r -e 's/([[:digit:]]{2})[[:digit:]]{7}$/\.\1/; s/^0+//; s/^\./0\./;')
local level="${CT_STEP_LEVEL[${CT_STEP_COUNT}]}"
local message="${CT_STEP_MESSAGE[${CT_STEP_COUNT}]}"
CT_STEP_COUNT=$((CT_STEP_COUNT-1))
@@ -225,7 +225,7 @@ CT_MakeAbsolutePath() {
# No such directory, fail back to guessing
case "$1" in
/*) echo "$1";;
- *) echo "`pwd`/$1";;
+ *) echo "$(pwd)/$1";;
esac
fi
@@ -237,7 +237,7 @@ CT_MakeAbsolutePath() {
# Usage: CT_MktempDir foo
CT_MktempDir() {
# Some mktemp do not allow more than 6 Xs
- eval "$1"="`mktemp -q -d \"${CT_BUILD_DIR}/.XXXXXX\"`"
+ eval "$1"=$(mktemp -q -d "${CT_BUILD_DIR}/.XXXXXX")
CT_TestOrAbort "Could not make temporary directory" -n "${!1}" -a -d "${!1}"
}
@@ -302,8 +302,8 @@ CT_DoGetFileCurl() {
|| true
}
-_wget=`CT_Which wget`
-_curl=`CT_Which curl`
+_wget=$(CT_Which wget)
+_curl=$(CT_Which curl)
# Wrapper function to call one of curl or wget
# Usage: CT_DoGetFile <URL>
CT_DoGetFile() {
@@ -330,9 +330,9 @@ CT_GetFile() {
esac
# Do we already have it?
- ext=`CT_GetFileExtension "${file}"`
+ ext=$(CT_GetFileExtension "${file}")
if [ -n "${ext}" ]; then
- CT_DoLog DEBUG "Already have \"${file}\""
+ CT_DoLog DEBUG "Already have '${file}'"
return 0
fi
@@ -341,27 +341,27 @@ CT_GetFile() {
# or, as a failover, a file without extension.
# Try local copy first, if it exists
for ext in ${first_ext} .tar.bz2 .tar.gz .tgz .tar ''; do
- CT_DoLog DEBUG "Trying \"${CT_LOCAL_TARBALLS_DIR}/${file}${ext}\""
+ CT_DoLog DEBUG "Trying '${CT_LOCAL_TARBALLS_DIR}/${file}${ext}'"
if [ -r "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" -a \
"${CT_FORCE_DOWNLOAD}" != "y" ]; then
- CT_DoLog EXTRA "Using \"${file}\" from local storage"
+ CT_DoLog EXTRA "Using '${file}' from local storage"
ln -sv "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" "${file}${ext}" |CT_DoLog ALL
return 0
fi
done
# Try to download it
- CT_DoLog EXTRA "Retrieving \"${file}\" from network"
+ CT_DoLog EXTRA "Retrieving '${file}' from network"
for ext in ${first_ext} .tar.bz2 .tar.gz .tgz .tar ''; do
# Try all urls in turn
for url in "$@"; do
- CT_DoLog DEBUG "Trying \"${url}/${file}${ext}\""
+ CT_DoLog DEBUG "Trying '${url}/${file}${ext}'"
CT_DoGetFile "${url}/${file}${ext}"
if [ -f "${file}${ext}" ]; then
# No need to test if the file already exists because
# it does NOT. If it did exist, we'd have been stopped
# above, when looking for local copies.
if [ "${CT_SAVE_TARBALLS}" = "y" ]; then
- CT_DoLog EXTRA "Saving \"${file}\" to local storage"
+ CT_DoLog EXTRA "Saving '${file}' to local storage"
mv "${file}${ext}" "${CT_LOCAL_TARBALLS_DIR}" |CT_DoLog ALL
ln -sv "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" "${file}${ext}" |CT_DoLog ALL
fi
@@ -371,7 +371,7 @@ CT_GetFile() {
done
CT_Popd
- CT_Abort "Could not download \"${file}\", and not present in \"${CT_LOCAL_TARBALLS_DIR}\""
+ CT_Abort "Could not download '${file}', and not present in '${CT_LOCAL_TARBALLS_DIR}'"
}
# Extract a tarball and patch the resulting sources if necessary.
@@ -380,13 +380,13 @@ CT_GetFile() {
# in the extra/locale sub-directory of uClibc.
CT_ExtractAndPatch() {
local file="$1"
- local base_file=`echo "${file}" |cut -d - -f 1`
- local ver_file=`echo "${file}" |cut -d - -f 2-`
+ local base_file=$(echo "${file}" |cut -d - -f 1)
+ local ver_file=$(echo "${file}" |cut -d - -f 2-)
local official_patch_dir
local custom_patch_dir
local libc_addon
- local ext=`CT_GetFileExtension "${file}"`
- CT_TestAndAbort "\"${file}\" not found in \"${CT_TARBALLS_DIR}\"" -z "${ext}"
+ local ext=$(CT_GetFileExtension "${file}")
+ CT_TestAndAbort "'${file}' not found in '${CT_TARBALLS_DIR}'" -z "${ext}"
local full_file="${CT_TARBALLS_DIR}/${file}${ext}"
CT_Pushd "${CT_SRC_DIR}"
@@ -394,14 +394,14 @@ CT_ExtractAndPatch() {
# Add-ons need a little love, really.
case "${file}" in
glibc-[a-z]*-*)
- CT_TestAndAbort "Trying to extract the C-library addon/locales \"${file}\" when C-library not yet extracted" ! -d "${CT_LIBC_FILE}"
+ CT_TestAndAbort "Trying to extract the C-library addon/locales '${file}' when C-library not yet extracted" ! -d "${CT_LIBC_FILE}"
cd "${CT_LIBC_FILE}"
libc_addon=y
[ -f ".${file}.extracted" ] && return 0
touch ".${file}.extracted"
;;
uClibc-locale-*)
- CT_TestAndAbort "Trying to extract the C-library addon/locales \"${file}\" when C-library not yet extracted" ! -d "${CT_LIBC_FILE}"
+ CT_TestAndAbort "Trying to extract the C-library addon/locales '${file}' when C-library not yet extracted" ! -d "${CT_LIBC_FILE}"
cd "${CT_LIBC_FILE}/extra/locale"
libc_addon=y
[ -f ".${file}.extracted" ] && return 0
@@ -411,16 +411,16 @@ CT_ExtractAndPatch() {
# If the directory exists, then consider extraction and patching done
if [ -d "${file}" ]; then
- CT_DoLog DEBUG "Already extracted \"${file}\""
+ CT_DoLog DEBUG "Already extracted '${file}'"
return 0
fi
- CT_DoLog EXTRA "Extracting \"${file}\""
+ CT_DoLog EXTRA "Extracting '${file}'"
case "${ext}" in
.tar.bz2) tar xvjf "${full_file}" |CT_DoLog ALL;;
.tar.gz|.tgz) tar xvzf "${full_file}" |CT_DoLog ALL;;
.tar) tar xvf "${full_file}" |CT_DoLog ALL;;
- *) CT_Abort "Don't know how to handle \"${file}\": unknown extension" ;;
+ *) CT_Abort "Don't know how to handle '${file}': unknown extension" ;;
esac
# Snapshots might not have the version number in the extracted directory
@@ -428,23 +428,23 @@ CT_ExtractAndPatch() {
# Overcome this issue by symlink'ing the directory.
if [ ! -d "${file}" -a "${libc_addon}" != "y" ]; then
case "${ext}" in
- .tar.bz2) base=`tar tjf "${full_file}" |head -n 1 |cut -d / -f 1 || true`;;
- .tar.gz|.tgz) base=`tar tzf "${full_file}" |head -n 1 |cut -d / -f 1 || true`;;
- .tar) base=`tar tf "${full_file}" |head -n 1 |cut -d / -f 1 || true`;;
+ .tar.bz2) base=$(tar tjf "${full_file}" |head -n 1 |cut -d / -f 1 || true);;
+ .tar.gz|.tgz) base=$(tar tzf "${full_file}" |head -n 1 |cut -d / -f 1 || true);;
+ .tar) base=$(tar tf "${full_file}" |head -n 1 |cut -d / -f 1 || true);;
esac
- CT_TestOrAbort "There was a problem when extracting \"${file}\"" -d "${base}" -o "${base}" != "${file}"
+ CT_TestOrAbort "There was a problem when extracting '${file}'" -d "${base}" -o "${base}" != "${file}"
ln -s "${base}" "${file}"
fi
# Kludge: outside this function, we wouldn't know if we had just extracted
# a libc addon, or a plain package. Apply patches now.
- CT_DoLog EXTRA "Patching \"${file}\""
+ CT_DoLog EXTRA "Patching '${file}'"
if [ "${libc_addon}" = "y" ]; then
# Some addon tarballs directly contain the correct addon directory,
# while others have the addon directory named after the tarball.
# Fix that by always using the short name (eg: linuxthreads, ports, etc...)
- addon_short_name=`echo "${file}" |sed -r -e 's/^[^-]+-//; s/-[^-]+$//;'`
+ addon_short_name=$(echo "${file}" |sed -r -e 's/^[^-]+-//; s/-[^-]+$//;')
[ -d "${addon_short_name}" ] || ln -s "${file}" "${addon_short_name}"
# If libc addon, we're already in the correct place
else
@@ -459,9 +459,9 @@ CT_ExtractAndPatch() {
if [ -n "${patch_dir}" -a -d "${patch_dir}" ]; then
for p in "${patch_dir}"/*.patch; do
if [ -f "${p}" ]; then
- CT_DoLog DEBUG "Applying patch \"${p}\""
+ CT_DoLog DEBUG "Applying patch '${p}'"
patch -g0 -F1 -p1 -f <"${p}" |CT_DoLog ALL
- CT_TestAndAbort "Failed while applying patch file \"${p}\"" ${PIPESTATUS[0]} -ne 0
+ CT_TestAndAbort "Failed while applying patch file '${p}'" ${PIPESTATUS[0]} -ne 0
fi
done
fi
@@ -542,7 +542,7 @@ CT_DoBuildTargetTuple() {
case "${CT_KERNEL}" in
linux*) CT_TARGET_KERNEL=linux;;
esac
- CT_TARGET=`CT_DoConfigSub "${CT_TARGET_ARCH}-${CT_TARGET_VENDOR:-unknown}-${CT_TARGET_KERNEL}-${CT_TARGET_SYS}"`
+ CT_TARGET=$(CT_DoConfigSub "${CT_TARGET_ARCH}-${CT_TARGET_VENDOR:-unknown}-${CT_TARGET_KERNEL}-${CT_TARGET_SYS}")
# Prepare the target CFLAGS
CT_ARCH_TARGET_CFLAGS="${CT_ARCH_ARCH_CFLAG}"
@@ -560,7 +560,7 @@ CT_DoPause() {
local foo
local message="${1:-Pausing for your pleasure}"
CT_DoLog INFO "${message}"
- read -p "Press \"Enter\" to continue, or Ctrl-C to stop..." foo >&6
+ read -p "Press 'Enter' to continue, or Ctrl-C to stop..." foo >&6
return 0
}
@@ -572,7 +572,7 @@ CT_DoSaveState() {
local state_name="$1"
local state_dir="${CT_STATE_DIR}/${state_name}"
- CT_DoLog DEBUG "Saving state to restart at step \"${state_name}\"..."
+ CT_DoLog DEBUG "Saving state to restart at step '${state_name}'..."
rm -rf "${state_dir}"
mkdir -p "${state_dir}"
@@ -590,17 +590,17 @@ CT_DoSaveState() {
$0 == "}" { _p = 1; }
' >"${state_dir}/env.sh"
- CT_DoLog DEBUG " Saving CT_CC_CORE_STATIC_PREFIX_DIR=\"${CT_CC_CORE_STATIC_PREFIX_DIR}\""
+ CT_DoLog DEBUG " Saving CT_CC_CORE_STATIC_PREFIX_DIR='${CT_CC_CORE_STATIC_PREFIX_DIR}'"
CT_Pushd "${CT_CC_CORE_STATIC_PREFIX_DIR}"
tar cv${tar_opt}f "${state_dir}/cc_core_static_prefix_dir.tar${tar_ext}" . |CT_DoLog DEBUG
CT_Popd
- CT_DoLog DEBUG " Saving CT_CC_CORE_SHARED_PREFIX_DIR=\"${CT_CC_CORE_SHARED_PREFIX_DIR}\""
+ CT_DoLog DEBUG " Saving CT_CC_CORE_SHARED_PREFIX_DIR='${CT_CC_CORE_SHARED_PREFIX_DIR}'"
CT_Pushd "${CT_CC_CORE_SHARED_PREFIX_DIR}"
tar cv${tar_opt}f "${state_dir}/cc_core_shared_prefix_dir.tar${tar_ext}" . |CT_DoLog DEBUG
CT_Popd
- CT_DoLog DEBUG " Saving CT_PREFIX_DIR=\"${CT_PREFIX_DIR}\""
+ CT_DoLog DEBUG " Saving CT_PREFIX_DIR='${CT_PREFIX_DIR}'"
CT_Pushd "${CT_PREFIX_DIR}"
tar cv${tar_opt}f "${state_dir}/prefix_dir.tar${tar_ext}" --exclude '*.log' . |CT_DoLog DEBUG
CT_Popd
@@ -624,13 +624,13 @@ CT_DoLoadState(){
local old_RESTART="${CT_RESTART}"
local old_STOP="${CT_STOP}"
- CT_TestOrAbort "The previous build did not reach the point where it could be restarted at \"${CT_RESTART}\"" -d "${state_dir}"
+ CT_TestOrAbort "The previous build did not reach the point where it could be restarted at '${CT_RESTART}'" -d "${state_dir}"
# We need to do something special with the log file!
if [ "${CT_LOG_TO_FILE}" = "y" ]; then
exec >"${state_dir}/tail.log"
fi
- CT_DoLog INFO "Restoring state at step \"${state_name}\", as requested."
+ CT_DoLog INFO "Restoring state at step '${state_name}', as requested."
case "${CT_DEBUG_CT_SAVE_STEPS_GZIP}" in
y) tar_opt=z; tar_ext=.gz;;
@@ -642,17 +642,17 @@ CT_DoLoadState(){
rm -rf "${CT_PREFIX_DIR}" "${CT_CC_CORE_SHARED_PREFIX_DIR}" "${CT_CC_CORE_STATIC_PREFIX_DIR}"
mkdir -p "${CT_PREFIX_DIR}" "${CT_CC_CORE_SHARED_PREFIX_DIR}" "${CT_CC_CORE_STATIC_PREFIX_DIR}"
- CT_DoLog DEBUG " Restoring CT_PREFIX_DIR=\"${CT_PREFIX_DIR}\""
+ CT_DoLog DEBUG " Restoring CT_PREFIX_DIR='${CT_PREFIX_DIR}'"
CT_Pushd "${CT_PREFIX_DIR}"
tar xv${tar_opt}f "${state_dir}/prefix_dir.tar${tar_ext}" |CT_DoLog DEBUG
CT_Popd
- CT_DoLog DEBUG " Restoring CT_CC_CORE_SHARED_PREFIX_DIR=\"${CT_CC_CORE_SHARED_PREFIX_DIR}\""
+ CT_DoLog DEBUG " Restoring CT_CC_CORE_SHARED_PREFIX_DIR='${CT_CC_CORE_SHARED_PREFIX_DIR}'"
CT_Pushd "${CT_CC_CORE_SHARED_PREFIX_DIR}"
tar xv${tar_opt}f "${state_dir}/cc_core_shared_prefix_dir.tar${tar_ext}" |CT_DoLog DEBUG
CT_Popd
- CT_DoLog DEBUG " Restoring CT_CC_CORE_STATIC_PREFIX_DIR=\"${CT_CC_CORE_STATIC_PREFIX_DIR}\""
+ CT_DoLog DEBUG " Restoring CT_CC_CORE_STATIC_PREFIX_DIR='${CT_CC_CORE_STATIC_PREFIX_DIR}'"
CT_Pushd "${CT_CC_CORE_STATIC_PREFIX_DIR}"
tar xv${tar_opt}f "${state_dir}/cc_core_static_prefix_dir.tar${tar_ext}" |CT_DoLog DEBUG
CT_Popd
diff --git a/scripts/saveSample.sh b/scripts/saveSample.sh
index 3c98f43..d990731 100755
--- a/scripts/saveSample.sh
+++ b/scripts/saveSample.sh
@@ -47,8 +47,8 @@ cp "${CT_TOP_DIR}/.config" "${CT_TOP_DIR}/samples/${CT_TARGET}/crosstool.config"
CT_DoAddFileToSample() {
source="$1"
dest="$2"
- inode_s=`ls -i "${source}"`
- inode_d=`ls -i "${dest}" 2>/dev/null || true`
+ inode_s=$(ls -i "${source}")
+ inode_d=$(ls -i "${dest}" 2>/dev/null || true)
if [ "${inode_s}" != "${inode_d}" ]; then
cp "${source}" "${dest}"
fi
diff --git a/scripts/tarball.sh.broken b/scripts/tarball.sh.broken
index 9787c21..c26ac0a 100755
--- a/scripts/tarball.sh.broken
+++ b/scripts/tarball.sh.broken
@@ -31,18 +31,18 @@ CT_DoStep DEBUG "Building list of tarballs to add"
CT_TARBALLS_DIR="${CT_TOP_DIR}/targets/tarballs"
CT_TARBALLS=""
for dir in '' tools debug; do
- CT_DoStep DEBUG "Scanning directory \"${dir}\""
+ CT_DoStep DEBUG "Scanning directory '${dir}'"
for script in "${CT_TOP_DIR}/scripts/build/${dir}/"*.sh; do
- CT_DoStep DEBUG "Testing component \"${script}\""
+ CT_DoStep DEBUG "Testing component '${script}'"
[ -n "${script}" ] || continue
unset do_print_file_name
. "${script}"
- for file in `do_print_filename`; do
- CT_DoLog DEBUG "Finding tarball for \"${file}\""
+ for file in $(do_print_filename); do
+ CT_DoLog DEBUG "Finding tarball for '${file}'"
[ -n "${file}" ] || continue
- ext=`CT_GetFileExtension "${file}"`
- CT_TestOrAbort "Missing tarball for: \"${file}\"" -f "${CT_TOP_DIR}/targets/tarballs/${file}${ext}"
- CT_DoLog DEBUG "Found \"${file}${ext}\""
+ ext=$(CT_GetFileExtension "${file}")
+ CT_TestOrAbort "Missing tarball for: '${file}'" -f "${CT_TOP_DIR}/targets/tarballs/${file}${ext}"
+ CT_DoLog DEBUG "Found '${file}${ext}'"
CT_TARBALLS="${CT_TARBALLS} ${file}${ext}"
done
CT_EndStep
@@ -57,10 +57,10 @@ mkdir -p "${CT_BUILD_DIR}"
CT_MktempDir tempdir
# Save crosstool-NG, as it is configured for the current toolchain.
-topdir=`basename "${CT_TOP_DIR}"`
+topdir=$(basename "${CT_TOP_DIR}")
CT_Pushd "${CT_TOP_DIR}/.."
-botdir=`pwd`
+botdir=$(pwd)
# Build the list of files to exclude
CT_DoLog DEBUG "Building list of files to exclude"
@@ -70,7 +70,7 @@ exclude_list="${tempdir}/${CT_TARGET}.list"
echo "${topdir}/targets/src"; \
echo "${topdir}/targets/tst"; \
echo "${topdir}/targets/*-*-*-*"; \
- for t in `ls -1 "${topdir}/targets/tarballs/"`; do \
+ for t in $(ls -1 "${topdir}/targets/tarballs/"); do \
case " ${CT_TARBALLS} " in \
*" ${t} "*) ;; \
*) echo "${topdir}/targets/tarballs/${t}";; \
diff --git a/tools/addToolVersion.sh b/tools/addToolVersion.sh
index 2c35cc7..37e6940 100755
--- a/tools/addToolVersion.sh
+++ b/tools/addToolVersion.sh
@@ -66,7 +66,7 @@ while [ $i -le $# ]; do
--copy) tool_suffix=copy;;
# Misc:
-h|--help) doHelp; exit 0;;
- -*) echo "Unknown option: \"${!i}\" (use -h/--help for help)."; exit 1;;
+ -*) echo "Unknown option: '${!i}' (use -h/--help for help)."; exit 1;;
*) VERSION="${VERSION} ${!i}";;
esac
i=$((i+1))
@@ -81,9 +81,9 @@ esac
for ver in ${VERSION}; do
unset DEP L1 L2 L3 L4 L5 FILE
- v=`echo "${ver}" |sed -r -e 's/-/_/g; s/\./_/g;'`
+ v=$(echo "${ver}" |sed -r -e 's/-/_/g; s/\./_/g;')
if [ "${cat}" = "KERNEL" ]; then
- TOOL_SUFFIX="`echo \"${tool_suffix}\" |tr [[:lower:]] [[:upper:]]`"
+ TOOL_SUFFIX=$(echo "${tool_suffix}" |tr [[:lower:]] [[:upper:]])
L1="config ${cat}_${TOOL_SUFFIX}_V_${v}\n"
L2=" bool\n"
L3=" prompt \"${ver}${prompt_suffix}\"\n"
@@ -105,7 +105,7 @@ for ver in ${VERSION}; do
[ -n "${OBS}" ] && DEP="${DEP} && OBSOLETE"
case "${DEP}" in
"") ;;
- *) L4=" depends on `echo \"${DEP}\" |sed -r -e 's/^ \\&\\& //; s/\\&/\\\\&/g;'`\n"
+ *) L4=" depends on "$(echo "${DEP}" |sed -r -e 's/^ \\&\\& //; s/\\&/\\\\&/g;')"\n"
esac
sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}${L4}"'\n\1/;
s/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L5}"'\n\1/;' "${FILE}"
diff --git a/tools/populate.in b/tools/populate.in
index 690dc5f..c21248b 100644
--- a/tools/populate.in
+++ b/tools/populate.in
@@ -39,10 +39,10 @@ while getopts ":s:d:fvh" CT_OPT; do
h) doHelp
exit 0
;;
- :) echo "$myname: \"-${OPTARG}\" takes exactly one argument."
+ :) echo "$myname: '-${OPTARG}' takes exactly one argument."
exit 1
;;
- ?) echo "$myname: unknown option \"-${OPTARG}\"."
+ ?) echo "$myname: unknown option '-${OPTARG}'."
exit 1
;;
esac
@@ -54,11 +54,11 @@ if [ -z "${CT_ROOT_SRC_DIR}" -o -z "${CT_ROOT_DST_DIR}" ]; then
exit 1
fi
if [ ! -d "${CT_ROOT_SRC_DIR}" ]; then
- echo "$myname: \"${CT_ROOT_SRC_DIR}\": no such file or directory"
+ echo "$myname: '${CT_ROOT_SRC_DIR}': no such file or directory"
exit 1
fi
if [ -d "${CT_ROOT_DST_DIR}" -a "${CT_FORCE}" != "y" ]; then
- echo "$myname: \"${CT_ROOT_DST_DIR}\": already exists"
+ echo "$myname: '${CT_ROOT_DST_DIR}': already exists"
exit 1
fi
src_inode=$(ls -di "${CT_ROOT_SRC_DIR}")
@@ -91,9 +91,9 @@ while [ ${still_needed} -eq 1 ]; do
${CT_ECHO} "Looping..."
still_needed=0
for f in $(find . -type f -exec file {} \; |egrep ': ELF [[:digit:]]+-bit .SB (executable|shared object),' |cut -d ":" -f 1); do
- ${CT_ECHO} "Scanning \"${f}\""
+ ${CT_ECHO} "Scanning '${f}'"
for libname in $("${CT_READELF}" -d "${f}" |egrep '(NEEDED)' |sed -r -e 's,.+\[(.+)\] *$,\1,;'); do
- ${CT_ECHO} " searching for \"${libname}\""
+ ${CT_ECHO} " searching for '${libname}'"
if [ -e "lib/${libname}" \
-o -e "usr/lib/${libname}" ]; then
${CT_ECHO} " already present"
@@ -101,14 +101,14 @@ while [ ${still_needed} -eq 1 ]; do
fi
# Need to scan .. for libgcc_s et al.
for dir in . usr ..; do
- ${CT_ECHO} -n " trying in \"${dir}\""
+ ${CT_ECHO} -n " trying in '${dir}'"
tgt_dir="${dir}"
[ "${tgt_dir}" = ".." ] && tgt_dir="usr"
libfile="${CT_SYSROOT_DIR}/${dir}/lib/${libname}"
- ${CT_ECHO} ": \"${libfile}\""
+ ${CT_ECHO} ": '${libfile}'"
if [ -e "${libfile}" ]; then
mkdir -p "${dir}/lib"
- ${CT_ECHO} " installing \"${tgt_dir}/lib/${libname}\""
+ ${CT_ECHO} " installing '${tgt_dir}/lib/${libname}'"
cp "${libfile}" "${tgt_dir}/lib/${libname}"
still_needed=1
break