1require newlib.inc
2
3DEPENDS += "newlib"
4
5FILESEXTRAPATHS:prepend := "${THISDIR}/libgloss:"
6
7SRC_URI:append = " file://libgloss-build-without-nostdinc.patch"
8SRC_URI:append:powerpc = " file://fix-rs6000-crt0.patch"
9
10do_configure() {
11	${S}/libgloss/configure ${EXTRA_OECONF}
12}
13
14do_install:prepend() {
15	# install doesn't create this itself, avoid install error
16	install -d ${D}${prefix}/${TARGET_SYS}/lib
17}
18
19do_install:append() {
20	# Move libs to default directories so they can be picked up later
21	install -d ${D}${libdir}
22	mv -v ${D}${prefix}/${TARGET_SYS}/lib/* ${D}${libdir}
23
24	# Remove original directory
25	rmdir -p --ignore-fail-on-non-empty ${D}${prefix}/${TARGET_SYS}/lib
26}
27
28# Split packages correctly
29FILES:${PN} += "${libdir}/*.ld ${libdir}/*.specs"
30FILES:${PN}-dev += "${libdir}/cpu-init/*"
31# RiscV installation moved the syscall header to this location
32FILES:${PN}-dev += "${prefix}/${TARGET_SYS}/include/machine/*.h"
33
34INHIBIT_PACKAGE_STRIP = "1"
35INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
36