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 | |
| 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" |
| 60 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 61 | FILES_${PN} = "${libdir}/libgfortran.so.*" |
| 62 | FILES_${PN}-dev = "\ |
| 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/ \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 69 | " |
| 70 | FILES_${PN}-staticdev = "${libdir}/libgfortran.a" |
| 71 | |
| 72 | INSANE_SKIP_${MLPREFIX}libgfortran-dev = "staticdev" |
| 73 | |
| 74 | do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |
| 75 | do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |
| 76 | do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |
| 77 | |
| 78 | python __anonymous () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 79 | f = d.getVar("FORTRAN") |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 80 | if "fortran" not in f: |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 81 | 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] | 82 | } |