Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | require gcc-configure-common.inc |
| 2 | |
| 3 | CXXFLAGS := "${@oe_filter_out('-fvisibility-inlines-hidden', '${CXXFLAGS}', d)}" |
| 4 | |
| 5 | EXTRA_OECONF_PATHS = "\ |
| 6 | --with-gxx-include-dir=${includedir}/c++/${BINV} \ |
| 7 | --with-sysroot=/not/exist \ |
| 8 | --with-build-sysroot=${STAGING_DIR_TARGET} \ |
| 9 | " |
| 10 | |
| 11 | EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu" |
| 12 | |
| 13 | RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic" |
| 14 | # ? |
| 15 | # libiberty |
| 16 | # libmudflap |
| 17 | # libgfortran needs separate recipe due to libquadmath dependency |
| 18 | |
| 19 | do_configure () { |
| 20 | export CXX="${CXX} -nostdinc++ -nostdlib++" |
| 21 | mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 22 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 23 | hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B} |
| 24 | for d in libgcc ${RUNTIMETARGET}; do |
| 25 | echo "Configuring $d" |
| 26 | rm -rf ${B}/$target/$d/ |
| 27 | mkdir -p ${B}/$target/$d/ |
| 28 | cd ${B}/$target/$d/ |
| 29 | chmod a+x ${S}/$d/configure |
| 30 | ${S}/$d/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} |
| 31 | done |
| 32 | } |
| 33 | |
| 34 | do_compile () { |
| 35 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 36 | for d in libgcc ${RUNTIMETARGET}; do |
| 37 | cd ${B}/$target/$d/ |
| 38 | oe_runmake MULTIBUILDTOP=${B}/$target/$d/ |
| 39 | done |
| 40 | } |
| 41 | |
| 42 | do_install () { |
| 43 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 44 | for d in ${RUNTIMETARGET}; do |
| 45 | cd ${B}/$target/$d/ |
| 46 | oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/$d/ install |
| 47 | done |
| 48 | rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir |
| 49 | rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir |
| 50 | if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then |
| 51 | rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude |
| 52 | fi |
| 53 | if [ -d ${D}${infodir} ]; then |
| 54 | rmdir --ignore-fail-on-non-empty -p ${D}${infodir} |
| 55 | fi |
| 56 | if [ "${TARGET_OS}" = "linux-gnuspe" ]; then |
| 57 | ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux |
| 58 | fi |
| 59 | chown -R root:root ${D} |
| 60 | } |
| 61 | |
| 62 | INHIBIT_DEFAULT_DEPS = "1" |
| 63 | DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc" |
| 64 | PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs" |
| 65 | |
| 66 | BBCLASSEXTEND = "nativesdk" |
| 67 | |
| 68 | PACKAGES = "\ |
| 69 | ${PN}-dbg \ |
| 70 | libstdc++ \ |
| 71 | libstdc++-precompile-dev \ |
| 72 | libstdc++-dev \ |
| 73 | libstdc++-staticdev \ |
| 74 | libg2c \ |
| 75 | libg2c-dev \ |
| 76 | libssp \ |
| 77 | libssp-dev \ |
| 78 | libssp-staticdev \ |
| 79 | libmudflap \ |
| 80 | libmudflap-dev \ |
| 81 | libmudflap-staticdev \ |
| 82 | libquadmath \ |
| 83 | libquadmath-dev \ |
| 84 | libquadmath-staticdev \ |
| 85 | libgomp \ |
| 86 | libgomp-dev \ |
| 87 | libgomp-staticdev \ |
| 88 | libatomic \ |
| 89 | libatomic-dev \ |
| 90 | libatomic-staticdev \ |
| 91 | " |
| 92 | |
| 93 | # Most libraries are licensed with the exception, but |
| 94 | # one library is really GPLv3. |
| 95 | # |
| 96 | LICENSE_${PN}-dbg = "GPL-3.0-with-GCC-exception & GPLv3" |
| 97 | LICENSE_libstdc++ = "GPL-3.0-with-GCC-exception" |
| 98 | LICENSE_libstdc++-precompile-dev = "GPL-3.0-with-GCC-exception" |
| 99 | LICENSE_libstdc++-dev = "GPL-3.0-with-GCC-exception" |
| 100 | LICENSE_libstdc++-staticdev = "GPL-3.0-with-GCC-exception" |
| 101 | LICENSE_libg2c = "GPL-3.0-with-GCC-exception" |
| 102 | LICENSE_libg2c-dev = "GPL-3.0-with-GCC-exception" |
| 103 | LICENSE_libssp = "GPL-3.0-with-GCC-exception" |
| 104 | LICENSE_libssp-dev = "GPL-3.0-with-GCC-exception" |
| 105 | LICENSE_libssp-staticdev = "GPL-3.0-with-GCC-exception" |
| 106 | LICENSE_libgfortran = "GPL-3.0-with-GCC-exception" |
| 107 | LICENSE_libgfortran-dev = "GPL-3.0-with-GCC-exception" |
| 108 | LICENSE_libgfortran-staticdev = "GPL-3.0-with-GCC-exception" |
| 109 | LICENSE_libmudflap = "GPL-3.0-with-GCC-exception" |
| 110 | LICENSE_libmudflap-dev = "GPL-3.0-with-GCC-exception" |
| 111 | LICENSE_libmudflap-staticdev = "GPL-3.0-with-GCC-exception" |
| 112 | LICENSE_libquadmath = "GPL-3.0-with-GCC-exception" |
| 113 | LICENSE_libquadmath-dev = "GPL-3.0-with-GCC-exception" |
| 114 | LICENSE_libquadmath-staticdev = "GPL-3.0-with-GCC-exception" |
| 115 | LICENSE_libatomic = "GPL-3.0-with-GCC-exception" |
| 116 | LICENSE_libatomic-dev = "GPL-3.0-with-GCC-exception" |
| 117 | LICENSE_libatomic-staticdev = "GPL-3.0-with-GCC-exception" |
| 118 | |
| 119 | LICENSE_libgomp = "GPLv3" |
| 120 | LICENSE_libgomp-dev = "GPLv3" |
| 121 | LICENSE_libgomp-staticdev = "GPLv3" |
| 122 | |
| 123 | # The base package doesn't exist, so we clear the recommends. |
| 124 | RRECOMMENDS_${PN}-dbg = "" |
| 125 | |
| 126 | # include python debugging scripts |
| 127 | FILES_${PN}-dbg += "\ |
| 128 | ${libdir}/libstdc++.so.*-gdb.py \ |
| 129 | ${datadir}/gcc-${BINV}/python/libstdcxx \ |
| 130 | " |
| 131 | |
| 132 | FILES_libg2c = "${target_libdir}/libg2c.so.*" |
| 133 | FILES_libg2c-dev = "\ |
| 134 | ${libdir}/libg2c.so \ |
| 135 | ${libdir}/libg2c.a \ |
| 136 | ${libdir}/libfrtbegin.a \ |
| 137 | " |
| 138 | |
| 139 | FILES_libstdc++ = "${libdir}/libstdc++.so.*" |
| 140 | FILES_libstdc++-dev = "\ |
| 141 | ${includedir}/c++/ \ |
| 142 | ${libdir}/libstdc++.so \ |
| 143 | ${libdir}/libstdc++.la \ |
| 144 | ${libdir}/libsupc++.la \ |
| 145 | " |
| 146 | FILES_libstdc++-staticdev = "\ |
| 147 | ${libdir}/libstdc++.a \ |
| 148 | ${libdir}/libsupc++.a \ |
| 149 | " |
| 150 | |
| 151 | FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch" |
| 152 | |
| 153 | FILES_libssp = "${libdir}/libssp.so.*" |
| 154 | FILES_libssp-dev = "\ |
| 155 | ${libdir}/libssp*.so \ |
| 156 | ${libdir}/libssp*_nonshared.a \ |
| 157 | ${libdir}/libssp*.la \ |
| 158 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \ |
| 159 | " |
| 160 | FILES_libssp-staticdev = "${libdir}/libssp*.a" |
| 161 | |
| 162 | FILES_libquadmath = "${libdir}/libquadmath*.so.*" |
| 163 | FILES_libquadmath-dev = "\ |
| 164 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \ |
| 165 | ${libdir}/libquadmath*.so \ |
| 166 | ${libdir}/libquadmath.la \ |
| 167 | " |
| 168 | FILES_libquadmath-staticdev = "${libdir}/libquadmath.a" |
| 169 | |
| 170 | FILES_libmudflap = "${libdir}/libmudflap*.so.*" |
| 171 | FILES_libmudflap-dev = "\ |
| 172 | ${libdir}/libmudflap*.so \ |
| 173 | ${libdir}/libmudflap.la \ |
| 174 | " |
| 175 | FILES_libmudflap-staticdev = "${libdir}/libmudflap.a" |
| 176 | |
| 177 | FILES_libgomp = "${libdir}/libgomp*${SOLIBS}" |
| 178 | FILES_libgomp-dev = "\ |
| 179 | ${libdir}/libgomp*${SOLIBSDEV} \ |
| 180 | ${libdir}/libgomp*.la \ |
| 181 | ${libdir}/libgomp.spec \ |
| 182 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \ |
| 183 | " |
| 184 | FILES_libgomp-staticdev = "${libdir}/libgomp*.a" |
| 185 | |
| 186 | FILES_libatomic = "${libdir}/libatomic.so.*" |
| 187 | FILES_libatomic-dev = "\ |
| 188 | ${libdir}/libatomic.so \ |
| 189 | ${libdir}/libatomic.la \ |
| 190 | " |
| 191 | FILES_libatomic-staticdev = "${libdir}/libatomic.a" |
| 192 | |
| 193 | do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |
| 194 | do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |
| 195 | do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |