summaryrefslogtreecommitdiff
path: root/packages/klibc/klibc-common.inc
blob: 146968eaf033348f76ea93b1928905a77fa914f4 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
DEPENDS = "virtual/kernel perl-native"
SECTION = "libs"
DESCRIPTION = "klibc is intended to be a minimalistic libc subset for \
use with initramfs.  It is deliberately written for small size, \
minimal entaglement, and portability, not speed."
LICENSE = "BSD-ADV"
SRC_URI = "${KERNELORG_MIRROR}/pub/linux/libs/klibc/Stable/klibc-${PV}.tar.bz2"
SRC_URI += "file://install.patch;patch=1"
S = "${WORKDIR}/klibc-${PV}"
PACKAGE_ARCH = "${MACHINE_ARCH}"

# for the correct kernel staging path
# inherit module-base

EXTRA_OEMAKE = "'ARCH=${KLIBC_ARCH}' \
		'CROSS=${TARGET_PREFIX}' \
		'CC=${HOST_PREFIX}gcc' \
		'LD=${HOST_PREFIX}ld' \
		'AR=${AR}' \
		'RANLIB=${RANLIB}' \
		'NM=${TARGET_PREFIX}nm' \
		'STRIP=echo' \
		'SHLIBDIR=/lib' \
		'HOST_CC=${BUILD_CC}' \
		'HOST_CFLAGS=${BUILD_CFLAGS}' \
		'HOST_LDFLAGS=${BUILD_LDFLAGS}' \
		'HOST_LIBS=' \
		'LDFLAGS=' \
		'ARCHREQFLAGS=${HOST_CC_ARCH}' \
		'OPTFLAGS=${TARGET_CFLAGS}' \
		'mandir=${mandir}'"

KLIBC_ARCH = '${TARGET_ARCH}'
KLIBC_ARCH_armeb = 'arm'
KLIBC_ARCH_mipsel = 'mips'

# the klibc code contains ARM instructions (for ARM), this
# could be fixed, but for the moment:
ARM_INSTRUCTION_SET = "arm"

TARGET_CFLAGS := "${@oe_filter_out('-I\S+', '${TARGET_CFLAGS}', d)} -I${STAGING_KERNEL_DIR}/include"

INSTALLDIR = "/usr/lib/klibc"
INSTALLPREFIX = "${INSTALLDIR}/${TARGET_PREFIX}"
INSTALLBINDIR = "${INSTALLPREFIX}bin"
INSTALLLIBDIR = "${INSTALLPREFIX}lib"
INSTALLINCDIR = "${INSTALLPREFIX}include"

PACKAGES = "${PN}-dbg ${PN} ${PN}-dev ${PN}-doc"

FILES_${PN} = "/lib/*.so* ${INSTALLBINDIR}"
FILES_${PN}-dev = "/usr/bin ${INSTALLINCDIR} ${INSTALLLIBDIR}"

do_configure () {
	ln -sf ${STAGING_KERNEL_DIR} linux
}

do_install() {
	# The installed -dev won't work because it has the cross compiler
	# path compiled in.
	oe_runmake 'INSTALLROOT=${D}' install
}