summaryrefslogtreecommitdiff
path: root/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@anciens.enib.fr>2011-05-22 00:05:40 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2011-05-22 10:04:27 +0200
commitf5268b171a04e9fe286d88117d9590d7e68df754 (patch)
treec6f04f4db2d7b5d0d093f8b2da120f92a3138fa6 /toolchain/toolchain-crosstool-ng/crosstool-ng.mk
parenta02cfbf1f4a82ee6582e2bf7622b2bf105359ea9 (diff)
toolchain/crosstool-NG: bundle one CT-NG config file for each libc familly
Currently, the bundled CT-NG config file has no C library configured. It is quite complex to add and/or munge options in this case. Now, with one config file per libc familly, it becomes easier. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'toolchain/toolchain-crosstool-ng/crosstool-ng.mk')
-rw-r--r--toolchain/toolchain-crosstool-ng/crosstool-ng.mk18
1 files changed, 15 insertions, 3 deletions
diff --git a/toolchain/toolchain-crosstool-ng/crosstool-ng.mk b/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
index 015cd13e6..ed7f7c60a 100644
--- a/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
+++ b/toolchain/toolchain-crosstool-ng/crosstool-ng.mk
@@ -20,9 +20,10 @@ CTNG_SOURCE:=crosstool-ng-$(CTNG_VERSION).tar.bz2
CTNG_DIR:=$(BUILD_DIR)/crosstool-ng-$(CTNG_VERSION)
CTNG_CAT:=bzcat
CTNG_PATCH_DIR:=toolchain/toolchain-crosstool-ng
-CTNG_CONFIG_FILE:=$(call qstrip,$(BR2_TOOLCHAIN_CTNG_CONFIG))
CTNG_UCLIBC_CONFIG_FILE := $(TOPDIR)/toolchain/toolchain-crosstool-ng/uClibc.config
+CTNG_CONFIG_FILE:=$(call qstrip,$(BR2_TOOLCHAIN_CTNG_CONFIG))
+
# Hack! ct-ng is in fact a Makefile script. As such, it accepts all
# make options, such as -C, which makes it uneeded to chdir prior
# to calling ct-ng.
@@ -349,13 +350,24 @@ endef
# Default configuration
# Depends on top-level .config because it has options we have to shoe-horn
# into crosstool-NG's .config
-# Only copy the original .config file if we don't have one already
+# Only copy the original .config file if we don't have one already.
+# Check that given config file matches selected C library.
# We need to call oldconfig twice in a row to ensure the options
# are correctly set ( eg. if an option is new, then the initial sed
# can't do anything about it ) Ideally, this should go in oldconfig
# itself, but it's much easier to handle here.
$(CTNG_DIR)/.config: $(CTNG_CONFIG_FILE) $(CTNG_DIR)/ct-ng $(CONFIG_DIR)/.config
- $(Q)[ -f $@ ] && cp -a $@ $@.timestamp || cp -f $< $@
+ $(Q)if [ ! -f $@ ]; then \
+ libc="$$(awk -F '"' '$$1=="CT_LIBC=" { print $$2; }' "$<")"; \
+ if [ "$${libc}" != "$(BR2_TOOLCHAIN_CTNG_LIBC)" ]; then \
+ echo "* Inconsistency in crosstool-NG config file '$<'"; \
+ echo "* - buildroot configured for '$(BR2_TOOLCHAIN_CTNG_LIBC)'"; \
+ echo "* - given config file for '$${libc}'"; \
+ exit 1; \
+ fi; \
+ cp -f $< $@; \
+ fi
+ $(Q)cp -a $@ $@.timestamp
$(call ctng-oldconfig,$@)
$(call ctng-oldconfig,$@)
$(call ctng-check-config-changed,$@,$@.timestamp)