1 DESCRIPTION = "C library for embedded systems"
5 MAINTAINER = "Gerald Britton <gbritton@doomcom.org>"
8 # For now, we will skip building of a gcc package if it is a uclibc one
9 # and our build is not a uclibc one, and we skip a glibc one if our build
12 # See the note in gcc/gcc_3.4.0.oe
15 python __anonymous () {
17 uc_os = (re.match('.*uclibc$', oe.data.getVar('TARGET_OS', d, 1)) != None)
19 raise oe.parse.SkipPackage("incompatible with target %s" %
20 oe.data.getVar('TARGET_OS', d, 1))
24 # We can only work currently with a predefined .config, this ensures we have
25 # one. In the future, this may want to respect ${MACHINE} as well.
28 python __anonymous () {
30 conf = (oe.data.getVar('FILESDIR', d, 1) + "/uClibc.config." +
31 oe.data.getVar('TARGET_ARCH', d, 1))
32 if not os.access(conf, os.R_OK):
33 raise oe.parse.SkipPackage("no available .config for target %s" %
34 oe.data.getVar('TARGET_OS', d, 1))
37 PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
38 DEPENDS = "patcher-native virtual/${TARGET_PREFIX}binutils \
39 virtual/${TARGET_PREFIX}gcc-initial"
40 INHIBIT_DEFAULT_DEPS = "1"
43 # This locale file gets copied into uClibc-${PV}/extra/locale/ prior to
44 # build, it does not need to be unpacked, but we can't inhibit the unpacking
45 # in the current build system.
47 UCLIBC_LOCALE_FILE = "uClibc-locale-030818.tgz"
48 FILESDIR = "${@os.path.dirname(oe.data.getVar('FILE',d,1))}/uclibc-${PV}"
49 SRC_URI = "http://www.uclibc.org/downloads/uClibc-${PV}.tar.bz2 \
50 http://www.uclibc.org/downloads/${UCLIBC_LOCALE_FILE} \
51 http://www.uclibc.org/downloads/toolchain/kernel-headers-2.4.21.tar.bz2"
53 S = "${WORKDIR}/uClibc-${PV}"
55 UCLIBC_PREFIX = "${CROSS_DIR}/${TARGET_SYS}"
56 UCLIBC_STAGE_PREFIX = "${STAGING_DIR}/${HOST_SYS}"
60 uclibcbuild_do_patch() {
61 rm -f ${WORKDIR}/linux/include/asm
62 ln -sf asm-${TARGET_ARCH} ${WORKDIR}/linux/include/asm
64 touch ${WORKDIR}/linux/include/linux/autoconf.h
66 echo "#define UTS_RELEASE \"2.4.21\"" > ${WORKDIR}/linux/include/linux/version.h
67 echo "#define LINUX_VERSION_CODE 132117" >> ${WORKDIR}/linux/include/linux/version.h
68 echo "#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))" \
69 >> ${WORKDIR}/linux/include/linux/version.h
71 if [ -f ${FILESDIR}/uClibc.config.${TARGET_ARCH} ]; then
72 cp ${FILESDIR}/uClibc.config.${TARGET_ARCH} ${S}/.config
74 echo ERROR: No target specific config for ${TARGET_ARCH}
78 perl -i -p -e 's,^CROSS=.*,TARGET_ARCH=${TARGET_ARCH}\nCROSS=${TARGET_PREFIX},g' ${S}/Rules.mak
79 perl -i -p -e 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"${WORKDIR}/linux\",g' ${S}/.config
80 perl -i -p -e 's,^RUNTIME_PREFIX=.*,RUNTIME_PREFIX=\"/\",g' ${S}/.config
81 perl -i -p -e 's,^DEVEL_PREFIX=.*,DEVEL_PREFIX=\"/${prefix}\",g' ${S}/.config
82 perl -i -p -e 's,^SHARED_LIB_LOADER_PATH=.*,SHARED_LIB_LOADER_PATH=\"/lib\",g' ${S}/.config
83 perl -i -p -e 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y\nUCLIBC_HAS_LOCALE=n,g' ${S}/.config
85 cp ${DL_DIR}/${UCLIBC_LOCALE_FILE} extra/locale
91 oe.build.exec_func('base_do_patch', d)
92 oe.build.exec_func('uclibcbuild_do_patch', d)
96 # Install into the cross dir (this MUST be done first because we
97 # will install crt1.o in the install_dev stage and gcc needs it)
98 make PREFIX= DEVEL_PREFIX=${UCLIBC_PREFIX}/ \
99 RUNTIME_PREFIX=${UCLIBC_PREFIX}/ \
100 install_dev install_runtime install_utils
102 # We don't really need this
103 rm -f ${UCLIBC_PREFIX}/include/.cvsignore
105 # Fixup shared lib symlinks
106 ( cd ${UCLIBC_PREFIX}/lib
107 for f in c crypt dl m nsl pthread resolv thread_db util; do
108 ln -sf lib${f}.so.? lib${f}.so
112 # This conflicts with the c++ version of this header
113 rm -f ${UCLIBC_PREFIX}/include/bits/atomicity.h
115 # Install into the staging dir
116 make PREFIX= DEVEL_PREFIX=${UCLIBC_STAGE_PREFIX}/ \
117 RUNTIME_PREFIX=${UCLIBC_STAGE_PREFIX}/ \
118 install_dev install_runtime install_utils
120 # We don't really need this
121 rm -f ${UCLIBC_STAGE_PREFIX}/include/.cvsignore
123 # Fixup shared lib symlinks
124 ( cd ${UCLIBC_STAGE_PREFIX}/lib
125 for f in c crypt dl m nsl pthread resolv thread_db util; do
126 ln -sf lib${f}.so.? lib${f}.so
130 # This conflicts with the c++ version of this header
131 rm -f ${UCLIBC_STAGE_PREFIX}/include/bits/atomicity.h
135 make PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \
136 install_dev install_runtime install_utils
138 # We don't really need this in /usr/include
139 rm -f ${D}/${prefix}/include/.cvsignore
141 # This conflicts with the c++ version of this header
142 rm -f ${D}/${prefix}/include/bits/atomicity.h