summaryrefslogtreecommitdiffstats
path: root/meta-selftest/recipes-test/fortran
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2019-06-25 15:52:02 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-27 12:20:36 +0100
commitf0c76ce18c874ffc9ca036eb1f7709ab9536059a (patch)
treed45b93ccaaa846f9af39ce119c735252883e303d /meta-selftest/recipes-test/fortran
parentf5379ec0d0942fff2f4c6a4ddceefc8a4fb2107d (diff)
downloadpoky-f0c76ce18c874ffc9ca036eb1f7709ab9536059a.tar.gz
fortran-helloworld: add a very dumb Fortran Hello World for testing
For future runtime testing something more complex is preferred but this is sufficient to exercise the cross compiler. (From OE-Core rev: 7d5f39ca717fa1caea357a4366bbf106386432c0) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-selftest/recipes-test/fortran')
-rw-r--r--meta-selftest/recipes-test/fortran/files/hello.f955
-rw-r--r--meta-selftest/recipes-test/fortran/fortran-helloworld.bb25
2 files changed, 30 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/fortran/files/hello.f95 b/meta-selftest/recipes-test/fortran/files/hello.f95
new file mode 100644
index 0000000000..a0745fc64d
--- /dev/null
+++ b/meta-selftest/recipes-test/fortran/files/hello.f95
@@ -0,0 +1,5 @@
1program helloworld
2
3 print * , "Hello World!"
4
5end program helloworld
diff --git a/meta-selftest/recipes-test/fortran/fortran-helloworld.bb b/meta-selftest/recipes-test/fortran/fortran-helloworld.bb
new file mode 100644
index 0000000000..97313d7e24
--- /dev/null
+++ b/meta-selftest/recipes-test/fortran/fortran-helloworld.bb
@@ -0,0 +1,25 @@
1SUMMARY = "Fortran Hello World"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4
5DEPENDS = "libgfortran"
6
7SRC_URI = "file://hello.f95"
8
9# These set flags that Fortran doesn't support
10SECURITY_CFLAGS = ""
11SECURITY_LDFLAGS = ""
12
13do_compile() {
14 ${HOST_PREFIX}gfortran ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS} ${WORKDIR}/hello.f95 -o ${B}/fortran-hello
15}
16
17do_install() {
18 install -d ${D}${bindir}
19 install ${B}/fortran-hello ${D}${bindir}
20}
21
22python () {
23 if not d.getVar("FORTRAN"):
24 raise bb.parse.SkipRecipe("Fortran isn't enabled")
25} \ No newline at end of file