blob: 58ceb2e073f6bde301a5559a5d0a8a9a6b370f27 [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
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050018 relpath=${@os.path.relpath("${S}/libgfortran", "${B}/$target/libgfortran")}
19 $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050020 # 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* \
62"
63FILES_${PN}-staticdev = "${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}