summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorArnout Vandecappelle <arnout@mind.be>2015-12-31 01:34:13 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-12-31 10:32:10 +0100
commit12825f7af5b6632020f04fd29f1444d3a2d21b7c (patch)
tree2bcaaf2b27dc3303498d9c453b275bc088de5317 /Makefile
parent449803965c31de78288c5e61502a2988636a87ac (diff)
Config.in: add symbols for BR2_HOST_GCC_AT_LEAST_X_Y
Some host packages need a recent gcc version. Add symbols to Config.in to specify the HOSTCC version. The values are passed through the environment, and this environment is generated in a new support script. Also update the documentation to mention the new symbols. [Thomas: simplify by using only make logic instead of an external shell script.] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1d691929f..80e94a2ab 100644
--- a/Makefile
+++ b/Makefile
@@ -293,6 +293,14 @@ HOSTRANLIB := $(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) || echo ranli
export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
+HOSTCC_VERSION := $(shell $(HOSTCC_NOCCACHE) --version | \
+ sed -n -r 's/^.* ([0-9]*)\.([0-9]*)\.([0-9]*)[ ]*.*/\1 \2/p')
+
+# For gcc >= 5.x, we only need the major version.
+ifneq ($(firstword $(HOSTCC_VERSION)),4)
+HOSTCC_VERSION := $(firstword $(HOSTCC_VERSION))
+endif
+
# Make sure pkg-config doesn't look outside the buildroot tree
HOST_PKG_CONFIG_PATH := $(PKG_CONFIG_PATH)
unexport PKG_CONFIG_PATH
@@ -724,6 +732,7 @@ COMMON_CONFIG_ENV = \
KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
BR2_CONFIG=$(BR2_CONFIG) \
BR2_EXTERNAL=$(BR2_EXTERNAL) \
+ HOST_GCC_VERSION="$(HOSTCC_VERSION)" \
SKIP_LEGACY=
xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile