aboutsummaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
authorGravatar Eric Le Bihan <eric.le.bihan.dev@free.fr>2019-11-02 19:00:51 +0100
committerGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2019-11-04 23:04:24 +0100
commitf9f8f7e64a8560f453e17605f05bc404fa647413 (patch)
treed00ce6dcad827699faf2d3a9c1381655e14a1805 /toolchain
parent22e82f22d127867ca03f9d04feda939dfbf22998 (diff)
downloadbuildroot-f9f8f7e64a8560f453e17605f05bc404fa647413.tar.gz
buildroot-f9f8f7e64a8560f453e17605f05bc404fa647413.tar.bz2
toolchain/toolchain-external: add a check for D language support
Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/helpers.mk18
-rw-r--r--toolchain/toolchain-external/pkg-toolchain-external.mk6
2 files changed, 23 insertions, 1 deletions
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 6a4f7223c8..42e5522060 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -342,6 +342,24 @@ check_cplusplus = \
#
#
+# Check that the external toolchain supports D language
+#
+# $1: cross-gdc path
+#
+check_dlang = \
+ __CROSS_GDC=$(strip $1) ; \
+ __o=$(BUILD_DIR)/.br-toolchain-test-dlang.tmp ; \
+ printf 'import std.stdio;\nvoid main() { writeln("Hello World!"); }\n' | \
+ $${__CROSS_GDC} -x d -o $${__o} - ; \
+ if test $$? -ne 0 ; then \
+ rm -f $${__o}* ; \
+ echo "D language support is selected but is not available in external toolchain" ; \
+ exit 1 ; \
+ fi ; \
+ rm -f $${__o}* \
+
+#
+#
# Check that the external toolchain supports Fortran
#
# $1: cross-gfortran path
diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index 50cfef23f5..1c43409514 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -93,6 +93,7 @@ TOOLCHAIN_EXTERNAL_SUFFIX = \
TOOLCHAIN_EXTERNAL_CROSS = $(TOOLCHAIN_EXTERNAL_BIN)/$(TOOLCHAIN_EXTERNAL_PREFIX)-
TOOLCHAIN_EXTERNAL_CC = $(TOOLCHAIN_EXTERNAL_CROSS)gcc$(TOOLCHAIN_EXTERNAL_SUFFIX)
TOOLCHAIN_EXTERNAL_CXX = $(TOOLCHAIN_EXTERNAL_CROSS)g++$(TOOLCHAIN_EXTERNAL_SUFFIX)
+TOOLCHAIN_EXTERNAL_GDC = $(TOOLCHAIN_EXTERNAL_CROSS)gdc$(TOOLCHAIN_EXTERNAL_SUFFIX)
TOOLCHAIN_EXTERNAL_FC = $(TOOLCHAIN_EXTERNAL_CROSS)gfortran$(TOOLCHAIN_EXTERNAL_SUFFIX)
TOOLCHAIN_EXTERNAL_READELF = $(TOOLCHAIN_EXTERNAL_CROSS)readelf
@@ -266,7 +267,7 @@ define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER
*-ar|*-ranlib|*-nm) \
ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \
;; \
- *cc|*cc-*|*++|*++-*|*cpp|*-gfortran) \
+ *cc|*cc-*|*++|*++-*|*cpp|*-gfortran|*-gdc) \
ln -sf toolchain-wrapper $$base; \
;; \
*gdb|*gdbtui) \
@@ -551,6 +552,9 @@ define $(2)_CONFIGURE_CMDS
if test "$$(BR2_INSTALL_LIBSTDCPP)" = "y" ; then \
$$(call check_cplusplus,$$(TOOLCHAIN_EXTERNAL_CXX)) ; \
fi ; \
+ if test "$$(BR2_TOOLCHAIN_HAS_DLANG)" = "y" ; then \
+ $$(call check_dlang,$$(TOOLCHAIN_EXTERNAL_GDC)) ; \
+ fi ; \
if test "$$(BR2_TOOLCHAIN_HAS_FORTRAN)" = "y" ; then \
$$(call check_fortran,$$(TOOLCHAIN_EXTERNAL_FC)) ; \
fi ; \