diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/libgfortran.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/libgfortran.inc | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/libgfortran.inc b/meta/recipes-devtools/gcc/libgfortran.inc new file mode 100644 index 0000000000..3ae063279e --- /dev/null +++ b/meta/recipes-devtools/gcc/libgfortran.inc | |||
@@ -0,0 +1,75 @@ | |||
1 | require gcc-configure-common.inc | ||
2 | |||
3 | EXTRA_OECONF_PATHS = " \ | ||
4 | --with-sysroot=${STAGING_DIR_TARGET} \ | ||
5 | --with-build-sysroot=${STAGING_DIR_TARGET}" | ||
6 | |||
7 | do_configure () { | ||
8 | mtarget=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` | ||
9 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` | ||
10 | #cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget/* ${B} | ||
11 | (cd ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget/; find . -print0 | cpio --null -pdlu ${B}) | ||
12 | (cd ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget/; find . -type l -print0 | cpio -pd0mLu --no-preserve-owner ${B}) | ||
13 | |||
14 | echo "Configuring libgfortran" | ||
15 | rm -rf ${B}/$target/libgfortran/ | ||
16 | mkdir -p ${B}/$target/libgfortran/ | ||
17 | cd ${B}/$target/libgfortran/ | ||
18 | chmod a+x ${S}/libgfortran/configure | ||
19 | ${S}/libgfortran/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} | ||
20 | # Easiest way to stop bad RPATHs getting into the library since we have a | ||
21 | # broken libtool here | ||
22 | sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libgfortran/libtool | ||
23 | } | ||
24 | |||
25 | do_compile () { | ||
26 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` | ||
27 | cd ${B}/$target/libgfortran/ | ||
28 | oe_runmake MULTIBUILDTOP=${B}/$target/libgfortran/ | ||
29 | } | ||
30 | |||
31 | do_install () { | ||
32 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` | ||
33 | cd ${B}/$target/libgfortran/ | ||
34 | oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/libgfortran/ install | ||
35 | if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then | ||
36 | rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude | ||
37 | fi | ||
38 | if [ -d ${D}${infodir} ]; then | ||
39 | rmdir --ignore-fail-on-non-empty -p ${D}${infodir} | ||
40 | fi | ||
41 | chown -R root:root ${D} | ||
42 | } | ||
43 | |||
44 | INHIBIT_DEFAULT_DEPS = "1" | ||
45 | DEPENDS = "gcc-runtime" | ||
46 | |||
47 | BBCLASSEXTEND = "nativesdk" | ||
48 | |||
49 | PACKAGES = "\ | ||
50 | ${PN}-dbg \ | ||
51 | libgfortran \ | ||
52 | libgfortran-dev \ | ||
53 | libgfortran-staticdev \ | ||
54 | " | ||
55 | FILES_${PN} = "${libdir}/libgfortran.so.*" | ||
56 | FILES_${PN}-dev = " \ | ||
57 | ${libdir}/libgfortran*.so \ | ||
58 | ${libdir}/libgfortran.spec \ | ||
59 | ${libdir}/libgfortran.la \ | ||
60 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/libgfortranbegin.* \ | ||
61 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/libcaf_single*" | ||
62 | FILES_${PN}-staticdev = " \ | ||
63 | ${libdir}/libgfortran.a" | ||
64 | |||
65 | INSANE_SKIP_${MLPREFIX}libgfortran-dev = "staticdev" | ||
66 | |||
67 | do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata" | ||
68 | do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata" | ||
69 | do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata" | ||
70 | |||
71 | python __anonymous () { | ||
72 | f = d.getVar("FORTRAN", True) | ||
73 | if "fortran" not in f: | ||
74 | raise bb.parse.SkipPackage("libgfortran needs fortran support to be enabled in the compiler") | ||
75 | } | ||