mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-18 20:37:56 +00:00
Save the toolchain configuration to its own file, as an auto-extracting shell script:
- get rid of the 'extractconfig' action, it was cumbersome to use, and badly documented, - introduce a skeleton for the config script, - update auto-completion, - document the config script. /trunk/kconfig/kconfig.mk | 9 2 7 0 ++------- /trunk/scripts/crosstool.sh | 6 5 1 0 +++++- /trunk/docs/overview.txt | 21 9 12 0 +++++++++------------ /trunk/tools/toolchain-config.in | 8 8 0 0 ++++++++ /trunk/ct-ng.comp | 2 1 1 0 +- 5 files changed, 25 insertions(+), 21 deletions(-)
This commit is contained in:
parent
c7f3478a10
commit
16c6cc994f
@ -13,7 +13,7 @@ _ct-ng () {
|
||||
start_steps=$(echo "${steps}" |sed -r -e 's/(^| )/\1+/;')
|
||||
stop_steps=$(echo "${steps}" |sed -r -e 's/(^| )/+\1/;')
|
||||
|
||||
actions='config menuconfig oldconfig saveconfig extractconfig
|
||||
actions='config menuconfig oldconfig saveconfig
|
||||
list-samples build list-steps regtest regtest-local
|
||||
regtest-global clean distclean wiki-samples updatetools
|
||||
tarball'
|
||||
|
@ -283,19 +283,16 @@ Re-building an existing toolchain |
|
||||
|
||||
If you have an existing toolchain, you can re-use the options used to build it
|
||||
to create a new toolchain. That needs a very little bit of effort on your side
|
||||
but is quite easy. The options to build a toolchain are saved in the build log
|
||||
file that is saved within the toolchain. crosstool-NG can extract those options
|
||||
to recreate a new configuration:
|
||||
ct-ng extractconfig </path/to/your/build.log >.config
|
||||
but is quite easy. The options to build a toolchain are saved with the
|
||||
toolchain, and you can retrieve this configuration by running:
|
||||
${CT_TARGET}-config
|
||||
|
||||
will extract those options, prompt you for the new ones, which you can later
|
||||
edit with menuconfig.
|
||||
This will dump the configuration to stdout, so to rebuild a toolchain with this
|
||||
configuration, the following is all you need to do:
|
||||
${CT_TARGET}-config >.config
|
||||
|
||||
Of course, if your build log was compressed, you'd have to use something like:
|
||||
bzcat /path/to/your/build.log.bz2 |ct-ng extractconfig >.config
|
||||
|
||||
Then, once the configuration has been extracted, run:
|
||||
ct-ng oldconfig
|
||||
Then, you can review and change the configuration by running:
|
||||
ct-ng menuconfig
|
||||
|
||||
________________________
|
||||
/
|
||||
|
@ -7,7 +7,7 @@ export PROJECTVERSION=$(CT_VERSION)
|
||||
|
||||
KCONFIG_TOP = config/config.in
|
||||
obj = $(CT_TOP_DIR)/kconfig
|
||||
PHONY += clean help oldconfig menuconfig config defoldconfig extractconfig
|
||||
PHONY += clean help oldconfig menuconfig config defoldconfig
|
||||
|
||||
# Darwin (MacOS-X) does not have proper libintl support
|
||||
ifeq ($(shell uname -s),Darwin)
|
||||
@ -114,7 +114,7 @@ $(CT_TOP_DIR)/config.gen/tools.in: $(TOOLS_CONFIG_FILES)
|
||||
echo "endmenu"; \
|
||||
) >$@
|
||||
|
||||
config menuconfig oldconfig defoldconfig extractconfig: $(KCONFIG_TOP)
|
||||
config menuconfig oldconfig defoldconfig: $(KCONFIG_TOP)
|
||||
|
||||
$(KCONFIG_TOP):
|
||||
@ln -sf $(CT_LIB_DIR)/config config
|
||||
@ -131,16 +131,11 @@ oldconfig: $(CONFIG_FILES) $(obj)/conf
|
||||
defoldconfig: $(CONFIG_FILES) $(obj)/conf
|
||||
@yes "" |$(obj)/conf -s $(KCONFIG_TOP)
|
||||
|
||||
extractconfig: $(CONFIG_FILES) $(obj)/conf
|
||||
@$(CT_LIB_DIR)/tools/extract-config.sh >.config
|
||||
@$(obj)/conf -s $(KCONFIG_TOP)
|
||||
|
||||
# Help text used by make help
|
||||
help-config::
|
||||
@echo ' config - Update current config using a line-oriented program'
|
||||
@echo ' menuconfig - Update current config using a menu based program'
|
||||
@echo ' oldconfig - Update current config using a provided .config as base'
|
||||
@echo ' extractconfig - Create a new config using options extracted from a'
|
||||
@echo ' build log piped into stdin'
|
||||
|
||||
# Cheesy build
|
||||
|
@ -36,7 +36,7 @@ CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
|
||||
# renice oursleves
|
||||
CT_DoExecLog DEBUG renice ${CT_NICE} $$
|
||||
|
||||
CT_DoStep DEBUG "Dumping crosstool-NG configuration"
|
||||
CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration"
|
||||
cat "${CT_TOP_DIR}/.config" |egrep '^(# |)CT_' |CT_DoLog DEBUG
|
||||
CT_EndStep
|
||||
|
||||
@ -341,6 +341,10 @@ if [ -z "${CT_RESTART}" ]; then
|
||||
[ ${CT_LOAD} -ne 0 ] && PARALLELMFLAGS="${PARALLELMFLAGS} -l${CT_LOAD}"
|
||||
export PARALLELMFLAGS
|
||||
|
||||
CT_DoLog EXTRA "Installing user-supplied crosstool-NG configuration"
|
||||
CT_DoExecLog DEBUG install -m 0755 "${CT_LIB_DIR}/tools/toolchain-config.in" "${CT_PREFIX_DIR}/bin/${CT_TARGET}.ct-ng.config"
|
||||
bzip2 -c -9 .config >>"${CT_PREFIX_DIR}/bin/${CT_TARGET}.ct-ng.config"
|
||||
|
||||
CT_DoStep EXTRA "Dumping internal crosstool-NG configuration"
|
||||
CT_DoLog EXTRA "Building a toolchain for:"
|
||||
CT_DoLog EXTRA " build = ${CT_BUILD}"
|
||||
|
8
tools/toolchain-config.in
Normal file
8
tools/toolchain-config.in
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
SKIP_ME="### CT_NG SKIP ME ###"
|
||||
skip_me=$(($(cat "${0}" |grep --binary-files=text -o -b -E "^${SKIP_ME}$" |cut -d : -f 1)+${#SKIP_ME}+1))
|
||||
dd if="${0}" bs=${skip_me} skip=1 2>/dev/null |bzcat
|
||||
exit 0
|
||||
|
||||
### CT_NG SKIP ME ###
|
Loading…
Reference in New Issue
Block a user