summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-02-01 17:11:46 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-02-01 17:11:46 (GMT)
commit430ce931e1f6a02fadc77a4e214a95d85bfaaf9e (patch)
tree90d5c4b6d08ce395d4925fb1140752587577f5e5 /scripts
parent3f4bf75a274e1774e99c85ba2fe544e42e8cd5ea (diff)
Use tools discovered by ./configure in scripts/saveSample.sh
/trunk/Makefile.in | 7 6 1 0 ++++++- /trunk/scripts/saveSample.sh.in | 23 13 10 0 +++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/saveSample.sh.in (renamed from scripts/saveSample.sh)23
1 files changed, 13 insertions, 10 deletions
diff --git a/scripts/saveSample.sh b/scripts/saveSample.sh.in
index 5e20e4f..fe56311 100755
--- a/scripts/saveSample.sh
+++ b/scripts/saveSample.sh.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!@@CT_bash@@
# This script is responsible for saving the current configuration into a
# sample to be used later on as a pre-configured target.
@@ -8,6 +8,9 @@
# - the uClibc .config file if uClibc selected
# - info about who reported the sample
+# Parse the tools' paths configuration
+. "${CT_LIB_DIR}/paths.mk"
+
# We'll need the stdout later, save it
exec 7>&1
@@ -46,11 +49,11 @@ if [ ! -d "samples/${CT_TARGET}" ]; then
fi
# Save the crosstool-NG config file
-sed -r -e 's|^(CT_PREFIX_DIR)=.*|\1="${HOME}/x-tools/${CT_TARGET}"|;' \
- -e 's|^# CT_LOG_TO_FILE is not set$|CT_LOG_TO_FILE=y|;' \
- -e 's|^# CT_LOG_FILE_COMPRESS is not set$|CT_LOG_FILE_COMPRESS=y|;' \
- -e 's|^(CT_LOCAL_TARBALLS_DIR)=.*|\1="${HOME}/src"|;' \
- <.config \
+"${sed}" -r -e 's|^(CT_PREFIX_DIR)=.*|\1="${HOME}/x-tools/${CT_TARGET}"|;' \
+ -e 's|^# CT_LOG_TO_FILE is not set$|CT_LOG_TO_FILE=y|;' \
+ -e 's|^# CT_LOG_FILE_COMPRESS is not set$|CT_LOG_FILE_COMPRESS=y|;' \
+ -e 's|^(CT_LOCAL_TARBALLS_DIR)=.*|\1="${HOME}/src"|;' \
+ <.config \
>"samples/${CT_TARGET}/crosstool.config"
# Function to copy a file to the sample directory
@@ -59,8 +62,8 @@ sed -r -e 's|^(CT_PREFIX_DIR)=.*|\1="${HOME}/x-tools/${CT_TARGET}"|;' \
CT_DoAddFileToSample() {
source="$1"
dest="$2"
- inode_s=$(ls -i "${source}" |gawk '{ print $1; }')
- inode_d=$(ls -i "${dest}" 2>/dev/null |gawk '{ print $1; }' || true)
+ inode_s=$(ls -i "${source}" |"${awk}" '{ print $1; }')
+ inode_d=$(ls -i "${dest}" 2>/dev/null |"${awk}" '{ print $1; }' || true)
if [ "${inode_s}" != "${inode_d}" ]; then
cp "${source}" "${dest}"
fi
@@ -76,8 +79,8 @@ fi
if [ -n "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then
# We save the file, and then point the saved sample to this file
CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
- sed -r -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE=).+$|\1"'"${samp_top_dir}"'/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"|;' \
- "samples/${CT_TARGET}/crosstool.config"
+ "${sed}" -r -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE=).+$|\1"'"${samp_top_dir}"'/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"|;' \
+ "samples/${CT_TARGET}/crosstool.config"
else
# remove any dangling files
for f in "samples/${CT_TARGET}/${CT_LIBC}-"*.config; do