# HG changeset patch # User Christophe Lincoln # Date 1337636924 -7200 # Node ID 521a11df54e708b4a79fe23bc2d7369beea7e452 # Parent 3768ab6ce78074ef6aff9226c079a0ee1c13eee3 glibc-base: improve receipt for ARM and cross-compilation diff -r 3768ab6ce780 -r 521a11df54e7 glibc-base/receipt --- a/glibc-base/receipt Mon May 21 23:25:00 2012 +0200 +++ b/glibc-base/receipt Mon May 21 23:48:44 2012 +0200 @@ -6,17 +6,17 @@ SHORT_DESC="GNU libc minimal libraries and UTF-8 support for SliTaz." WEB_SITE="http://www.gnu.org/software/libc/" MAINTAINER="pankso@slitaz.org" +WANTED="glibc" HOST_ARCH="i486 arm" +# Locales include by default, other locales are in: glibc-locale +DEFAULT_LOCALE="de_DE en_US en_GB es_ES fr_FR it_IT pt_BR pt_PT ru_RU" + +# Handle multiarch compilation. case "$ARCH" in - arm) - VERSION="2.13" ;; - i?86) - WANTED="glibc" ;; + arm) VERSION="2.13" WANTED="" ;; esac -DEFAULT_LOCALE="de_DE en_US en_GB es_ES fr_FR it_IT pt_BR pt_PT ru_RU" - # Rules to gen a SliTaz package suitable for Tazpkg. # # Full glibc is very long to compile (see package glibc for more @@ -31,7 +31,7 @@ # toolchain so we can use these files instead of recooking it. # 20120514: Include just minal libs for Busybox so we can create # bootable Qemu image for ARM. - echo "Using cross compiled Glibc" + echo "Using cross compiled Glibc..." mkdir -p $fs/lib $fs/etc $fs/usr/bin install=/usr/cross/$ARCH for bin in locale localedef @@ -48,6 +48,13 @@ cp -a $install/lib/libc_nonshared.a $fs/lib cp $install/etc/rpc $fs/etc touch $fs/etc/ld.so.conf + ## i18n + #mkdir -p $fs/usr/share/i18n/locales + #for i in $DEFAULT_LOCALE + #do + #cp $install/share/i18n/locales/$i \ + #$fs/usr/share/i18n/locales + #done # Fix libraries search path sed -i s'|/usr/cross/arm||'g $fs/lib/libc.so ;; *) @@ -74,5 +81,15 @@ # Remove an eventual locale-archive since we use directories. pre_install() { - rm -f $1/usr/lib/locale/locale-archive + rm -f $root/usr/lib/locale/locale-archive } + +# Glibc-base is auto-updated in chroot but when cross-compiling we need +# to have /usr/cross/$ARCH search path in libc.so +post_install() +{ + if echo $root | grep -q /usr/cross; then + echo "Fixing: $root/lib/libc.so" + sed -i s"|/lib|$root/lib|"g $root/lib/libc.so + fi +}