blob: 8639c1c49ea64af624ad086982e83f5b37159831 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001require gcc-configure-common.inc
2
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05003# Over-ride the LICENSE set by gcc-${PV}.inc to remove "& GPLv3"
4# All gcc-runtime packages are now covered by the runtime exception.
5LICENSE = "GPL-3.0-with-GCC-exception"
6
7CXXFLAGS_remove = "-fvisibility-inlines-hidden"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05008
9EXTRA_OECONF_PATHS = "\
10 --with-gxx-include-dir=${includedir}/c++/${BINV} \
11 --with-sysroot=/not/exist \
12 --with-build-sysroot=${STAGING_DIR_TARGET} \
13"
14
15EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
16
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050017RUNTIMELIBITM = "libitm"
18RUNTIMELIBITM_mips = ""
19RUNTIMELIBITM_mipsel = ""
20RUNTIMELIBITM_mips64 = ""
21RUNTIMELIBITM_mips64el = ""
22RUNTIMELIBITM_nios2 = ""
23RUNTIMELIBITM_microblaze = ""
24
25RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
26 ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
27"
28
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029# ?
30# libiberty
31# libmudflap
32# libgfortran needs separate recipe due to libquadmath dependency
33
34do_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 Williamsd8c66bc2016-06-20 12:57:21 -050045 relpath=${@os.path.relpath("${S}/$d", "${B}/$target/$d")}
46 $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050047 done
48}
49
50do_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
58do_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 Williamsd8c66bc2016-06-20 12:57:21 -050065 rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
Patrick Williamsc124f4f2015-09-15 14:41:29 -050066 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 Williamsf1e5d692016-03-30 15:21:19 -050073 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 Williamsc124f4f2015-09-15 14:41:29 -050076 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
82INHIBIT_DEFAULT_DEPS = "1"
83DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc"
84PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
85
86BBCLASSEXTEND = "nativesdk"
87
88PACKAGES = "\
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 Williamsd8c66bc2016-06-20 12:57:21 -0500111 libitm \
112 libitm-dev \
113 libitm-staticdev \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500114"
115
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500116# The base package doesn't exist, so we clear the recommends.
117RRECOMMENDS_${PN}-dbg = ""
118
119# include python debugging scripts
120FILES_${PN}-dbg += "\
121 ${libdir}/libstdc++.so.*-gdb.py \
122 ${datadir}/gcc-${BINV}/python/libstdcxx \
123"
124
125FILES_libg2c = "${target_libdir}/libg2c.so.*"
126FILES_libg2c-dev = "\
127 ${libdir}/libg2c.so \
128 ${libdir}/libg2c.a \
129 ${libdir}/libfrtbegin.a \
130"
131
132FILES_libstdc++ = "${libdir}/libstdc++.so.*"
133FILES_libstdc++-dev = "\
134 ${includedir}/c++/ \
135 ${libdir}/libstdc++.so \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500136 ${libdir}/libstdc++*.la \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500137 ${libdir}/libsupc++.la \
138"
139FILES_libstdc++-staticdev = "\
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500140 ${libdir}/libstdc++*.a \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500141 ${libdir}/libsupc++.a \
142"
143
144FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
145
146FILES_libssp = "${libdir}/libssp.so.*"
147FILES_libssp-dev = "\
148 ${libdir}/libssp*.so \
149 ${libdir}/libssp*_nonshared.a \
150 ${libdir}/libssp*.la \
151 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \
152"
153FILES_libssp-staticdev = "${libdir}/libssp*.a"
154
155FILES_libquadmath = "${libdir}/libquadmath*.so.*"
156FILES_libquadmath-dev = "\
157 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
158 ${libdir}/libquadmath*.so \
159 ${libdir}/libquadmath.la \
160"
161FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
162
163FILES_libmudflap = "${libdir}/libmudflap*.so.*"
164FILES_libmudflap-dev = "\
165 ${libdir}/libmudflap*.so \
166 ${libdir}/libmudflap.la \
167"
168FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
169
170FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
171FILES_libgomp-dev = "\
172 ${libdir}/libgomp*${SOLIBSDEV} \
173 ${libdir}/libgomp*.la \
174 ${libdir}/libgomp.spec \
175 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
176"
177FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
178
179FILES_libatomic = "${libdir}/libatomic.so.*"
180FILES_libatomic-dev = "\
181 ${libdir}/libatomic.so \
182 ${libdir}/libatomic.la \
183"
184FILES_libatomic-staticdev = "${libdir}/libatomic.a"
185
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500186FILES_libitm = "${libdir}/libitm.so.*"
187FILES_libitm-dev = "\
188 ${libdir}/libitm.so \
189 ${libdir}/libitm.la \
190 ${libdir}/libitm.spec \
191"
192FILES_libitm-staticdev = "${libdir}/libitm.a"
193
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500194do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
195do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
196do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"