From: Ross Burton Date: Tue, 25 Jun 2019 14:52:02 +0000 (+0100) Subject: fortran-helloworld: add a very dumb Fortran Hello World for testing X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~14065 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d5f39ca717fa1caea357a4366bbf106386432c0;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- 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..97313d7e249 --- /dev/null +++ b/meta-selftest/recipes-test/fortran/fortran-helloworld.bb @@ -0,0 +1,25 @@ +SUMMARY = "Fortran Hello World" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +DEPENDS = "libgfortran" + +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