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 () { |
| 9 | mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 10 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 11 | hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B} |
| 12 | |
| 13 | echo "Configuring libgfortran" |
| 14 | rm -rf ${B}/$target/libgfortran/ |
| 15 | mkdir -p ${B}/$target/libgfortran/ |
| 16 | cd ${B}/$target/libgfortran/ |
| 17 | chmod a+x ${S}/libgfortran/configure |
| 18 | ${S}/libgfortran/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} |
| 19 | # Easiest way to stop bad RPATHs getting into the library since we have a |
| 20 | # broken libtool here |
| 21 | sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libgfortran/libtool |
| 22 | } |
| 23 | |
| 24 | do_compile () { |
| 25 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 26 | cd ${B}/$target/libgfortran/ |
| 27 | oe_runmake MULTIBUILDTOP=${B}/$target/libgfortran/ |
| 28 | } |
| 29 | |
| 30 | do_install () { |
| 31 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 32 | cd ${B}/$target/libgfortran/ |
| 33 | oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/libgfortran/ install |
| 34 | if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then |
| 35 | rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude |
| 36 | fi |
| 37 | if [ -d ${D}${infodir} ]; then |
| 38 | rmdir --ignore-fail-on-non-empty -p ${D}${infodir} |
| 39 | fi |
| 40 | chown -R root:root ${D} |
| 41 | } |
| 42 | |
| 43 | INHIBIT_DEFAULT_DEPS = "1" |
| 44 | DEPENDS = "gcc-runtime" |
| 45 | |
| 46 | BBCLASSEXTEND = "nativesdk" |
| 47 | |
| 48 | PACKAGES = "\ |
| 49 | ${PN}-dbg \ |
| 50 | libgfortran \ |
| 51 | libgfortran-dev \ |
| 52 | libgfortran-staticdev \ |
| 53 | " |
| 54 | FILES_${PN} = "${libdir}/libgfortran.so.*" |
| 55 | FILES_${PN}-dev = "\ |
| 56 | ${libdir}/libgfortran*.so \ |
| 57 | ${libdir}/libgfortran.spec \ |
| 58 | ${libdir}/libgfortran.la \ |
| 59 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/libgfortranbegin.* \ |
| 60 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/libcaf_single* \ |
| 61 | " |
| 62 | FILES_${PN}-staticdev = "${libdir}/libgfortran.a" |
| 63 | |
| 64 | INSANE_SKIP_${MLPREFIX}libgfortran-dev = "staticdev" |
| 65 | |
| 66 | do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |
| 67 | do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |
| 68 | do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |
| 69 | |
| 70 | python __anonymous () { |
| 71 | f = d.getVar("FORTRAN", True) |
| 72 | if "fortran" not in f: |
| 73 | raise bb.parse.SkipPackage("libgfortran needs fortran support to be enabled in the compiler") |
| 74 | } |