diff options
author | Samuel Martin <s.martin49@gmail.com> | 2016-07-03 15:47:44 +0200 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2016-07-03 16:58:11 +0200 |
commit | 26db83c8a03bd7199902a9bcb62a0b63537c0048 (patch) | |
tree | 2aacf9a3df9112dbff5cab90bd01e905098844ef /toolchain | |
parent | 019ba1dc5283864405f966fbbf9ce799a06f7c27 (diff) |
toolchain/helpers: add fortran check
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
[Thomas: remove extension for the generated temporary file, since it's
really an executable, not an object file.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'toolchain')
-rw-r--r-- | toolchain/helpers.mk | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index 108fdaa74..3991bc1cf 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -311,6 +311,24 @@ check_cplusplus = \ 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 # # $1: cross-gcc path |