Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | require gcc-configure-common.inc |
| 2 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 3 | SUMMARY = "Runtime libraries from GCC" |
| 4 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 5 | # Over-ride the LICENSE set by gcc-${PV}.inc to remove "& GPLv3" |
| 6 | # All gcc-runtime packages are now covered by the runtime exception. |
| 7 | LICENSE = "GPL-3.0-with-GCC-exception" |
| 8 | |
| 9 | CXXFLAGS_remove = "-fvisibility-inlines-hidden" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 10 | |
| 11 | EXTRA_OECONF_PATHS = "\ |
| 12 | --with-gxx-include-dir=${includedir}/c++/${BINV} \ |
| 13 | --with-sysroot=/not/exist \ |
| 14 | --with-build-sysroot=${STAGING_DIR_TARGET} \ |
| 15 | " |
| 16 | |
| 17 | EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu" |
| 18 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 19 | RUNTIMELIBITM = "libitm" |
| 20 | RUNTIMELIBITM_mips = "" |
| 21 | RUNTIMELIBITM_mipsel = "" |
| 22 | RUNTIMELIBITM_mips64 = "" |
| 23 | RUNTIMELIBITM_mips64el = "" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 24 | RUNTIMELIBITM_mipsisa32r6 = "" |
| 25 | RUNTIMELIBITM_mipsisa32r6el = "" |
| 26 | RUNTIMELIBITM_mipsisa64r6 = "" |
| 27 | RUNTIMELIBITM_mipsisa64r6el = "" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 28 | RUNTIMELIBITM_nios2 = "" |
| 29 | RUNTIMELIBITM_microblaze = "" |
| 30 | |
| 31 | RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \ |
| 32 | ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \ |
| 33 | " |
| 34 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 35 | # ? |
| 36 | # libiberty |
| 37 | # libmudflap |
| 38 | # libgfortran needs separate recipe due to libquadmath dependency |
| 39 | |
| 40 | do_configure () { |
| 41 | export CXX="${CXX} -nostdinc++ -nostdlib++" |
| 42 | mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 43 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 44 | hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B} |
| 45 | for d in libgcc ${RUNTIMETARGET}; do |
| 46 | echo "Configuring $d" |
| 47 | rm -rf ${B}/$target/$d/ |
| 48 | mkdir -p ${B}/$target/$d/ |
| 49 | cd ${B}/$target/$d/ |
| 50 | chmod a+x ${S}/$d/configure |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 51 | relpath=${@os.path.relpath("${S}/$d", "${B}/$target/$d")} |
| 52 | $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 53 | done |
| 54 | } |
| 55 | |
| 56 | do_compile () { |
| 57 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 58 | for d in libgcc ${RUNTIMETARGET}; do |
| 59 | cd ${B}/$target/$d/ |
| 60 | oe_runmake MULTIBUILDTOP=${B}/$target/$d/ |
| 61 | done |
| 62 | } |
| 63 | |
| 64 | do_install () { |
| 65 | target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` |
| 66 | for d in ${RUNTIMETARGET}; do |
| 67 | cd ${B}/$target/$d/ |
| 68 | oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/$d/ install |
| 69 | done |
| 70 | rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 71 | rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 72 | rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir |
| 73 | if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then |
| 74 | rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude |
| 75 | fi |
| 76 | if [ -d ${D}${infodir} ]; then |
| 77 | rmdir --ignore-fail-on-non-empty -p ${D}${infodir} |
| 78 | fi |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 79 | if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then |
| 80 | ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS} |
| 81 | fi |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 82 | |
| 83 | } |
| 84 | |
| 85 | do_install_append_class-target () { |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 86 | if [ "${TARGET_OS}" = "linux-gnuspe" ]; then |
| 87 | ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux |
| 88 | fi |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 89 | |
| 90 | if [ "${TARGET_OS}" = "linux-gnun32" ]; then |
| 91 | if [ "${MULTILIBS}" != "" ]; then |
| 92 | mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-pokymllib64-linux |
| 93 | ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-pokymllib64-linux/32 |
| 94 | else |
| 95 | ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux |
| 96 | fi |
| 97 | fi |
| 98 | if [ "${TARGET_OS}" = "linux-gnux32" ]; then |
| 99 | if [ "${MULTILIBS}" != "" ]; then |
| 100 | mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-poky-linux |
| 101 | ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-poky-linux/x32 |
| 102 | else |
| 103 | ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux |
| 104 | fi |
| 105 | fi |
| 106 | |
| 107 | if [ "${TCLIBC}" != "glibc" ]; then |
| 108 | case "${TARGET_OS}" in |
| 109 | "linux-musl" | "linux-uclibc" | "linux-*spe") extra_target_os="linux";; |
| 110 | "linux-musleabi" | "linux-uclibceabi") extra_target_os="linux-gnueabi";; |
| 111 | *) extra_target_os="linux";; |
| 112 | esac |
| 113 | ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os |
| 114 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 115 | chown -R root:root ${D} |
| 116 | } |
| 117 | |
| 118 | INHIBIT_DEFAULT_DEPS = "1" |
| 119 | DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc" |
| 120 | PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs" |
| 121 | |
| 122 | BBCLASSEXTEND = "nativesdk" |
| 123 | |
| 124 | PACKAGES = "\ |
| 125 | ${PN}-dbg \ |
| 126 | libstdc++ \ |
| 127 | libstdc++-precompile-dev \ |
| 128 | libstdc++-dev \ |
| 129 | libstdc++-staticdev \ |
| 130 | libg2c \ |
| 131 | libg2c-dev \ |
| 132 | libssp \ |
| 133 | libssp-dev \ |
| 134 | libssp-staticdev \ |
| 135 | libmudflap \ |
| 136 | libmudflap-dev \ |
| 137 | libmudflap-staticdev \ |
| 138 | libquadmath \ |
| 139 | libquadmath-dev \ |
| 140 | libquadmath-staticdev \ |
| 141 | libgomp \ |
| 142 | libgomp-dev \ |
| 143 | libgomp-staticdev \ |
| 144 | libatomic \ |
| 145 | libatomic-dev \ |
| 146 | libatomic-staticdev \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 147 | libitm \ |
| 148 | libitm-dev \ |
| 149 | libitm-staticdev \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 150 | " |
| 151 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 152 | # The base package doesn't exist, so we clear the recommends. |
| 153 | RRECOMMENDS_${PN}-dbg = "" |
| 154 | |
| 155 | # include python debugging scripts |
| 156 | FILES_${PN}-dbg += "\ |
| 157 | ${libdir}/libstdc++.so.*-gdb.py \ |
| 158 | ${datadir}/gcc-${BINV}/python/libstdcxx \ |
| 159 | " |
| 160 | |
| 161 | FILES_libg2c = "${target_libdir}/libg2c.so.*" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 162 | SUMMARY_libg2c = "Companion runtime library for g77" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 163 | FILES_libg2c-dev = "\ |
| 164 | ${libdir}/libg2c.so \ |
| 165 | ${libdir}/libg2c.a \ |
| 166 | ${libdir}/libfrtbegin.a \ |
| 167 | " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 168 | SUMMARY_libg2c-dev = "Companion runtime library for g77 - development files" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 169 | |
| 170 | FILES_libstdc++ = "${libdir}/libstdc++.so.*" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 171 | SUMMARY_libstdc++ = "GNU standard C++ library" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 172 | FILES_libstdc++-dev = "\ |
| 173 | ${includedir}/c++/ \ |
| 174 | ${libdir}/libstdc++.so \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 175 | ${libdir}/libstdc++*.la \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 176 | ${libdir}/libsupc++.la \ |
| 177 | " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 178 | SUMMARY_libstdc++-dev = "GNU standard C++ library - development files" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 179 | FILES_libstdc++-staticdev = "\ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 180 | ${libdir}/libstdc++*.a \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 181 | ${libdir}/libsupc++.a \ |
| 182 | " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 183 | SUMMARY_libstdc++-staticdev = "GNU standard C++ library - static development files" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 184 | |
| 185 | FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 186 | SUMMARY_libstdc++-precompile-dev = "GNU standard C++ library - precompiled header files" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 187 | |
| 188 | FILES_libssp = "${libdir}/libssp.so.*" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 189 | SUMMARY_libssp = "GNU stack smashing protection library" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 190 | FILES_libssp-dev = "\ |
| 191 | ${libdir}/libssp*.so \ |
| 192 | ${libdir}/libssp*_nonshared.a \ |
| 193 | ${libdir}/libssp*.la \ |
| 194 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \ |
| 195 | " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 196 | SUMMARY_libssp-dev = "GNU stack smashing protection library - development files" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 197 | FILES_libssp-staticdev = "${libdir}/libssp*.a" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 198 | SUMMARY_libssp-staticdev = "GNU stack smashing protection library - static development files" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 199 | |
| 200 | FILES_libquadmath = "${libdir}/libquadmath*.so.*" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 201 | SUMMARY_libquadmath = "GNU quad-precision math library" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 202 | FILES_libquadmath-dev = "\ |
| 203 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \ |
| 204 | ${libdir}/libquadmath*.so \ |
| 205 | ${libdir}/libquadmath.la \ |
| 206 | " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 207 | SUMMARY_libquadmath-dev = "GNU quad-precision math library - development files" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 208 | FILES_libquadmath-staticdev = "${libdir}/libquadmath.a" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 209 | SUMMARY_libquadmath-staticdev = "GNU quad-precision math library - static development files" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 210 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 211 | # NOTE: mudflap has been removed as of gcc 4.9 and has been superseded by the address sanitiser |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 212 | FILES_libmudflap = "${libdir}/libmudflap*.so.*" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 213 | SUMMARY_libmudflap = "Pointer debugging library for gcc" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 214 | FILES_libmudflap-dev = "\ |
| 215 | ${libdir}/libmudflap*.so \ |
| 216 | ${libdir}/libmudflap.la \ |
| 217 | " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 218 | SUMMARY_libmudflap-dev = "Pointer debugging library for gcc - development files" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 219 | FILES_libmudflap-staticdev = "${libdir}/libmudflap.a" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 220 | SUMMARY_libmudflap-staticdev = "Pointer debugging library for gcc - static development files" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 221 | |
| 222 | FILES_libgomp = "${libdir}/libgomp*${SOLIBS}" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 223 | SUMMARY_libgomp = "GNU OpenMP parallel programming library" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 224 | FILES_libgomp-dev = "\ |
| 225 | ${libdir}/libgomp*${SOLIBSDEV} \ |
| 226 | ${libdir}/libgomp*.la \ |
| 227 | ${libdir}/libgomp.spec \ |
| 228 | ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \ |
| 229 | " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 230 | SUMMARY_libgomp-dev = "GNU OpenMP parallel programming library - development files" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 231 | FILES_libgomp-staticdev = "${libdir}/libgomp*.a" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 232 | SUMMARY_libgomp-staticdev = "GNU OpenMP parallel programming library - static development files" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 233 | |
| 234 | FILES_libatomic = "${libdir}/libatomic.so.*" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 235 | SUMMARY_libatomic = "GNU C++11 atomics support library" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 236 | FILES_libatomic-dev = "\ |
| 237 | ${libdir}/libatomic.so \ |
| 238 | ${libdir}/libatomic.la \ |
| 239 | " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 240 | SUMMARY_libatomic-dev = "GNU C++11 atomics support library - development files" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 241 | FILES_libatomic-staticdev = "${libdir}/libatomic.a" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 242 | SUMMARY_libatomic-staticdev = "GNU C++11 atomics support library - static development files" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 243 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 244 | FILES_libitm = "${libdir}/libitm.so.*" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 245 | SUMMARY_libitm = "GNU transactional memory support library" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 246 | FILES_libitm-dev = "\ |
| 247 | ${libdir}/libitm.so \ |
| 248 | ${libdir}/libitm.la \ |
| 249 | ${libdir}/libitm.spec \ |
| 250 | " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 251 | SUMMARY_libitm-dev = "GNU transactional memory support library - development files" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 252 | FILES_libitm-staticdev = "${libdir}/libitm.a" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 253 | SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 254 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 255 | do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |
| 256 | do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |
| 257 | do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata" |