diff mbox series

[1/2] fortran-helloworld: add a very dumb Fortran Hello World for testing

Message ID 20190624111324.8921-1-ross.burton@intel.com
State Superseded
Headers show
Series [1/2] fortran-helloworld: add a very dumb Fortran Hello World for testing | expand

Commit Message

Ross Burton June 24, 2019, 11:13 a.m. UTC
For future runtime testing something more complex is preferred but this is
sufficient to exercise the cross compiler.

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta-selftest/recipes-test/fortran/files/hello.f95 |  5 +++++
 .../recipes-test/fortran/fortran-helloworld.bb     | 23 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 meta-selftest/recipes-test/fortran/files/hello.f95
 create mode 100644 meta-selftest/recipes-test/fortran/fortran-helloworld.bb

-- 
2.11.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

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 00000000000..a0745fc64d7
--- /dev/null
+++ b/meta-selftest/recipes-test/fortran/files/hello.f95
@@ -0,0 +1,5 @@ 
+program helloworld
+
+      print * , "Hello World!"
+
+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 00000000000..3f5298aeee2
--- /dev/null
+++ b/meta-selftest/recipes-test/fortran/fortran-helloworld.bb
@@ -0,0 +1,23 @@ 
+SUMMARY = "Fortran Hello World"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://hello.f95"
+
+# These set flags that Fortran doesn't support
+SECURITY_CFLAGS = ""
+SECURITY_LDFLAGS = ""
+
+do_compile() {
+	${HOST_PREFIX}gfortran ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS} ${WORKDIR}/hello.f95 -o ${B}/fortran-hello
+}
+
+do_install() {
+	install -d ${D}${bindir}
+	install ${B}/fortran-hello ${D}${bindir}
+}
+
+python () {
+    if not d.getVar("FORTRAN"):
+        raise bb.parse.SkipRecipe("Fortran isn't enabled")
+}
\ No newline at end of file