libgfortran.inc 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. require gcc-configure-common.inc
  2. EXTRA_OECONF_PATHS = "\
  3. --with-sysroot=/not/exist \
  4. --with-build-sysroot=${STAGING_DIR_TARGET} \
  5. "
  6. do_configure () {
  7. for target in libbacktrace libgfortran
  8. do
  9. rm -rf ${B}/${TARGET_SYS}/$target/
  10. mkdir -p ${B}/${TARGET_SYS}/$target/
  11. cd ${B}/${TARGET_SYS}/$target/
  12. chmod a+x ${S}/$target/configure
  13. relpath=${@os.path.relpath("${S}", "${B}/${TARGET_SYS}")}
  14. ../$relpath/$target/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
  15. # Easiest way to stop bad RPATHs getting into the library since we have a
  16. # broken libtool here
  17. sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/${TARGET_SYS}/$target/libtool
  18. done
  19. }
  20. EXTRACONFFUNCS += "extract_stashed_builddir"
  21. do_configure[depends] += "${COMPILERDEP}"
  22. do_compile () {
  23. for target in libbacktrace libgfortran
  24. do
  25. cd ${B}/${TARGET_SYS}/$target/
  26. oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$target/
  27. done
  28. }
  29. do_install () {
  30. cd ${B}/${TARGET_SYS}/libgfortran/
  31. oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/libgfortran/ install
  32. if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
  33. rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
  34. fi
  35. if [ -d ${D}${infodir} ]; then
  36. rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
  37. fi
  38. chown -R root:root ${D}
  39. }
  40. INHIBIT_DEFAULT_DEPS = "1"
  41. DEPENDS = "gcc-runtime gcc-cross-${TARGET_ARCH}"
  42. BBCLASSEXTEND = "nativesdk"
  43. PACKAGES = "\
  44. ${PN}-dbg \
  45. libgfortran \
  46. libgfortran-dev \
  47. libgfortran-staticdev \
  48. "
  49. LICENSE:${PN} = "GPL-3.0-with-GCC-exception"
  50. LICENSE:${PN}-dev = "GPL-3.0-with-GCC-exception"
  51. LICENSE:${PN}-dbg = "GPL-3.0-with-GCC-exception"
  52. FILES:${PN} = "${libdir}/libgfortran.so.*"
  53. FILES:${PN}-dev = "\
  54. ${libdir}/libgfortran*.so \
  55. ${libdir}/libgfortran.spec \
  56. ${libdir}/libgfortran.la \
  57. ${libdir}/gcc/${TARGET_SYS}/${BINV}/libgfortranbegin.* \
  58. ${libdir}/gcc/${TARGET_SYS}/${BINV}/libcaf_single* \
  59. ${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude/ \
  60. ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ \
  61. "
  62. FILES:${PN}-staticdev = "${libdir}/libgfortran.a"
  63. INSANE_SKIP:${MLPREFIX}libgfortran-dev = "staticdev"
  64. do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
  65. do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
  66. do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
  67. python __anonymous () {
  68. f = d.getVar("FORTRAN")
  69. if "fortran" not in f:
  70. raise bb.parse.SkipRecipe("libgfortran needs fortran support to be enabled in the compiler")
  71. }