aboutsummaryrefslogtreecommitdiff
path: root/toolchain/helpers.mk
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain/helpers.mk')
-rw-r--r--toolchain/helpers.mk18
1 files changed, 18 insertions, 0 deletions
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index e5520c00c3..03355f56dd 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -360,6 +360,24 @@ check_fortran = \
rm -f $${__o}* \
#
+#
+# Check that the external toolchain supports OpenMP
+#
+# $1: cross-gcc path
+#
+check_openmp = \
+ __CROSS_CC=$(strip $1) ; \
+ __o=$(BUILD_DIR)/.br-toolchain-test-openmp.tmp ; \
+ printf '\#include <omp.h>\nint main(void) { return omp_get_thread_num(); }' | \
+ $${__CROSS_CC} -fopenmp -x c -o $${__o} - ; \
+ if test $$? -ne 0 ; then \
+ rm -f $${__o}* ; \
+ echo "OpenMP support is selected but is not available in external toolchain"; \
+ exit 1 ; \
+ fi ; \
+ rm -f $${__o}* \
+
+#
# Check that the cross-compiler given in the configuration exists
#
# $1: cross-gcc path