kconfig/kconfig.mk
author Daniel Price <daniel.price@gmail.com>
Tue Nov 20 16:59:17 2012 -0800 (2012-11-20)
changeset 3126 333d3e40cbd1
parent 2999 4ccfca658d9b
child 3167 15f57d843296
permissions -rw-r--r--
scripts: refine static linking check to better guide the user

The current mechanism to check if static linking is possible, and the mesage
displayed on failure, can be puzzling to the unsuspecting user.

Also, the current implementation is not using the existing infrastructure,
and is thus difficult to enhance with new tests.

So, switch to using the standard CT_DoExecLog infra, and use four tests to
check for the host compiler:
- check we can run it
- check it can build a trivial program
- check it can statically link that program
- check if it statically link with libstdc++

That should cover most of the problems. Hopefully.

(At the same time, fix a typo in a comment)

Signed-off-by: Daniel Price <daniel.price@gmail.com>
[yann.morin.1998@free.fr: split original patch for self-contained changes]
[yann.morin.1998@free.fr: use steps to better see gcc's output]
[yann.morin.1998@free.fr: commit log]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <163f86b5216fc08c672a.1353459722@nipigon.dssd.com>
Patchwork-Id: 200536
yann@1
     1
# ===========================================================================
yann@197
     2
# crosstool-NG configuration targets
yann@1
     3
# These targets are used from top-level makefile
yann@1
     4
yann@926
     5
#-----------------------------------------------------------
yann@926
     6
# The configurators rules
yann@182
     7
yann@3034
     8
configurators = menuconfig nconfig oldconfig defconfig olddefconfig
yann@946
     9
PHONY += $(configurators)
yann@945
    10
yann@946
    11
$(configurators): config_files
yann@946
    12
yann@2981
    13
# We need CONF for savedefconfig in scripts/saveSample.sh
yann@2981
    14
export CONF  := $(CT_LIB_DIR)/kconfig/conf
yann@2835
    15
MCONF := $(CT_LIB_DIR)/kconfig/mconf
yann@2835
    16
NCONF := $(CT_LIB_DIR)/kconfig/nconf
yann@2835
    17
yann@2835
    18
menuconfig:
yann@959
    19
	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
yann@2835
    20
	$(SILENT)$(MCONF) $(KCONFIG_TOP)
yann@1
    21
yann@2835
    22
nconfig:
yann@2454
    23
	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
yann@2835
    24
	$(SILENT)$(NCONF) $(KCONFIG_TOP)
yann@2454
    25
yann@2835
    26
oldconfig: .config
yann@945
    27
	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
yann@2835
    28
	$(SILENT)$(CONF) --silent$@ $(KCONFIG_TOP)
yann@1
    29
yann@3034
    30
defconfig: .config
yann@3034
    31
	@$(ECHO) '  GEN   $@'
yann@3034
    32
	$(SILENT)$(CONF) --savedefconfig=$${CONFIG-defconfig} $(KCONFIG_TOP)
yann@3034
    33
yann@3034
    34
olddefconfig:
yann@3034
    35
	@$(ECHO) '  CONF  $@'
yann@3034
    36
	$(SILENT)$(CONF) --defconfig=$${CONFIG-defconfig} $(KCONFIG_TOP)
yann@3034
    37
yann@1803
    38
# Always be silent, the stdout an be >.config
yann@1803
    39
extractconfig:
yann@2999
    40
	@$(awk) 'BEGIN { dump=0; }                                                  \
yann@2999
    41
	         dump==1 && $$0~/^\[.....\][[:space:]]+(# |)CT_/ {                  \
yann@2999
    42
	             $$1="";                                                        \
yann@2999
    43
	             gsub("^[[:space:]]","");                                       \
yann@2999
    44
	             print;                                                         \
yann@2999
    45
	         }                                                                  \
yann@2999
    46
	         $$0~/Dumping user-supplied crosstool-NG configuration: done in/ {  \
yann@2999
    47
	             dump=0;                                                        \
yann@2999
    48
	         }                                                                  \
yann@2999
    49
	         $$0~/Dumping user-supplied crosstool-NG configuration$$/ {         \
yann@2999
    50
	             dump=1;                                                        \
yann@2999
    51
	         }'
yann@1803
    52
yann@926
    53
#-----------------------------------------------------------
yann@1
    54
# Help text used by make help
yann@926
    55
yann@176
    56
help-config::
yann@333
    57
	@echo  '  menuconfig         - Update current config using a menu based program'
yann@333
    58
	@echo  '  oldconfig          - Update current config using a provided .config as base'
yann@1803
    59
	@echo  '  extractconfig      - Extract to stdout the configuration items from a'
yann@1803
    60
	@echo  '                       build.log file piped to stdin'
yann@3034
    61
	@echo  '  defconfig          - Save current config as a mini-defconfig to $${CONFIG}'
yann@3034
    62
	@echo  '  olddefconfig       - Update config from a mini-defconfig $${CONFIG}'
yann@3034
    63
	@echo  '                       (default: $${CONFIG}=./defconfig)'