diff options
Diffstat (limited to 'meta/packages/uclibc/uclibc.inc')
-rw-r--r-- | meta/packages/uclibc/uclibc.inc | 125 |
1 files changed, 46 insertions, 79 deletions
diff --git a/meta/packages/uclibc/uclibc.inc b/meta/packages/uclibc/uclibc.inc index bb0b3643bc..18392b5c17 100644 --- a/meta/packages/uclibc/uclibc.inc +++ b/meta/packages/uclibc/uclibc.inc | |||
@@ -22,26 +22,32 @@ python __anonymous () { | |||
22 | PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc" | 22 | PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc" |
23 | PROVIDES += "${@['virtual/libiconv', ''][bb.data.getVar('USE_NLS', d, 1) != 'yes']}" | 23 | PROVIDES += "${@['virtual/libiconv', ''][bb.data.getVar('USE_NLS', d, 1) != 'yes']}" |
24 | DEPENDS = "virtual/${TARGET_PREFIX}binutils \ | 24 | DEPENDS = "virtual/${TARGET_PREFIX}binutils \ |
25 | virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers ncurses-native pax-utils-native" | 25 | virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers ncurses-native pax-utils-native" |
26 | RDEPENDS_${PN}-dev = "linux-libc-headers-dev" | ||
26 | 27 | ||
27 | # Blackfin needs a wrapper around ld | 28 | # Blackfin needs a wrapper around ld |
28 | DEPENDS_append_bfin = " elf2flt " | 29 | #DEPENDS_append_bfin = " elf2flt " |
29 | 30 | ||
30 | INHIBIT_DEFAULT_DEPS = "1" | 31 | INHIBIT_DEFAULT_DEPS = "1" |
31 | PARALLEL_MAKE = "" | 32 | PARALLEL_MAKE = "" |
32 | 33 | ||
33 | PACKAGES =+ "ldd uclibc-utils-dbg uclibc-utils uclibc-gconv uclibc-thread-db" | 34 | PACKAGES =+ "ldd uclibc-utils-dbg uclibc-utils uclibc-gconv uclibc-thread-db" |
34 | 35 | ||
36 | LEAD_SONAME = "libc.so" | ||
37 | |||
35 | # The last line (gdb and lib1) is for uclinux-uclibc builds | 38 | # The last line (gdb and lib1) is for uclinux-uclibc builds |
36 | uclibc_baselibs = "/lib/libcrypt*.so* /lib/libdl*.so \ | 39 | uclibc_baselibs = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so \ |
37 | /lib/libintl*.so* /lib/libm*.so \ | 40 | ${base_libdir}/libintl*.so.* ${base_libdir}/libintl-*.so \ |
38 | /lib/libnsl*.so* /lib/libpthread*.so \ | 41 | ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so \ |
39 | /lib/libresolv*.so* /lib/libutil*.so \ | 42 | ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so \ |
40 | /lib/libuClibc*.so* /lib/ld*.so* \ | 43 | ${base_libdir}/ld*.so.* ${base_libdir}/ld-*.so \ |
41 | /lib/libc*.so* /lib/libdl*.so* \ | 44 | ${base_libdir}/libc*.so.* ${base_libdir}/libuClibc-*.so \ |
42 | /lib/libm*.so* /lib/libutil*.so* \ | 45 | ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so \ |
43 | /lib/libpthread*.so* /lib/librt*.so* \ | 46 | ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so \ |
44 | /usr/lib/libc.gdb /usr/lib/libc /lib/lib1.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 \ | ||
45 | " | 51 | " |
46 | FILES_${PN} = "${sysconfdir} ${uclibc_baselibs} /sbin/ldconfig \ | 52 | FILES_${PN} = "${sysconfdir} ${uclibc_baselibs} /sbin/ldconfig \ |
47 | ${libexecdir} ${datadir}/zoneinfo ${libdir}/locale" | 53 | ${libexecdir} ${datadir}/zoneinfo ${libdir}/locale" |
@@ -61,19 +67,20 @@ RPROVIDES_uclibc-dev += "libc-dev" | |||
61 | UCLIBC_LOCALE_FILE = "uClibc-locale-030818.tgz" | 67 | UCLIBC_LOCALE_FILE = "uClibc-locale-030818.tgz" |
62 | UCLIBC_LOCALE_FILE_arm = "uClibc-locale-030818.arm.tgz" | 68 | UCLIBC_LOCALE_FILE_arm = "uClibc-locale-030818.arm.tgz" |
63 | UCLIBC_LOCALE_URI = "http://www.uclibc.org/downloads/${UCLIBC_LOCALE_FILE}" | 69 | UCLIBC_LOCALE_URI = "http://www.uclibc.org/downloads/${UCLIBC_LOCALE_FILE}" |
64 | UCLIBC_LOCALE_URI_arm = "http://openembedded.org/dl/uclibc-locale/${UCLIBC_LOCALE_FILE}" | 70 | UCLIBC_LOCALE_URI_arm = "http://wiki.openembedded.net/dl/uclibc-locale/${UCLIBC_LOCALE_FILE}" |
65 | 71 | ||
66 | SRC_URI = "${@['${UCLIBC_LOCALE_URI}', ''][bb.data.getVar('USE_NLS', d, 1) != 'yes']} \ | 72 | SRC_URI = "${@['${UCLIBC_LOCALE_URI}', ''][bb.data.getVar('USE_NLS', d, 1) != 'yes']} \ |
67 | file://uClibc.config" | 73 | file://uClibc.config \ |
68 | 74 | http://www.uclibc.org/downloads/uClibc-${PV}.tar.bz2 \ | |
69 | UCLIBC_STAGE_PREFIX = "${STAGING_DIR_HOST}${prefix}" | 75 | " |
70 | 76 | ||
71 | # do_stage barfs on a CC with whitepspace, therefore put the 'HOST_CC_ARCH' in | 77 | # do_stage barfs on a CC with whitepspace, therefore put the 'HOST_CC_ARCH' in |
72 | # the CFLAGS (for when building the utils). | 78 | # the CFLAGS (for when building the utils). |
73 | OEMAKE_NO_CC = "'OPTIMIZATION=' 'CPU_CFLAGS=${CFLAGS}' 'STRIPTOOL=true' 'LD=${LD}' \ | 79 | OEMAKE_NO_CC = "'STRIPTOOL=true' 'LD=${LD}' \ |
74 | 'LOCALE_DATA_FILENAME=${UCLIBC_LOCALE_FILE}'" | 80 | 'LOCALE_DATA_FILENAME=${UCLIBC_LOCALE_FILE}'" |
75 | EXTRA_OEMAKE = "${OEMAKE_NO_CC} 'CC=${CC}' HOSTCFLAGS='-I${STAGING_INCDIR_NATIVE}'" | 81 | EXTRA_OEMAKE = "${OEMAKE_NO_CC} 'CC=${CC}' \ |
76 | EXTRA_OEMAKE_task_do_populate_sysroot = "${OEMAKE_NO_CC}" | 82 | 'HOSTCFLAGS=-I${STAGING_INCDIR_NATIVE}' \ |
83 | ARCH=`grep TARGET_ARCH ${S}/.config|sed -e 's/TARGET_ARCH=//g'`" | ||
77 | EXTRA_OEMAKE_task_do_package = "${OEMAKE_NO_CC}" | 84 | EXTRA_OEMAKE_task_do_package = "${OEMAKE_NO_CC}" |
78 | 85 | ||
79 | KERNEL_SOURCE = "${STAGING_INCDIR}" | 86 | KERNEL_SOURCE = "${STAGING_INCDIR}" |
@@ -94,7 +101,10 @@ configmangle = 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE="${KERNEL_SOURCE}",g; \ | |||
94 | s,^SHARED_LIB_LOADER_PATH=.*,SHARED_LIB_LOADER_PATH="/lib",; \ | 101 | s,^SHARED_LIB_LOADER_PATH=.*,SHARED_LIB_LOADER_PATH="/lib",; \ |
95 | s,^SHARED_LIB_LOADER_PREFIX=.*,SHARED_LIB_LOADER_PREFIX="/lib",; \ | 102 | s,^SHARED_LIB_LOADER_PREFIX=.*,SHARED_LIB_LOADER_PREFIX="/lib",; \ |
96 | s,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g; \ | 103 | s,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g; \ |
97 | ${@["s,.*UCLIBC_HAS_LOCALE.*,# UCLIBC_HAS_LOCALE is not set,;", ""][bb.data.getVar("USE_NLS", d, 1) == "yes"]}' | 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 | |||
98 | CFLAGS := "${@oe_filter_out('-I\S+', '${CFLAGS}', d)}" | 108 | CFLAGS := "${@oe_filter_out('-I\S+', '${CFLAGS}', d)}" |
99 | 109 | ||
100 | python () { | 110 | python () { |
@@ -133,84 +143,41 @@ do_configure() { | |||
133 | 143 | ||
134 | # Mangle the resulting .config depending on OE variables | 144 | # Mangle the resulting .config depending on OE variables |
135 | perl -i -p -e 's,^CROSS=.*,TARGET_ARCH=${TARGET_ARCH}\nCROSS=${TARGET_PREFIX},g' ${S}/Rules.mak | 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 | ||
136 | perl -i -p -e '${configmangle}' ${S}/.config | 147 | perl -i -p -e '${configmangle}' ${S}/.config |
137 | 148 | ||
138 | sed -i -e '/CONFIG_ARM_EABI/d' ${S}/.config | 149 | sed -i -e '/CONFIG_ARM_EABI/d' ${S}/.config |
139 | 150 | ||
140 | if [ "${TARGET_OS}" = "linux-gnueabi" -o "${TARGET_OS}" = "linux-uclibcgnueabi" ]; then | 151 | if [ `echo ${TARGET_ARCH} | grep -e '^arm'` ]; then |
141 | echo "CONFIG_ARM_EABI=y" >> ${S}/.config | 152 | if [ `echo ${TARGET_OS} | grep -e 'eabi$'` ]; then |
142 | else | 153 | echo "CONFIG_ARM_EABI=y" >> ${S}/.config |
143 | echo "# CONFIG_ARM_EABI is not set" >> ${S}/.config | 154 | else |
155 | echo "# CONFIG_ARM_EABI is not set" >> ${S}/.config | ||
156 | fi | ||
144 | fi | 157 | fi |
145 | |||
146 | yes '' | oe_runmake oldconfig | 158 | yes '' | oe_runmake oldconfig |
147 | } | 159 | } |
148 | 160 | ||
149 | do_stage() { | ||
150 | # This MUST be done first because we | ||
151 | # will install crt1.o in the install_dev stage and gcc needs it | ||
152 | |||
153 | # Install into the staging dir | ||
154 | oe_runmake PREFIX= DEVEL_PREFIX=${UCLIBC_STAGE_PREFIX}/ \ | ||
155 | RUNTIME_PREFIX=${UCLIBC_STAGE_PREFIX}/ \ | ||
156 | install_dev install_runtime | ||
157 | |||
158 | # Install into the staging dir | ||
159 | oe_runmake PREFIX= DEVEL_PREFIX=${UCLIBC_STAGE_PREFIX}/ \ | ||
160 | RUNTIME_PREFIX=${UCLIBC_STAGE_PREFIX}/ \ | ||
161 | install_utils | ||
162 | |||
163 | # We don't really need this | ||
164 | rm -f ${UCLIBC_STAGE_PREFIX}/include/.cvsignore | ||
165 | |||
166 | # Fixup shared lib symlinks | ||
167 | ( cd ${UCLIBC_STAGE_PREFIX}/lib | ||
168 | for f in c crypt dl m nsl pthread resolv thread_db util; do | ||
169 | ln -sf lib${f}.so.? lib${f}.so | ||
170 | done | ||
171 | ) | ||
172 | |||
173 | # This conflicts with the c++ version of this header | ||
174 | rm -f ${UCLIBC_STAGE_PREFIX}/include/bits/atomicity.h | ||
175 | } | ||
176 | |||
177 | do_install() { | 161 | do_install() { |
178 | # Tis MUST be done first because we | ||
179 | # will install crt1.o in the install_dev stage and gcc needs it) | ||
180 | oe_runmake PREFIX= DEVEL_PREFIX=${UCLIBC_STAGE_PREFIX}/ \ | ||
181 | RUNTIME_PREFIX=${UCLIBC_STAGE_PREFIX}/ \ | ||
182 | install_dev install_runtime | ||
183 | |||
184 | oe_runmake PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \ | 162 | oe_runmake PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \ |
185 | install_dev install_runtime | 163 | install_dev install_runtime |
186 | 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 | |||
187 | # We don't really need this in ${includedir} | 170 | # We don't really need this in ${includedir} |
188 | rm -f ${D}${prefix}/include/.cvsignore | 171 | rm -f ${D}${prefix}/include/.cvsignore |
189 | 172 | ||
190 | # This conflicts with the c++ version of this header | 173 | # This conflicts with the c++ version of this header |
191 | rm -f ${D}${prefix}/include/bits/atomicity.h | 174 | rm -f ${D}${prefix}/include/bits/atomicity.h |
192 | 175 | ||
193 | # ugh.. uclibc doesn't like obeying our path variables. | 176 | oe_runmake "SSP_ALL_CFLAGS=${TARGET_LINK_HASH_STYLE}" utils |
194 | if [ "${includedir}" != "${prefix}/include" ]; then | 177 | oe_runmake STRIPTOOL=true PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \ |
195 | install -d ${D}${includedir} | ||
196 | mv ${D}${prefix}/include/* ${D}${includedir}/ | ||
197 | rmdir ${D}${prefix}/include | ||
198 | fi | ||
199 | |||
200 | if [ "${libdir}" != "${prefix}/lib" ]; then | ||
201 | install -d ${D}${libdir} | ||
202 | mv ${D}${prefix}/lib/* ${D}${libdir}/ | ||
203 | rmdir ${D}${prefix}/lib | ||
204 | fi | ||
205 | |||
206 | if [ "${bindir}" != "/usr/bin" ]; then | ||
207 | install -d ${D}${bindir} | ||
208 | mv ${D}/usr/bin/* ${D}${bindir}/ | ||
209 | rmdir ${D}/usr/bin | ||
210 | fi | ||
211 | |||
212 | oe_runmake utils | ||
213 | oe_runmake PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \ | ||
214 | install_utils | 178 | install_utils |
179 | |||
180 | # oe_runstrip needs +x on files | ||
181 | chmod +x ${D}/${base_libdir}/* | ||
215 | } | 182 | } |
216 | 183 | ||