blob: 15252f1a4028f3358b7f3802fe876a8198f366c9 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001require gcc-configure-common.inc
2
Patrick Williamsc0f7c042017-02-23 20:41:17 -06003SUMMARY = "Runtime libraries from GCC"
4
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05005# Over-ride the LICENSE set by gcc-${PV}.inc to remove "& GPLv3"
6# All gcc-runtime packages are now covered by the runtime exception.
7LICENSE = "GPL-3.0-with-GCC-exception"
8
9CXXFLAGS_remove = "-fvisibility-inlines-hidden"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010
11EXTRA_OECONF_PATHS = "\
12 --with-gxx-include-dir=${includedir}/c++/${BINV} \
13 --with-sysroot=/not/exist \
14 --with-build-sysroot=${STAGING_DIR_TARGET} \
15"
16
17EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
18
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050019RUNTIMELIBITM = "libitm"
20RUNTIMELIBITM_mips = ""
21RUNTIMELIBITM_mipsel = ""
22RUNTIMELIBITM_mips64 = ""
23RUNTIMELIBITM_mips64el = ""
Patrick Williamsc0f7c042017-02-23 20:41:17 -060024RUNTIMELIBITM_mipsisa32r6 = ""
25RUNTIMELIBITM_mipsisa32r6el = ""
26RUNTIMELIBITM_mipsisa64r6 = ""
27RUNTIMELIBITM_mipsisa64r6el = ""
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050028RUNTIMELIBITM_nios2 = ""
29RUNTIMELIBITM_microblaze = ""
30
31RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
32 ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
33"
34
Patrick Williamsc124f4f2015-09-15 14:41:29 -050035# ?
36# libiberty
37# libmudflap
38# libgfortran needs separate recipe due to libquadmath dependency
39
40do_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 Williamsd8c66bc2016-06-20 12:57:21 -050051 relpath=${@os.path.relpath("${S}/$d", "${B}/$target/$d")}
52 $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053 done
54}
55
56do_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
64do_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 Williamsd8c66bc2016-06-20 12:57:21 -050071 rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
Patrick Williamsc124f4f2015-09-15 14:41:29 -050072 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 Williamsf1e5d692016-03-30 15:21:19 -050079 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 Williamsc0f7c042017-02-23 20:41:17 -060082
83}
84
85do_install_append_class-target () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050086 if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
87 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
88 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -060089
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 Williamsc124f4f2015-09-15 14:41:29 -0500115 chown -R root:root ${D}
116}
117
118INHIBIT_DEFAULT_DEPS = "1"
119DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc"
120PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
121
122BBCLASSEXTEND = "nativesdk"
123
124PACKAGES = "\
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 Williamsd8c66bc2016-06-20 12:57:21 -0500147 libitm \
148 libitm-dev \
149 libitm-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500150"
151
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500152# The base package doesn't exist, so we clear the recommends.
153RRECOMMENDS_${PN}-dbg = ""
154
155# include python debugging scripts
156FILES_${PN}-dbg += "\
157 ${libdir}/libstdc++.so.*-gdb.py \
158 ${datadir}/gcc-${BINV}/python/libstdcxx \
159"
160
161FILES_libg2c = "${target_libdir}/libg2c.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600162SUMMARY_libg2c = "Companion runtime library for g77"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500163FILES_libg2c-dev = "\
164 ${libdir}/libg2c.so \
165 ${libdir}/libg2c.a \
166 ${libdir}/libfrtbegin.a \
167"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600168SUMMARY_libg2c-dev = "Companion runtime library for g77 - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500169
170FILES_libstdc++ = "${libdir}/libstdc++.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600171SUMMARY_libstdc++ = "GNU standard C++ library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500172FILES_libstdc++-dev = "\
173 ${includedir}/c++/ \
174 ${libdir}/libstdc++.so \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500175 ${libdir}/libstdc++*.la \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500176 ${libdir}/libsupc++.la \
177"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600178SUMMARY_libstdc++-dev = "GNU standard C++ library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500179FILES_libstdc++-staticdev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500180 ${libdir}/libstdc++*.a \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500181 ${libdir}/libsupc++.a \
182"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600183SUMMARY_libstdc++-staticdev = "GNU standard C++ library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500184
185FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600186SUMMARY_libstdc++-precompile-dev = "GNU standard C++ library - precompiled header files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500187
188FILES_libssp = "${libdir}/libssp.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600189SUMMARY_libssp = "GNU stack smashing protection library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500190FILES_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 Williamsc0f7c042017-02-23 20:41:17 -0600196SUMMARY_libssp-dev = "GNU stack smashing protection library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500197FILES_libssp-staticdev = "${libdir}/libssp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600198SUMMARY_libssp-staticdev = "GNU stack smashing protection library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500199
200FILES_libquadmath = "${libdir}/libquadmath*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600201SUMMARY_libquadmath = "GNU quad-precision math library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500202FILES_libquadmath-dev = "\
203 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
204 ${libdir}/libquadmath*.so \
205 ${libdir}/libquadmath.la \
206"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600207SUMMARY_libquadmath-dev = "GNU quad-precision math library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500208FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600209SUMMARY_libquadmath-staticdev = "GNU quad-precision math library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500210
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600211# NOTE: mudflap has been removed as of gcc 4.9 and has been superseded by the address sanitiser
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500212FILES_libmudflap = "${libdir}/libmudflap*.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600213SUMMARY_libmudflap = "Pointer debugging library for gcc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500214FILES_libmudflap-dev = "\
215 ${libdir}/libmudflap*.so \
216 ${libdir}/libmudflap.la \
217"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600218SUMMARY_libmudflap-dev = "Pointer debugging library for gcc - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500219FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600220SUMMARY_libmudflap-staticdev = "Pointer debugging library for gcc - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500221
222FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600223SUMMARY_libgomp = "GNU OpenMP parallel programming library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500224FILES_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 Williamsc0f7c042017-02-23 20:41:17 -0600230SUMMARY_libgomp-dev = "GNU OpenMP parallel programming library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500231FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600232SUMMARY_libgomp-staticdev = "GNU OpenMP parallel programming library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500233
234FILES_libatomic = "${libdir}/libatomic.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600235SUMMARY_libatomic = "GNU C++11 atomics support library"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500236FILES_libatomic-dev = "\
237 ${libdir}/libatomic.so \
238 ${libdir}/libatomic.la \
239"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600240SUMMARY_libatomic-dev = "GNU C++11 atomics support library - development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500241FILES_libatomic-staticdev = "${libdir}/libatomic.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600242SUMMARY_libatomic-staticdev = "GNU C++11 atomics support library - static development files"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500243
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500244FILES_libitm = "${libdir}/libitm.so.*"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600245SUMMARY_libitm = "GNU transactional memory support library"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500246FILES_libitm-dev = "\
247 ${libdir}/libitm.so \
248 ${libdir}/libitm.la \
249 ${libdir}/libitm.spec \
250"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600251SUMMARY_libitm-dev = "GNU transactional memory support library - development files"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500252FILES_libitm-staticdev = "${libdir}/libitm.a"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600253SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500254
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500255do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
256do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
257do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"