blob: 09757e6ccc8a655e5a112dbae9d7cc7c0ce8f631 [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
56 if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
57 ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
58 fi
59 chown -R root:root ${D}
60}
61
62INHIBIT_DEFAULT_DEPS = "1"
63DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc"
64PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
65
66BBCLASSEXTEND = "nativesdk"
67
68PACKAGES = "\
69 ${PN}-dbg \
70 libstdc++ \
71 libstdc++-precompile-dev \
72 libstdc++-dev \
73 libstdc++-staticdev \
74 libg2c \
75 libg2c-dev \
76 libssp \
77 libssp-dev \
78 libssp-staticdev \
79 libmudflap \
80 libmudflap-dev \
81 libmudflap-staticdev \
82 libquadmath \
83 libquadmath-dev \
84 libquadmath-staticdev \
85 libgomp \
86 libgomp-dev \
87 libgomp-staticdev \
88 libatomic \
89 libatomic-dev \
90 libatomic-staticdev \
91"
92
93# Most libraries are licensed with the exception, but
94# one library is really GPLv3.
95#
96LICENSE_${PN}-dbg = "GPL-3.0-with-GCC-exception & GPLv3"
97LICENSE_libstdc++ = "GPL-3.0-with-GCC-exception"
98LICENSE_libstdc++-precompile-dev = "GPL-3.0-with-GCC-exception"
99LICENSE_libstdc++-dev = "GPL-3.0-with-GCC-exception"
100LICENSE_libstdc++-staticdev = "GPL-3.0-with-GCC-exception"
101LICENSE_libg2c = "GPL-3.0-with-GCC-exception"
102LICENSE_libg2c-dev = "GPL-3.0-with-GCC-exception"
103LICENSE_libssp = "GPL-3.0-with-GCC-exception"
104LICENSE_libssp-dev = "GPL-3.0-with-GCC-exception"
105LICENSE_libssp-staticdev = "GPL-3.0-with-GCC-exception"
106LICENSE_libgfortran = "GPL-3.0-with-GCC-exception"
107LICENSE_libgfortran-dev = "GPL-3.0-with-GCC-exception"
108LICENSE_libgfortran-staticdev = "GPL-3.0-with-GCC-exception"
109LICENSE_libmudflap = "GPL-3.0-with-GCC-exception"
110LICENSE_libmudflap-dev = "GPL-3.0-with-GCC-exception"
111LICENSE_libmudflap-staticdev = "GPL-3.0-with-GCC-exception"
112LICENSE_libquadmath = "GPL-3.0-with-GCC-exception"
113LICENSE_libquadmath-dev = "GPL-3.0-with-GCC-exception"
114LICENSE_libquadmath-staticdev = "GPL-3.0-with-GCC-exception"
115LICENSE_libatomic = "GPL-3.0-with-GCC-exception"
116LICENSE_libatomic-dev = "GPL-3.0-with-GCC-exception"
117LICENSE_libatomic-staticdev = "GPL-3.0-with-GCC-exception"
118
119LICENSE_libgomp = "GPLv3"
120LICENSE_libgomp-dev = "GPLv3"
121LICENSE_libgomp-staticdev = "GPLv3"
122
123# The base package doesn't exist, so we clear the recommends.
124RRECOMMENDS_${PN}-dbg = ""
125
126# include python debugging scripts
127FILES_${PN}-dbg += "\
128 ${libdir}/libstdc++.so.*-gdb.py \
129 ${datadir}/gcc-${BINV}/python/libstdcxx \
130"
131
132FILES_libg2c = "${target_libdir}/libg2c.so.*"
133FILES_libg2c-dev = "\
134 ${libdir}/libg2c.so \
135 ${libdir}/libg2c.a \
136 ${libdir}/libfrtbegin.a \
137"
138
139FILES_libstdc++ = "${libdir}/libstdc++.so.*"
140FILES_libstdc++-dev = "\
141 ${includedir}/c++/ \
142 ${libdir}/libstdc++.so \
143 ${libdir}/libstdc++.la \
144 ${libdir}/libsupc++.la \
145"
146FILES_libstdc++-staticdev = "\
147 ${libdir}/libstdc++.a \
148 ${libdir}/libsupc++.a \
149"
150
151FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
152
153FILES_libssp = "${libdir}/libssp.so.*"
154FILES_libssp-dev = "\
155 ${libdir}/libssp*.so \
156 ${libdir}/libssp*_nonshared.a \
157 ${libdir}/libssp*.la \
158 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \
159"
160FILES_libssp-staticdev = "${libdir}/libssp*.a"
161
162FILES_libquadmath = "${libdir}/libquadmath*.so.*"
163FILES_libquadmath-dev = "\
164 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
165 ${libdir}/libquadmath*.so \
166 ${libdir}/libquadmath.la \
167"
168FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
169
170FILES_libmudflap = "${libdir}/libmudflap*.so.*"
171FILES_libmudflap-dev = "\
172 ${libdir}/libmudflap*.so \
173 ${libdir}/libmudflap.la \
174"
175FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
176
177FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
178FILES_libgomp-dev = "\
179 ${libdir}/libgomp*${SOLIBSDEV} \
180 ${libdir}/libgomp*.la \
181 ${libdir}/libgomp.spec \
182 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
183"
184FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
185
186FILES_libatomic = "${libdir}/libatomic.so.*"
187FILES_libatomic-dev = "\
188 ${libdir}/libatomic.so \
189 ${libdir}/libatomic.la \
190"
191FILES_libatomic-staticdev = "${libdir}/libatomic.a"
192
193do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
194do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
195do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"