blob: e42843d2f11fc057e198d65da8b2fdceb6819de9 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001require gcc-configure-common.inc
2
3EXTRA_OECONF_PATHS = "\
4 --with-sysroot=/not/exist \
5 --with-build-sysroot=${STAGING_DIR_TARGET} \
6"
7
8do_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
24do_compile () {
25 target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
26 cd ${B}/$target/libgfortran/
27 oe_runmake MULTIBUILDTOP=${B}/$target/libgfortran/
28}
29
30do_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
43INHIBIT_DEFAULT_DEPS = "1"
44DEPENDS = "gcc-runtime"
45
46BBCLASSEXTEND = "nativesdk"
47
48PACKAGES = "\
49 ${PN}-dbg \
50 libgfortran \
51 libgfortran-dev \
52 libgfortran-staticdev \
53"
54FILES_${PN} = "${libdir}/libgfortran.so.*"
55FILES_${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"
62FILES_${PN}-staticdev = "${libdir}/libgfortran.a"
63
64INSANE_SKIP_${MLPREFIX}libgfortran-dev = "staticdev"
65
66do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
67do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
68do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
69
70python __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}