mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-06-19 07:48:09 +00:00
Get rid of .config.2.
Now handled by CT_LoadConfig. Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,7 +11,6 @@ paths.*
|
|||||||
!paths.in
|
!paths.in
|
||||||
config.gen/
|
config.gen/
|
||||||
.config
|
.config
|
||||||
.config.2
|
|
||||||
|
|
||||||
# Temporaries
|
# Temporaries
|
||||||
.*.swp
|
.*.swp
|
||||||
|
11
ct-ng.in
11
ct-ng.in
@ -136,19 +136,14 @@ help-env::
|
|||||||
@echo "or configure an existing sample."
|
@echo "or configure an existing sample."
|
||||||
@false
|
@false
|
||||||
|
|
||||||
.config.2: .config
|
show-tuple: .config
|
||||||
$(SILENT)$(sed) -r -e 's/^([^=]+_ARRAY)="(.*)"$$/\1=( \2 )/;' \
|
|
||||||
-e '/^[^=]+_ARRAY=/s/\\(.)/\1/g;' \
|
|
||||||
$< >$@
|
|
||||||
|
|
||||||
show-tuple: .config.2
|
|
||||||
$(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showConfig.sh '$${CT_TARGET}'
|
$(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showConfig.sh '$${CT_TARGET}'
|
||||||
|
|
||||||
# Actual build
|
# Actual build
|
||||||
source: .config.2
|
source: .config
|
||||||
$(SILENT)CT_SOURCE=y $(CT_LIB_DIR)/scripts/crosstool-NG.sh
|
$(SILENT)CT_SOURCE=y $(CT_LIB_DIR)/scripts/crosstool-NG.sh
|
||||||
|
|
||||||
build: .config.2
|
build: .config
|
||||||
$(SILENT)$(CT_LIB_DIR)/scripts/crosstool-NG.sh
|
$(SILENT)$(CT_LIB_DIR)/scripts/crosstool-NG.sh
|
||||||
|
|
||||||
build.%:
|
build.%:
|
||||||
|
@ -126,8 +126,6 @@ CT_STAR_DATE_HUMAN=$(CT_DoDate +%Y%m%d.%H%M%S)
|
|||||||
# Log real begining of build, now
|
# Log real begining of build, now
|
||||||
CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
|
CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
|
||||||
|
|
||||||
# We really need to extract from .config and not .config.2, as we
|
|
||||||
# do want the kconfig's values, not our mangled config with arrays.
|
|
||||||
CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration"
|
CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration"
|
||||||
CT_DoExecLog DEBUG ${grep} -E '^(# )?CT_' .config
|
CT_DoExecLog DEBUG ${grep} -E '^(# )?CT_' .config
|
||||||
CT_EndStep
|
CT_EndStep
|
||||||
@ -571,8 +569,6 @@ if [ -z "${CT_RESTART}" ]; then
|
|||||||
fi
|
fi
|
||||||
rm -f "${testc}"
|
rm -f "${testc}"
|
||||||
|
|
||||||
# We need to save the real .config with kconfig's value,
|
|
||||||
# not our mangled .config.2 with arrays.
|
|
||||||
CT_DoLog EXTRA "Installing user-supplied crosstool-NG configuration"
|
CT_DoLog EXTRA "Installing user-supplied crosstool-NG configuration"
|
||||||
CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/bin"
|
CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/bin"
|
||||||
CT_DoExecLog DEBUG ${install} -m 0755 "${CT_LIB_DIR}/scripts/toolchain-config.in" "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config"
|
CT_DoExecLog DEBUG ${install} -m 0755 "${CT_LIB_DIR}/scripts/toolchain-config.in" "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config"
|
||||||
|
@ -5,12 +5,14 @@
|
|||||||
# 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
|
||||||
|
|
||||||
CT_LoadConfig() {
|
CT_LoadConfig() {
|
||||||
|
local o
|
||||||
|
|
||||||
# Parse the configuration file
|
# Parse the configuration file
|
||||||
# It has some info about the logging facility, so include it early
|
# It has some info about the logging facility, so include it early
|
||||||
# It also sets KERNEL/ARCH/... for file inclusion below. Does not handle
|
# It also sets KERNEL/ARCH/... for file inclusion below. Does not handle
|
||||||
# recursive definitions yet.
|
# recursive definitions yet. We don't need arrays at this point.
|
||||||
CT_TestOrAbort "Configuration file not found. Please create one." -r .config.2
|
CT_TestOrAbort "Configuration file not found. Please create one." -r .config
|
||||||
. .config.2
|
. .config
|
||||||
|
|
||||||
# Include sub-scripts instead of calling them: that way, we do not have to
|
# Include sub-scripts instead of calling them: that way, we do not have to
|
||||||
# export any variable, nor re-parse the configuration and functions files.
|
# export any variable, nor re-parse the configuration and functions files.
|
||||||
@ -31,21 +33,25 @@ CT_LoadConfig() {
|
|||||||
# Kludge: If any of the configured options needs CT_TARGET,
|
# Kludge: If any of the configured options needs CT_TARGET,
|
||||||
# then rescan the options file now. This also handles recursive variables;
|
# then rescan the options file now. This also handles recursive variables;
|
||||||
# but we don't want to loop forever if there's a circular reference.
|
# but we don't want to loop forever if there's a circular reference.
|
||||||
touch ${CT_TOP_DIR}/.config.out.1
|
oldvals=""
|
||||||
try=0
|
try=0
|
||||||
while [ "$try" -le 10 ]; do
|
while [ "$try" -le 10 ]; do
|
||||||
. .config.2
|
. .config
|
||||||
set | ${grep} -E '^CT_' > ${CT_TOP_DIR}/.config.out.2
|
vals=`set | ${grep} -E '^CT_'`
|
||||||
if cmp -s ${CT_TOP_DIR}/.config.out.1 ${CT_TOP_DIR}/.config.out.2; then
|
if [ "$oldvals" = "$vals" ]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
mv ${CT_TOP_DIR}/.config.out.2 ${CT_TOP_DIR}/.config.out.1
|
oldvals="$vals"
|
||||||
try=$[ try + 1 ]
|
try=$[ try + 1 ]
|
||||||
done
|
done
|
||||||
if [ "$try" -gt 10 ]; then
|
if [ "$try" -gt 10 ]; then
|
||||||
CT_Abort "Variables in .config recurse too deep."
|
CT_Abort "Variables in .config recurse too deep."
|
||||||
fi
|
fi
|
||||||
rm -f ${CT_TOP_DIR}/.config.out.[12]
|
# Double eval: first eval substitutes option name, second eval unescapes quotes
|
||||||
|
# and whitespace.
|
||||||
|
for o in `set | sed -rn 's/^(CT_[A-Za-z0-9_]*_ARRAY)=.*/\1/p'`; do
|
||||||
|
eval "eval $o=(\"\$$o\")"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Prepare the fault handler
|
# Prepare the fault handler
|
||||||
|
@ -40,9 +40,7 @@ esac
|
|||||||
samp_dir="samples/${samp_name}"
|
samp_dir="samples/${samp_name}"
|
||||||
mkdir -p "${samp_dir}"
|
mkdir -p "${samp_dir}"
|
||||||
|
|
||||||
# Tweak the .config file
|
# Tweak the .config file.
|
||||||
# We need to be based on the real .config with kconfig's values,
|
|
||||||
# not our mangled .config.2 with shell arrays
|
|
||||||
cp .config .defconfig
|
cp .config .defconfig
|
||||||
"${sed}" -r -e 's|^(CT_PREFIX_DIR)=.*|\1="${HOME}/x-tools/${CT_TARGET}"|;' \
|
"${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_TO_FILE is not set$|CT_LOG_TO_FILE=y|;' \
|
||||||
|
Reference in New Issue
Block a user