summaryrefslogtreecommitdiff
path: root/packages/dietlibc/dietlibc_0.31.bb
blob: 7720588b60838bdb9cfe4b35b3cf9000b7c281ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
SECTION = "libs"
DESCRIPTION = "The diet libc is a libc that is optimized for small size. \
It can be used to create small statically linked binaries"
LICENSE = "GPLv2"

SRC_URI = "${KERNELORG_MIRROR}/pub/linux/libs/dietlibc/dietlibc-${PV}.tar.bz2 \
           file://ccache.patch;patch=1 \
           file://ceil.patch;patch=1 \
	   file://ai_addrconfig.patch;patch=1 \
	  "

#otherwise the whole run scripts got broken
do_configure () {
	echo "moo" > /dev/null 2>&1
}

do_compile () {
	oe_runmake all CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" prefix=${STAGING_DIR_TARGET}/lib/dietlibc
	oe_runmake all ARCH="${TARGET_ARCH}" CROSS=" " prefix=${STAGING_DIR_TARGET}/lib/dietlibc
}

#no packages needed, all binaries will be compiled with -static
PACKAGES = " "

#otherwise the whole run scripts got broken
do_install () {
	echo "moo" > /dev/null 2>&1
}

do_stage () {
	DIETLIBC_BUILD_ARCH=`echo ${BUILD_ARCH} | sed -e s'/.86/386/'`
	DIETLIBC_TARGET_ARCH=`echo ${TARGET_ARCH} | sed -e s'/.86/386/'`
	rm -rf ${STAGING_DIR_TARGET}/lib/dietlibc || true
	rm ${CROSS_DIR}/bin/diet || true
	install -d ${STAGING_DIR_TARGET}/lib/dietlibc/lib-${DIETLIBC_TARGET_ARCH}
	install -d ${STAGING_DIR_TARGET}/lib/dietlibc/include
        for i in `find include -name \*.h`; do install -m 644 -D $i ${STAGING_DIR_TARGET}/lib/dietlibc/$i; done

        install -m755 bin-${DIETLIBC_BUILD_ARCH}/diet-i ${CROSS_DIR}/bin/diet
	
	cd bin-${DIETLIBC_TARGET_ARCH}
	install -m 644 start.o libm.a libpthread.a librpc.a \
                       liblatin1.a libcompat.a libcrypt.a \
		       ${STAGING_DIR_TARGET}/lib/dietlibc/lib-${DIETLIBC_TARGET_ARCH}
        install -m 644 dietlibc.a ${STAGING_DIR_TARGET}/lib/dietlibc/lib-${DIETLIBC_TARGET_ARCH}/libc.a
}