mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-06-21 16:39:37 +00:00
Allow for per-tool templates when creating overrides
... will be used to implement a smarter install wrapper. While there, correct the spelling of "OVERIDE". Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
@ -102,7 +102,7 @@ config DEBUG_CT_SAVE_STEPS_GZIP
|
|||||||
further doesn't gain much, and takes far more time (believe me, I've
|
further doesn't gain much, and takes far more time (believe me, I've
|
||||||
got figures here! :-) ).
|
got figures here! :-) ).
|
||||||
|
|
||||||
config NO_OVERIDE_LC_MESSAGES
|
config NO_OVERRIDE_LC_MESSAGES
|
||||||
bool
|
bool
|
||||||
prompt "Do *not* overide LC_MESSAGES (EXPERIMENTAL)"
|
prompt "Do *not* overide LC_MESSAGES (EXPERIMENTAL)"
|
||||||
depends on EXPERIMENTAL
|
depends on EXPERIMENTAL
|
||||||
|
@ -11,7 +11,7 @@ config FORCE_EXTRACT
|
|||||||
Useful if you suspect a previous extract did not complete (eg. broken
|
Useful if you suspect a previous extract did not complete (eg. broken
|
||||||
tarball), or you added a new set of patches for this component.
|
tarball), or you added a new set of patches for this component.
|
||||||
|
|
||||||
config OVERIDE_CONFIG_GUESS_SUB
|
config OVERRIDE_CONFIG_GUESS_SUB
|
||||||
bool
|
bool
|
||||||
prompt "Override config.{guess,sub}"
|
prompt "Override config.{guess,sub}"
|
||||||
default y
|
default y
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#!@@CT_bash@@
|
|
||||||
# Copyright 2007 Yann E. MORIN
|
# Copyright 2007 Yann E. MORIN
|
||||||
# Licensed under the GPL v2. See COPYING in the root of this package.
|
# Licensed under the GPL v2. See COPYING in the root of this package.
|
||||||
|
|
||||||
@ -42,7 +41,7 @@ if [ "${CT_DEBUG_INTERACTIVE}" = "y" -a ! \( -t 0 -a -t 6 -a -t 2 \) ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Override the locale early, in case we ever translate crosstool-NG messages
|
# Override the locale early, in case we ever translate crosstool-NG messages
|
||||||
if [ -z "${CT_NO_OVERIDE_LC_MESSAGES}" ]; then
|
if [ -z "${CT_NO_OVERRIDE_LC_MESSAGES}" ]; then
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
export LANG=C
|
export LANG=C
|
||||||
fi
|
fi
|
||||||
@ -104,19 +103,24 @@ CT_TestOrAbort "The CONFIG_SHELL '${CT_CONFIG_SHELL}' is not valid" -f "${CT_CON
|
|||||||
# Contains symlinks to the tools found by ./configure
|
# Contains symlinks to the tools found by ./configure
|
||||||
# Note: CT_DoLog and CT_DoExecLog do not use any of those tool, so
|
# Note: CT_DoLog and CT_DoExecLog do not use any of those tool, so
|
||||||
# they can be safely used
|
# they can be safely used
|
||||||
CT_TOOLS_OVERIDE_DIR="${CT_WORK_DIR}/tools"
|
CT_TOOLS_OVERRIDE_DIR="${CT_WORK_DIR}/tools"
|
||||||
CT_DoLog DEBUG "Creating bin-override for tools in '${CT_TOOLS_OVERIDE_DIR}'"
|
CT_DoLog DEBUG "Creating bin-override for tools in '${CT_TOOLS_OVERRIDE_DIR}'"
|
||||||
CT_DoExecLog DEBUG mkdir -p "${CT_TOOLS_OVERIDE_DIR}/bin"
|
CT_DoExecLog DEBUG mkdir -p "${CT_TOOLS_OVERRIDE_DIR}/bin"
|
||||||
cat "${CT_LIB_DIR}/paths.sh" |while read trash line; do
|
cat "${CT_LIB_DIR}/paths.sh" |while read trash line; do
|
||||||
tool="${line%%=*}"
|
tool="${line%%=*}"
|
||||||
path="${line#*=}"
|
# Suppress extra quoting
|
||||||
CT_DoLog DEBUG "Creating script-override for '${tool}' -> '${path}'"
|
eval path=${line#*=}
|
||||||
# Note: we need to supress the " in the path because
|
if [ -r "${CT_LIB_DIR}/scripts/override/$tool" ]; then
|
||||||
# there can be arguments in there (thanks autostuff...)
|
tmpl="${CT_LIB_DIR}/scripts/override/$tool"
|
||||||
printf "#${BANG}${CT_CONFIG_SHELL}\nexec ${path//\"/} \"\${@}\"\n" >"${CT_TOOLS_OVERIDE_DIR}/bin/${tool}"
|
else
|
||||||
CT_DoExecLog ALL chmod 700 "${CT_TOOLS_OVERIDE_DIR}/bin/${tool}"
|
tmpl="${CT_LIB_DIR}/scripts/override/__default"
|
||||||
|
fi
|
||||||
|
CT_DoLog DEBUG "Creating script-override for '${tool}' -> '${path}' using '${tmpl}' template"
|
||||||
|
${sed} -r -e "s#@CONFIG_SHELL@#${CT_CONFIG_SHELL}#g" \
|
||||||
|
-e "s#@TOOL_PATH@#${path}#g" "${tmpl}" > "${CT_TOOLS_OVERRIDE_DIR}/bin/${tool}"
|
||||||
|
CT_DoExecLog ALL chmod 700 "${CT_TOOLS_OVERRIDE_DIR}/bin/${tool}"
|
||||||
done
|
done
|
||||||
export PATH="${CT_TOOLS_OVERIDE_DIR}/bin:${PATH}"
|
export PATH="${CT_TOOLS_OVERRIDE_DIR}/bin:${PATH}"
|
||||||
|
|
||||||
# Start date. Can't be done until we know the locale
|
# Start date. Can't be done until we know the locale
|
||||||
# Also requires the bin-override tools
|
# Also requires the bin-override tools
|
||||||
|
@ -1289,7 +1289,7 @@ CT_Patch() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "${CT_OVERIDE_CONFIG_GUESS_SUB}" = "y" ]; then
|
if [ "${CT_OVERRIDE_CONFIG_GUESS_SUB}" = "y" ]; then
|
||||||
CT_DoLog ALL "Overiding config.guess and config.sub"
|
CT_DoLog ALL "Overiding config.guess and config.sub"
|
||||||
for cfg in config_guess config_sub; do
|
for cfg in config_guess config_sub; do
|
||||||
eval ${cfg}="${CT_LIB_DIR}/scripts/${cfg/_/.}"
|
eval ${cfg}="${CT_LIB_DIR}/scripts/${cfg/_/.}"
|
||||||
|
3
scripts/override/__default
Normal file
3
scripts/override/__default
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!@CONFIG_SHELL@
|
||||||
|
|
||||||
|
exec @TOOL_PATH@ "$@"
|
Reference in New Issue
Block a user