summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/libgfortran.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/libgfortran.inc')
-rw-r--r--meta/recipes-devtools/gcc/libgfortran.inc75
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 @@
1require gcc-configure-common.inc
2
3EXTRA_OECONF_PATHS = " \
4 --with-sysroot=${STAGING_DIR_TARGET} \
5 --with-build-sysroot=${STAGING_DIR_TARGET}"
6
7do_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
25do_compile () {
26 target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
27 cd ${B}/$target/libgfortran/
28 oe_runmake MULTIBUILDTOP=${B}/$target/libgfortran/
29}
30
31do_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
44INHIBIT_DEFAULT_DEPS = "1"
45DEPENDS = "gcc-runtime"
46
47BBCLASSEXTEND = "nativesdk"
48
49PACKAGES = "\
50 ${PN}-dbg \
51 libgfortran \
52 libgfortran-dev \
53 libgfortran-staticdev \
54"
55FILES_${PN} = "${libdir}/libgfortran.so.*"
56FILES_${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*"
62FILES_${PN}-staticdev = " \
63 ${libdir}/libgfortran.a"
64
65INSANE_SKIP_${MLPREFIX}libgfortran-dev = "staticdev"
66
67do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
68do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
69do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
70
71python __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}