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