diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-05 00:48:30 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-05 14:24:43 +0000 |
commit | 5bde5d9b39ea67f19a1a6aedd0c08c6cfedcbe5f (patch) | |
tree | 0dd4a18f59565236a07548ddba67d9cc52b5de07 /meta/recipes-devtools/gcc/libgfortran.inc | |
parent | a67654e06ec8b0bda8fe953e1b5357e2d297c375 (diff) | |
download | poky-5bde5d9b39ea67f19a1a6aedd0c08c6cfedcbe5f.tar.gz |
gcc: Allow fortran to build successfully in 4.8
gcc 4.8 fortran presents some challenges:
* libquadmath headers need to be in the libexec include dir. It turns out
to be easiest just to manually do this.
* libgfortran configure needs libquadmath to be compiled. This means
a separate recipe is needed (the alternative is gross hacks)
* the libtool uses to link libgfortran doesn't have our improved rpath
handling and puts bogus RPATHS into the libraries. We can avoid this
by tweaking libtool with sed.
This patch resolves those issues. Any user of fortran does need to DEPEND
on libgfortran in order to trigger it to build but this shouldn't be a major
issue.
(From OE-Core rev: a5e7ee5770b9e0cf719c573efffd874440f74289)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 | } | ||