Revisit the extract-config way of working: ct-ng is the sole entry point to crosstool-NG, and ct-ng.extrac-config no longer exists. You now have to call "ct-ng extractconfig </path/to/your/build.log" instead.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Jul 17 21:44:33 2007 +0000 (2007-07-17)
changeset 276835178a32fc1
parent 275 91c48f27338c
child 277 4c32aa5569b2
Revisit the extract-config way of working: ct-ng is the sole entry point to crosstool-NG, and ct-ng.extrac-config no longer exists. You now have to call "ct-ng extractconfig </path/to/your/build.log" instead.
Makefile.in
docs/overview.txt
kconfig/kconfig.mk
tools/ct-ng.extract-config
tools/extract-config.sh
     1.1 --- a/Makefile.in	Tue Jul 17 21:41:39 2007 +0000
     1.2 +++ b/Makefile.in	Tue Jul 17 21:44:33 2007 +0000
     1.3 @@ -66,11 +66,9 @@
     1.4  #--------------------------------------
     1.5  # Install rules
     1.6  
     1.7 -install-bin: install-lib $(BINDIR)
     1.8 +install-bin: $(BINDIR)
     1.9  	@echo "  INST   ct-ng"
    1.10  	@install -m 755 ct-ng $(BINDIR)/ct-ng
    1.11 -	@echo "  LN     ct-ng.extract-config"
    1.12 -	@ln -sf $(LIBDIR)/tools/ct-ng.extract-config $(BINDIR)/ct-ng.extract-config
    1.13  
    1.14  install-lib: $(LIBDIR) install-lib-main install-lib-samples
    1.15  
     2.1 --- a/docs/overview.txt	Tue Jul 17 21:41:39 2007 +0000
     2.2 +++ b/docs/overview.txt	Tue Jul 17 21:44:33 2007 +0000
     2.3 @@ -165,6 +165,22 @@
     2.4    brave enough, you can try and debug them. They are hidden behind CT_BROKEN,
     2.5    which itself is hiddent behind EXPERIMENTAL.
     2.6  
     2.7 +Re-building an existing toolchain |
     2.8 +----------------------------------+
     2.9 +
    2.10 +If you have an existing toolchain, you can re-use the options used to build it
    2.11 +to create a new toolchain. That needs a very little bit of effort on your side
    2.12 +but is quite easy. The options to build a toolchain are saved in the build log
    2.13 +file that is saved within the toolchain. crosstool-NG can extract those options
    2.14 +to recreate a new configuration:
    2.15 +  ct-ng extractconfig </path/to/your/build.log
    2.16 +
    2.17 +will extract those options, prompt you for the new ones, which you can later
    2.18 +edit with menuconfig.
    2.19 +
    2.20 +Of course, if your build log was compressed, you'd have to use something like:
    2.21 +  bzcat /path/to/your/build.log.bz2 |ct-ng extractconfig
    2.22 +
    2.23  ________________________
    2.24                         /
    2.25  Running crosstool-NG  /
     3.1 --- a/kconfig/kconfig.mk	Tue Jul 17 21:41:39 2007 +0000
     3.2 +++ b/kconfig/kconfig.mk	Tue Jul 17 21:44:33 2007 +0000
     3.3 @@ -7,7 +7,7 @@
     3.4  
     3.5  KCONFIG_TOP = config/config.in
     3.6  obj = $(CT_TOP_DIR)/kconfig
     3.7 -PHONY += clean help oldconfig menuconfig config defoldconfig
     3.8 +PHONY += clean help oldconfig menuconfig config defoldconfig extractconfig
     3.9  
    3.10  # Darwin (MacOS-X) does not have proper libintl support
    3.11  ifeq ($(shell uname -s),Darwin)
    3.12 @@ -51,7 +51,7 @@
    3.13  	 done >>$@
    3.14  	@echo "endmenu" >>$@
    3.15  
    3.16 -config menuconfig oldconfig defoldconfig:: $(KCONFIG_TOP)
    3.17 +config menuconfig oldconfig defoldconfig extractconfig:: $(KCONFIG_TOP)
    3.18  
    3.19  $(KCONFIG_TOP):
    3.20  	@ln -s $(CT_LIB_DIR)/config config
    3.21 @@ -68,11 +68,17 @@
    3.22  defoldconfig:: $(obj)/conf $(CONFIG_FILES)
    3.23  	@yes "" |$< -s $(KCONFIG_TOP) >/dev/null
    3.24  
    3.25 +extractconfig:: $(obj)/conf $(CONFIG_FILES)
    3.26 +	@$(CT_LIB_DIR)/tools/extract-config.sh >.config
    3.27 +	@$< -s $(KCONFIG_TOP)
    3.28 +
    3.29  # Help text used by make help
    3.30  help-config::
    3.31  	@echo  '  config         - Update current config using a line-oriented program'
    3.32  	@echo  '  menuconfig     - Update current config using a menu based program'
    3.33  	@echo  '  oldconfig      - Update current config using a provided .config as base'
    3.34 +	@echo  '  extractconfig  - Create a new config using options extracted from a'
    3.35 +	@echo  '                   build log piped into stdin'
    3.36  
    3.37  # Cheesy build
    3.38  
     4.1 --- a/tools/ct-ng.extract-config	Tue Jul 17 21:41:39 2007 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,23 +0,0 @@
     4.4 -#!/bin/sh
     4.5 -
     4.6 -# This scripts extracts a crosstool-NG configuration from the log file
     4.7 -# of a toolchain build with crosstool-NG.
     4.8 -
     4.9 -# Usage: $0 <logfile>
    4.10 -
    4.11 -cat "$1" |awk '
    4.12 -BEGIN {
    4.13 -  dump = 0;
    4.14 -}
    4.15 -
    4.16 -$0~/Dumping crosstool-NG configuration: done in.+s$/ {
    4.17 -  dump = 0;
    4.18 -}
    4.19 -
    4.20 -dump == 1 { $1 = "" }
    4.21 -dump == 1
    4.22 -
    4.23 -$0~/Dumping crosstool-NG configuration$/ {
    4.24 -  dump = 1;
    4.25 -}
    4.26 -' |cut -d ' ' -f 2-
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/tools/extract-config.sh	Tue Jul 17 21:44:33 2007 +0000
     5.3 @@ -0,0 +1,23 @@
     5.4 +#!/bin/sh
     5.5 +
     5.6 +# This scripts extracts a crosstool-NG configuration from the log file
     5.7 +# of a toolchain build with crosstool-NG.
     5.8 +
     5.9 +# Usage: cat <logfile> |$0
    5.10 +
    5.11 +awk '
    5.12 +BEGIN {
    5.13 +  dump = 0;
    5.14 +}
    5.15 +
    5.16 +$0~/Dumping crosstool-NG configuration: done in.+s$/ {
    5.17 +  dump = 0;
    5.18 +}
    5.19 +
    5.20 +dump == 1 { $1 = "" }
    5.21 +dump == 1
    5.22 +
    5.23 +$0~/Dumping crosstool-NG configuration$/ {
    5.24 +  dump = 1;
    5.25 +}
    5.26 +' |cut -d ' ' -f 2-