Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | require gcc-configure-common.inc |
| 2 | |
| 3 | EXTRA_OECONF_PATHS = "\ |
| 4 | --with-sysroot=/not/exist \ |
| 5 | --with-build-sysroot=${STAGING_DIR_TARGET} \ |
| 6 | " |
| 7 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 8 | # An arm hard float target like raspberrypi4 won't build |
| 9 | # as CFLAGS don't make it to the fortran compiler otherwise |
| 10 | # (the configure script sets FC to $GFORTRAN unconditionally) |
| 11 | export GFORTRAN = "${FC}" |
| 12 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 13 | do_configure () { |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 14 | for target in libbacktrace libgfortran |
| 15 | do |
| 16 | rm -rf ${B}/${TARGET_SYS}/$target/ |
| 17 | mkdir -p ${B}/${TARGET_SYS}/$target/ |
| 18 | cd ${B}/${TARGET_SYS}/$target/ |
| 19 | chmod a+x ${S}/$target/configure |
| 20 | relpath=${@os.path.relpath("${S}", "${B}/${TARGET_SYS}")} |
| 21 | ../$relpath/$target/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} |
| 22 | # Easiest way to stop bad RPATHs getting into the library since we have a |
| 23 | # broken libtool here |
| 24 | sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/${TARGET_SYS}/$target/libtool |
| 25 | done |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | } |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 27 | EXTRACONFFUNCS += "extract_stashed_builddir" |
| 28 | do_configure[depends] += "${COMPILERDEP}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 29 | |
| 30 | do_compile () { |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 31 | for target in libbacktrace libgfortran |
| 32 | do |
| 33 | cd ${B}/${TARGET_SYS}/$target/ |
| 34 | oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$target/ |
| 35 | done |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | do_install () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 39 | cd ${B}/${TARGET_SYS}/libgfortran/ |
| 40 | oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/libgfortran/ install |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 41 | if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then |
| 42 | rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude |
| 43 | fi |
| 44 | if [ -d ${D}${infodir} ]; then |
| 45 | rmdir --ignore-fail-on-non-empty -p ${D}${infodir} |
| 46 | fi |
| 47 | chown -R root:root ${D} |
| 48 | } |
| 49 | |
| 50 | INHIBIT_DEFAULT_DEPS = "1" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 51 | DEPENDS = "gcc-runtime gcc-cross-${TARGET_ARCH}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 52 | |
| 53 | BBCLASSEXTEND = "nativesdk" |
| 54 | |
| 55 | PACKAGES = "\ |
| 56 | ${PN}-dbg \ |
| 57 | libgfortran \ |
| 58 | libgfortran-dev \ |
| 59 | libgfortran-staticdev \ |
| 60 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 61 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 62 | LICENSE:${PN} = "GPL-3.0-with-GCC-exception" |
| 63 | LICENSE:${PN}-dev = "GPL-3.0-with-GCC-exception" |
| 64 | LICENSE:${PN}-dbg = "GPL-3.0-with-GCC-exception" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 65 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 66 | FILES:${PN} = "${libdir}/libgfortran.so.*" |
| 67 | FILES:${PN}-dev = "\ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 68 | ${libdir}/libgfortran*.so \ |
| 69 | ${libdir}/libgfortran.spec \ |
| 70 | ${libdir}/libgfortran.la \ |
| 71 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/libgfortranbegin.* \ |
| 72 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/libcaf_single* \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 73 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude/ \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 74 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 75 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 76 | FILES:${PN}-staticdev = "${libdir}/libgfortran.a" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 77 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 78 | INSANE_SKIP:${MLPREFIX}libgfortran-dev = "staticdev" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 79 | |
| 80 | do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |
| 81 | do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |
| 82 | do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |
| 83 | |
| 84 | python __anonymous () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 85 | f = d.getVar("FORTRAN") |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 86 | if "fortran" not in f: |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 87 | raise bb.parse.SkipRecipe("libgfortran needs fortran support to be enabled in the compiler") |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 88 | } |