diff options
author | Ross Burton <ross.burton@intel.com> | 2019-06-25 15:52:02 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-06-27 12:20:36 +0100 |
commit | f0c76ce18c874ffc9ca036eb1f7709ab9536059a (patch) | |
tree | d45b93ccaaa846f9af39ce119c735252883e303d /meta-selftest/recipes-test/fortran | |
parent | f5379ec0d0942fff2f4c6a4ddceefc8a4fb2107d (diff) | |
download | poky-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.f95 | 5 | ||||
-rw-r--r-- | meta-selftest/recipes-test/fortran/fortran-helloworld.bb | 25 |
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 @@ | |||
1 | program helloworld | ||
2 | |||
3 | print * , "Hello World!" | ||
4 | |||
5 | end 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 @@ | |||
1 | SUMMARY = "Fortran Hello World" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
4 | |||
5 | DEPENDS = "libgfortran" | ||
6 | |||
7 | SRC_URI = "file://hello.f95" | ||
8 | |||
9 | # These set flags that Fortran doesn't support | ||
10 | SECURITY_CFLAGS = "" | ||
11 | SECURITY_LDFLAGS = "" | ||
12 | |||
13 | do_compile() { | ||
14 | ${HOST_PREFIX}gfortran ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS} ${WORKDIR}/hello.f95 -o ${B}/fortran-hello | ||
15 | } | ||
16 | |||
17 | do_install() { | ||
18 | install -d ${D}${bindir} | ||
19 | install ${B}/fortran-hello ${D}${bindir} | ||
20 | } | ||
21 | |||
22 | python () { | ||
23 | if not d.getVar("FORTRAN"): | ||
24 | raise bb.parse.SkipRecipe("Fortran isn't enabled") | ||
25 | } \ No newline at end of file | ||