diff options
Diffstat (limited to 'meta-selftest')
-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 | ||