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