summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/uclibc/uclibc.inc
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:14:24 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:29:45 +0100
commit29d6678fd546377459ef75cf54abeef5b969b5cf (patch)
tree8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-core/uclibc/uclibc.inc
parentda49de6885ee1bc424e70bc02f21f6ab920efb55 (diff)
downloadpoky-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things and is generally overwhelming. This commit splits it into several logical sections roughly based on function, recipes.txt gives more information about the classifications used. The opportunity is also used to switch from "packages" to "recipes" as used in OpenEmbedded as the term "packages" can be confusing to people and has many different meanings. Not all recipes have been classified yet, this is just a first pass at separating things out. Some packages are moved to meta-extras as they're no longer actively used or maintained. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-core/uclibc/uclibc.inc')
-rw-r--r--meta/recipes-core/uclibc/uclibc.inc183
1 files changed, 183 insertions, 0 deletions
diff --git a/meta/recipes-core/uclibc/uclibc.inc b/meta/recipes-core/uclibc/uclibc.inc
new file mode 100644
index 0000000000..18392b5c17
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc.inc
@@ -0,0 +1,183 @@
1DESCRIPTION = "C library for embedded systems"
2LICENSE = "LGPL"
3SECTION = "libs"
4PRIORITY = "required"
5
6#
7# For now, we will skip building of a gcc package if it is a uclibc one
8# and our build is not a uclibc one, and we skip a glibc one if our build
9# is a uclibc build.
10#
11# See the note in gcc/gcc_3.4.0.oe
12#
13
14python __anonymous () {
15 import bb, re
16 uc_os = (re.match('.*uclibc*', bb.data.getVar('TARGET_OS', d, 1)) != None)
17 if not uc_os:
18 raise bb.parse.SkipPackage("incompatible with target %s" %
19 bb.data.getVar('TARGET_OS', d, 1))
20}
21
22PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
23PROVIDES += "${@['virtual/libiconv', ''][bb.data.getVar('USE_NLS', d, 1) != 'yes']}"
24DEPENDS = "virtual/${TARGET_PREFIX}binutils \
25 virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers ncurses-native pax-utils-native"
26RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
27
28# Blackfin needs a wrapper around ld
29#DEPENDS_append_bfin = " elf2flt "
30
31INHIBIT_DEFAULT_DEPS = "1"
32PARALLEL_MAKE = ""
33
34PACKAGES =+ "ldd uclibc-utils-dbg uclibc-utils uclibc-gconv uclibc-thread-db"
35
36LEAD_SONAME = "libc.so"
37
38# The last line (gdb and lib1) is for uclinux-uclibc builds
39uclibc_baselibs = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so \
40 ${base_libdir}/libintl*.so.* ${base_libdir}/libintl-*.so \
41 ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so \
42 ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so \
43 ${base_libdir}/ld*.so.* ${base_libdir}/ld-*.so \
44 ${base_libdir}/libc*.so.* ${base_libdir}/libuClibc-*.so \
45 ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so \
46 ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so \
47 ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so \
48 ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so \
49 ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so \
50 ${libdir}/libc.gdb ${libdir}/libc ${base_libdir}/lib1.so \
51 "
52FILES_${PN} = "${sysconfdir} ${uclibc_baselibs} /sbin/ldconfig \
53 ${libexecdir} ${datadir}/zoneinfo ${libdir}/locale"
54FILES_ldd = "${bindir}/ldd"
55FILES_uclibc-dev += "${libdir}/*.o"
56FILES_uclibc-utils = "${bindir} ${sbindir}"
57FILES_uclibc-utils-dbg += "${bindir}/.debug ${sbindir}/.debug"
58FILES_uclibc-gconv = "${libdir}/gconv"
59FILES_uclibc-thread-db = "/lib/libthread_db*"
60RPROVIDES_uclibc-dev += "libc-dev"
61
62#
63# This locale file gets copied into uClibc-${PV}/extra/locale/ prior to
64# build, it does not need to be unpacked, but we can't inhibit the unpacking
65# in the current build system.
66#
67UCLIBC_LOCALE_FILE = "uClibc-locale-030818.tgz"
68UCLIBC_LOCALE_FILE_arm = "uClibc-locale-030818.arm.tgz"
69UCLIBC_LOCALE_URI = "http://www.uclibc.org/downloads/${UCLIBC_LOCALE_FILE}"
70UCLIBC_LOCALE_URI_arm = "http://wiki.openembedded.net/dl/uclibc-locale/${UCLIBC_LOCALE_FILE}"
71
72SRC_URI = "${@['${UCLIBC_LOCALE_URI}', ''][bb.data.getVar('USE_NLS', d, 1) != 'yes']} \
73 file://uClibc.config \
74 http://www.uclibc.org/downloads/uClibc-${PV}.tar.bz2 \
75 "
76
77# do_stage barfs on a CC with whitepspace, therefore put the 'HOST_CC_ARCH' in
78# the CFLAGS (for when building the utils).
79OEMAKE_NO_CC = "'STRIPTOOL=true' 'LD=${LD}' \
80 'LOCALE_DATA_FILENAME=${UCLIBC_LOCALE_FILE}'"
81EXTRA_OEMAKE = "${OEMAKE_NO_CC} 'CC=${CC}' \
82 'HOSTCFLAGS=-I${STAGING_INCDIR_NATIVE}' \
83 ARCH=`grep TARGET_ARCH ${S}/.config|sed -e 's/TARGET_ARCH=//g'`"
84EXTRA_OEMAKE_task_do_package = "${OEMAKE_NO_CC}"
85
86KERNEL_SOURCE = "${STAGING_INCDIR}"
87KERNEL_HEADERS = "${STAGING_INCDIR}"
88
89# Lets munge this via siteinfo.bbclass as well:
90# ARCH_BIG_ENDIAN=y
91# ARCH_WANTS_BIG_ENDIAN=y
92# ARCH_WANTS_LITTLE_ENDIAN is not set
93
94# How to enable verbose logs:
95#export VERBOSE="1"
96
97configmangle = 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE="${KERNEL_SOURCE}",g; \
98 s,^KERNEL_HEADERS=.*,KERNEL_HEADERS="${KERNEL_HEADERS}",g; \
99 s,^RUNTIME_PREFIX=.*,RUNTIME_PREFIX="/",g; \
100 s,^DEVEL_PREFIX=.*,DEVEL_PREFIX="/${prefix}",g; \
101 s,^SHARED_LIB_LOADER_PATH=.*,SHARED_LIB_LOADER_PATH="/lib",; \
102 s,^SHARED_LIB_LOADER_PREFIX=.*,SHARED_LIB_LOADER_PREFIX="/lib",; \
103 s,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g; \
104 ${@["","s,.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=y,;"][bb.data.getVar("USE_NLS", d, 1) == "yes"]} \
105 ${@["","s,.*LDSO_GNU_HASH_SUPPORT.*,# LDSO_GNU_HASH_SUPPORT is not set,;"][bb.data.getVar("TARGET_ARCH", d, 1) in ['mips', 'mipsel', 'avr32']]} \
106 '
107
108CFLAGS := "${@oe_filter_out('-I\S+', '${CFLAGS}', d)}"
109
110python () {
111 if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
112 bb.data.setVar('configmangle_append', ' s,^HAS_FPU=y,# HAS_FPU is not set,;', d)
113}
114
115uclibcbuild_do_patch() {
116 ln -sf ${STAGING_INCDIR}/linux ${S}/include/linux
117 ln -sf ${STAGING_INCDIR}/asm ${S}/include/asm
118
119 ${@['cp %s/%s extra/locale' % (bb.data.getVar('DL_DIR', d, 1) or '', bb.data.getVar('UCLIBC_LOCALE_FILE', d, 1) or ''), ''][bb.data.getVar('USE_NLS', d, 1) != 'yes']}
120}
121
122python do_patch () {
123 bb.build.exec_func('base_do_patch', d)
124 bb.build.exec_func('uclibcbuild_do_patch', d)
125}
126
127do_configure() {
128 rm -f ${S}/.config
129
130 # For uClibc 0.9.29, OpenEmbedded splits the uClibc.config in two parts:
131 # uClibc.machine and uClibc.distro. So, if they exist use them, otherwise
132 # use a uClibc.config
133 if [ -f ${WORKDIR}/uClibc.machine -a -f ${WORKDIR}/uClibc.distro ]; then
134 echo "### uClibc.machine ###" >${S}/merged.config
135 cat ${WORKDIR}/uClibc.machine >>${S}/merged.config
136 echo "### uClibc.distro ###" >>${S}/merged.config
137 cat ${WORKDIR}/uClibc.distro >>${S}/merged.config
138 else
139 echo "### uClibc.config ###" >${S}/merged.config
140 cat ${WORKDIR}/uClibc.config >>${S}/merged.config
141 fi
142 cp ${S}/merged.config ${S}/.config
143
144 # Mangle the resulting .config depending on OE variables
145 perl -i -p -e 's,^CROSS=.*,TARGET_ARCH=${TARGET_ARCH}\nCROSS=${TARGET_PREFIX},g' ${S}/Rules.mak
146 sed -i -e s:'$(CROSS)strip':true: ${S}/Rules.mak
147 perl -i -p -e '${configmangle}' ${S}/.config
148
149 sed -i -e '/CONFIG_ARM_EABI/d' ${S}/.config
150
151 if [ `echo ${TARGET_ARCH} | grep -e '^arm'` ]; then
152 if [ `echo ${TARGET_OS} | grep -e 'eabi$'` ]; then
153 echo "CONFIG_ARM_EABI=y" >> ${S}/.config
154 else
155 echo "# CONFIG_ARM_EABI is not set" >> ${S}/.config
156 fi
157 fi
158 yes '' | oe_runmake oldconfig
159}
160
161do_install() {
162 oe_runmake PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \
163 install_dev install_runtime
164
165 # Need to overwrite the version from -initial
166 if [ ! -e ${D}${libdir}/libc.so ]; then
167 ln -s ../../lib/libc.so.0 ${D}${libdir}/libc.so
168 fi
169
170 # We don't really need this in ${includedir}
171 rm -f ${D}${prefix}/include/.cvsignore
172
173 # This conflicts with the c++ version of this header
174 rm -f ${D}${prefix}/include/bits/atomicity.h
175
176 oe_runmake "SSP_ALL_CFLAGS=${TARGET_LINK_HASH_STYLE}" utils
177 oe_runmake STRIPTOOL=true PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \
178 install_utils
179
180 # oe_runstrip needs +x on files
181 chmod +x ${D}/${base_libdir}/*
182}
183