blob: 690d78012db908e6dbc901ec65289232ebc11da5 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001require gcc-configure-common.inc
2
3CXXFLAGS := "${@oe_filter_out('-fvisibility-inlines-hidden', '${CXXFLAGS}', d)}"
4
5EXTRA_OECONF_PATHS = "\
6 --with-gxx-include-dir=${includedir}/c++/${BINV} \
7 --with-sysroot=/not/exist \
8 --with-build-sysroot=${STAGING_DIR_TARGET} \
9"
10
11EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
12
13RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic"
14# ?
15# libiberty
16# libmudflap
17# libgfortran needs separate recipe due to libquadmath dependency
18
19do_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
34do_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
42do_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
Patrick Williamsf1e5d692016-03-30 15:21:19 -050056 if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
57 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}
58 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050059 if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
60 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
61 fi
62 chown -R root:root ${D}
63}
64
65INHIBIT_DEFAULT_DEPS = "1"
66DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc"
67PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
68
69BBCLASSEXTEND = "nativesdk"
70
71PACKAGES = "\
72 ${PN}-dbg \
73 libstdc++ \
74 libstdc++-precompile-dev \
75 libstdc++-dev \
76 libstdc++-staticdev \
77 libg2c \
78 libg2c-dev \
79 libssp \
80 libssp-dev \
81 libssp-staticdev \
82 libmudflap \
83 libmudflap-dev \
84 libmudflap-staticdev \
85 libquadmath \
86 libquadmath-dev \
87 libquadmath-staticdev \
88 libgomp \
89 libgomp-dev \
90 libgomp-staticdev \
91 libatomic \
92 libatomic-dev \
93 libatomic-staticdev \
94"
95
96# Most libraries are licensed with the exception, but
97# one library is really GPLv3.
98#
99LICENSE_${PN}-dbg = "GPL-3.0-with-GCC-exception & GPLv3"
100LICENSE_libstdc++ = "GPL-3.0-with-GCC-exception"
101LICENSE_libstdc++-precompile-dev = "GPL-3.0-with-GCC-exception"
102LICENSE_libstdc++-dev = "GPL-3.0-with-GCC-exception"
103LICENSE_libstdc++-staticdev = "GPL-3.0-with-GCC-exception"
104LICENSE_libg2c = "GPL-3.0-with-GCC-exception"
105LICENSE_libg2c-dev = "GPL-3.0-with-GCC-exception"
106LICENSE_libssp = "GPL-3.0-with-GCC-exception"
107LICENSE_libssp-dev = "GPL-3.0-with-GCC-exception"
108LICENSE_libssp-staticdev = "GPL-3.0-with-GCC-exception"
109LICENSE_libgfortran = "GPL-3.0-with-GCC-exception"
110LICENSE_libgfortran-dev = "GPL-3.0-with-GCC-exception"
111LICENSE_libgfortran-staticdev = "GPL-3.0-with-GCC-exception"
112LICENSE_libmudflap = "GPL-3.0-with-GCC-exception"
113LICENSE_libmudflap-dev = "GPL-3.0-with-GCC-exception"
114LICENSE_libmudflap-staticdev = "GPL-3.0-with-GCC-exception"
115LICENSE_libquadmath = "GPL-3.0-with-GCC-exception"
116LICENSE_libquadmath-dev = "GPL-3.0-with-GCC-exception"
117LICENSE_libquadmath-staticdev = "GPL-3.0-with-GCC-exception"
118LICENSE_libatomic = "GPL-3.0-with-GCC-exception"
119LICENSE_libatomic-dev = "GPL-3.0-with-GCC-exception"
120LICENSE_libatomic-staticdev = "GPL-3.0-with-GCC-exception"
121
122LICENSE_libgomp = "GPLv3"
123LICENSE_libgomp-dev = "GPLv3"
124LICENSE_libgomp-staticdev = "GPLv3"
125
126# The base package doesn't exist, so we clear the recommends.
127RRECOMMENDS_${PN}-dbg = ""
128
129# include python debugging scripts
130FILES_${PN}-dbg += "\
131 ${libdir}/libstdc++.so.*-gdb.py \
132 ${datadir}/gcc-${BINV}/python/libstdcxx \
133"
134
135FILES_libg2c = "${target_libdir}/libg2c.so.*"
136FILES_libg2c-dev = "\
137 ${libdir}/libg2c.so \
138 ${libdir}/libg2c.a \
139 ${libdir}/libfrtbegin.a \
140"
141
142FILES_libstdc++ = "${libdir}/libstdc++.so.*"
143FILES_libstdc++-dev = "\
144 ${includedir}/c++/ \
145 ${libdir}/libstdc++.so \
146 ${libdir}/libstdc++.la \
147 ${libdir}/libsupc++.la \
148"
149FILES_libstdc++-staticdev = "\
150 ${libdir}/libstdc++.a \
151 ${libdir}/libsupc++.a \
152"
153
154FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
155
156FILES_libssp = "${libdir}/libssp.so.*"
157FILES_libssp-dev = "\
158 ${libdir}/libssp*.so \
159 ${libdir}/libssp*_nonshared.a \
160 ${libdir}/libssp*.la \
161 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \
162"
163FILES_libssp-staticdev = "${libdir}/libssp*.a"
164
165FILES_libquadmath = "${libdir}/libquadmath*.so.*"
166FILES_libquadmath-dev = "\
167 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
168 ${libdir}/libquadmath*.so \
169 ${libdir}/libquadmath.la \
170"
171FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
172
173FILES_libmudflap = "${libdir}/libmudflap*.so.*"
174FILES_libmudflap-dev = "\
175 ${libdir}/libmudflap*.so \
176 ${libdir}/libmudflap.la \
177"
178FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
179
180FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
181FILES_libgomp-dev = "\
182 ${libdir}/libgomp*${SOLIBSDEV} \
183 ${libdir}/libgomp*.la \
184 ${libdir}/libgomp.spec \
185 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
186"
187FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
188
189FILES_libatomic = "${libdir}/libatomic.so.*"
190FILES_libatomic-dev = "\
191 ${libdir}/libatomic.so \
192 ${libdir}/libatomic.la \
193"
194FILES_libatomic-staticdev = "${libdir}/libatomic.a"
195
196do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
197do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
198do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"