|
@@ -310,6 +310,24 @@ check_cplusplus = \
|
|
|
exit 1 ; \
|
|
|
fi
|
|
|
|
|
|
+#
|
|
|
+#
|
|
|
+# Check that the external toolchain supports Fortran
|
|
|
+#
|
|
|
+# $1: cross-gfortran path
|
|
|
+#
|
|
|
+check_fortran = \
|
|
|
+ __CROSS_FC=$(strip $1) ; \
|
|
|
+ __o=$(BUILD_DIR)/.br-toolchain-test-fortran.tmp ; \
|
|
|
+ printf 'program hello\n\tprint *, "Hello Fortran!\\n"\nend program hello\n' | \
|
|
|
+ $${__CROSS_FC} -x f95 -o $${__o} - ; \
|
|
|
+ if test $$? -ne 0 ; then \
|
|
|
+ rm -f $${__o}* ; \
|
|
|
+ echo "Fortran 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
|
|
|
#
|