summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-05-16 03:38:19 +0000
committerMike Frysinger <vapier@gentoo.org>2012-05-16 03:38:19 +0000
commitb8eea63dda9fcf0551e820ae8b046cc24006980d (patch)
treecf5074c078a603a54be41f27cd7d027235cf957e /sys-libs/uclibc
parentRespect CXX, CXXFLAGS and LDFLAGS wrt -build.patch. Mark stable for amd64 (fo... (diff)
downloadhistorical-b8eea63dda9fcf0551e820ae8b046cc24006980d.tar.gz
historical-b8eea63dda9fcf0551e820ae8b046cc24006980d.tar.bz2
historical-b8eea63dda9fcf0551e820ae8b046cc24006980d.zip
Version bump.
Package-Manager: portage-2.2.0_alpha102/cvs/Linux x86_64
Diffstat (limited to 'sys-libs/uclibc')
-rw-r--r--sys-libs/uclibc/ChangeLog7
-rw-r--r--sys-libs/uclibc/Manifest31
-rw-r--r--sys-libs/uclibc/uclibc-0.9.33.2.ebuild376
3 files changed, 399 insertions, 15 deletions
diff --git a/sys-libs/uclibc/ChangeLog b/sys-libs/uclibc/ChangeLog
index 64e7a5e45fe8..be9887e7757f 100644
--- a/sys-libs/uclibc/ChangeLog
+++ b/sys-libs/uclibc/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-libs/uclibc
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.62 2012/04/24 02:57:26 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.63 2012/05/16 03:38:19 vapier Exp $
+
+*uclibc-0.9.33.2 (16 May 2012)
+
+ 16 May 2012; Mike Frysinger <vapier@gentoo.org> +uclibc-0.9.33.2.ebuild:
+ Version bump.
*uclibc-0.9.33.1-r1 (24 Apr 2012)
diff --git a/sys-libs/uclibc/Manifest b/sys-libs/uclibc/Manifest
index 785e15261c59..cdedade99daa 100644
--- a/sys-libs/uclibc/Manifest
+++ b/sys-libs/uclibc/Manifest
@@ -16,6 +16,8 @@ DIST uClibc-0.9.30.tar.bz2 2291882 RMD160 08270ef742a2167ae660c5440bc5f78775a10a
DIST uClibc-0.9.33.1-patches-1.tar.bz2 2406 RMD160 1bc437f26786ef622ce6463ee38823486d02b6fb SHA1 19041d0c7f78206080d6a3c23b3811c497949d79 SHA256 2258cb1a52299d08af33de391003e5fc36f035c8b00a746b9fdfe8c0ca02c2bc
DIST uClibc-0.9.33.1-patches-2.tar.bz2 5640 RMD160 6bc26fbb57ae71e71e4c31463a31ce6fa9a13f1a SHA1 9f048c40b2256098f006f2858d18f02b4d016a9c SHA256 a441d40de4ee4a763e39c7ec39633241f880295a19b1b20e0b22b887b3efb228
DIST uClibc-0.9.33.1.tar.bz2 2830006 RMD160 ab51fa11c1a1eece7dc70d307d63b9e0bf5c601c SHA1 8360891d368726a8c6d9ac3e1431c73bb8e99b0b SHA256 33df86ec088ec19784e10fb954950677ddee63c06f0edccd4ade1a7971a9d137
+DIST uClibc-0.9.33.2-patches-1.tar.bz2 2351 RMD160 a069c2f917615674388476947cfbe822ba444edb SHA1 263e93d8f82a60ba071e274200dd1ee4e932f10e SHA256 f85756b12ce5f20747f7900b30016bc4c391e0b6977cf6ecfe35891da0f851d8
+DIST uClibc-0.9.33.2.tar.bz2 2834029 RMD160 842e5eba2790603a6e241bbd4a5859e35fb602b8 SHA1 4d8d67d6754409bd10015d67d1ce7a04c0b001ba SHA256 988d2c777e0605fe253d12157f71ec68f25d1bb8428725d2b7460bf9977e1662
DIST uClibc-locale-030818.tgz 236073 RMD160 8e3f4b20b94e07e535cbbbe81287186014c5f151 SHA1 78f901e6ed228ed84106bd034c1b97eee1eecb50 SHA256 c4362be318a38f18d98dccf462d22d95bab92f05548bb93f65298fe9afaebd57
EBUILD uclibc-0.9.27-r1.ebuild 12295 RMD160 dfefb5f85c2b12c249e01ec0aa3c066a2c28ab59 SHA1 094a64200eca960c7b855d510f0f0639f625b22f SHA256 909046419adbf69c6f51c0df62120c9881dd264d0e685053594ce11a1898d40c
EBUILD uclibc-0.9.28.3-r3.ebuild 14469 RMD160 9ea3c6a093ddc317f7d1080810ec33c66046d3e8 SHA1 10a9a01da848586d1dcbc3d87701d32ef27555f4 SHA256 29624dc42980e1cd424508adf21cc67eab9b41007e375e0856276c69183c2d3c
@@ -27,23 +29,24 @@ EBUILD uclibc-0.9.30.1.ebuild 11424 RMD160 21b85d326ae2f39442706c544fd3923837ed7
EBUILD uclibc-0.9.30.ebuild 13831 RMD160 e2d718c7b4cbc3b75114ad552dbf60f0675f8d5e SHA1 d5a84b7d59c05b5b599e8b3445afd39475a76cbb SHA256 385cc38e7751d2edb8d46c9f8cb98587da2066d2935ccddd4f282f02dd68c1bb
EBUILD uclibc-0.9.33.1-r1.ebuild 10711 RMD160 b37f035b867b4abbe1b6a71811dc6b79e37e57a4 SHA1 a3227f017785ce2066fcbb2084d466266ec77272 SHA256 5eea8542a60d1f4246110a737c39ffe1ce9e86908be8aa31ab88e06bb020c6ab
EBUILD uclibc-0.9.33.1.ebuild 10685 RMD160 1fff401c9bb970f4f9d0bc68e717ce6323051a32 SHA1 d6da6b32e2e8599233cdd64749086ee0f419629b SHA256 33d795a5bd15bf3ba23f0962261b9959eecd1e9f0088dbd8cba41e1d99d4ad63
+EBUILD uclibc-0.9.33.2.ebuild 10708 RMD160 b901be6ccc8a39124057cfd4ed48b865a82b19a9 SHA1 3edb0fda16cbaab31d2cd8da0eb32dfa1944f09b SHA256 7594bfb3c828b3bdd6e55aa77333cba3236498cf83436eb85068e50ffc3ceb5e
EBUILD uclibc-9999.ebuild 10680 RMD160 3f9027412ffc75b0096ef5fb30ca7e2eb7da6ab2 SHA1 08536ea79e631f56e3dcbc8508d2cdc88f058cd7 SHA256 a8ecae2cbdecc215ecfe427297eae679fa2d995113c73d91ef64ce4d4c330765
-MISC ChangeLog 19068 RMD160 120312266963610d29b7b56029d8eb6f49fc7209 SHA1 204b6ed45bfdd6108221da1afc248be0881e96c9 SHA256 4cf9ef9eec3b81dd6f761483ab8e46a437703efec2af840ff6b57e27eedc5fac
+MISC ChangeLog 19192 RMD160 dc4fe1b6c79f748e8bac67a47c0b6436ea0b1622 SHA1 4af79ee08120151590f10ec461285043b5717393 SHA256 9c7a9316d337ed47e48dceff77bc3b37a146155c465eab34118d0949d3b6fd6b
MISC metadata.xml 1554 RMD160 5071d116bd5447b2c6b0b4dc55f974431aa038b3 SHA1 ae2064f158c508753a69e0f76f3ba4817da4c834 SHA256 0cac93320797a827e0d8e7413a105423435d4c648aaf40cb6b490f3d75f0bdd3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
-iQIcBAEBAgAGBQJPlhb1AAoJELEHsLL7fEFWLVsQALjJlnKBP0y8kgsgkyReQHTc
-NbnWdudUWkSxFT+kOR3JYxhLIg2HQw948te1zpkQ35heiSNHnVHqTz6aXZWwKBL4
-tlJ2FdweEM4VJ5GP5hE/CjGqIezh8dCvxwIo3lPylr9e5stElJ1W3f33hv4+bHXO
-WDMjvmhRor5bzfEr36XEGgQn7LutoaY4oM9xFuBLI/XxYqf3EkCSAfbRx2EEc5Hb
-rWNEgEWEqvirz1k8gQgZFn50yI8lqR5s/pKmay4wsNuLA5O1OD42HlS3wlgLAnel
-qlerQmtHHHES6Fwwi3HSPnFlwOuRw6qY2q6CJbNUifCl3WV4zndBp25TrbPLVBai
-Df+zCOyBPrX6ywM7nQFeJ/vLxBhS+4qbDw//MX30KXECVloa9KutbhYcMxymSHvx
-QrbuYkTXtl9+b8yvGjyx73TxMjE1wGQ5R9K/6DKfetKuruICYJ8GTH46UQxWW4Ie
-+k6MsVvU6hStF21TSAFu25Tzg1e6ikySKRqJFB4kM+YeDm9pZtJClU8KCI/66xAC
-sa5IFLOIDgptD4YAfGfeoZ9sLF00QL1DmmnfmBoCIfVJVcLndjgJWNfcXKVTN0RL
-xijEioQM58jY7Y0r8prwC3VkrNzaHBEwfemO1TyHGHR3Lo7y/zJUAThnnlSxuVLE
-on3VnExdvV+dIb/Ugvzd
-=CNIh
+iQIcBAEBAgAGBQJPsyFCAAoJELEHsLL7fEFW2gMQAIxeoCDpSqlN0D9lq1Nhxv8m
+tTEy7CkxOnbaBz9PWPrCZdoS6gkCb6lG/7MOczjGvGmKS0iRk6Z4nTOW3KmbQrLr
+EPmty/7AXjNpLMXnoGFkPAyBykPhdqs6xx8yPWyTunwy5NYuYax+ydZpj2PPG5Ti
+FhuchWLYkFlq1tWKdk9pfBwmpdf3h64QrHr9OTh7P41xh5E46kQb51+5tfaHZ3NM
+loHDL0tSkEI2iKaC7UFBd+cjVULT6rthT4sGaZIS4gbzvIMWordDg3zBnNSdIbs1
+oF0VCYQbPzKqOprds3W8LR44IRmaFAM7yzTZt9QgIXR+6XXNmk6jBo/f5jgoMSAW
+AFNALH3Q8mCTs8HSuG/Ujf9oQNQ9erAuWVcrODItXvwTUkhYi5pxStFFl9g/lHwX
+GwtcVvn321SmzIKOFAfL/mw3V43MxhnYcBWojnaiAQzSKzzSKVLEzmzGuwlLxA18
+Egf1uJhDVxAfwFM3vNyiKWSbD/0w3Eddxel5LUejQloxjSdtLwpfo03M+2+YJfL8
+wPm8238/bowQo/GBlHa1WK8vCn/YiCSOFLv+0VdewSBvAUP1JyBDX+F/p1VP6Y2K
+3AYTTUOdKaq2BI5tB+dPwAA0KgClShNLiQYgbnfyY5ybX5RL3a4rZNi7HCTKVxtB
+AFlFzR+eo7/v+uON+L+Q
+=vT1+
-----END PGP SIGNATURE-----
diff --git a/sys-libs/uclibc/uclibc-0.9.33.2.ebuild b/sys-libs/uclibc/uclibc-0.9.33.2.ebuild
new file mode 100644
index 000000000000..22125cfea8bd
--- /dev/null
+++ b/sys-libs/uclibc/uclibc-0.9.33.2.ebuild
@@ -0,0 +1,376 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.33.2.ebuild,v 1.1 2012/05/16 03:38:19 vapier Exp $
+
+inherit eutils flag-o-matic toolchain-funcs savedconfig
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.busybox.net/uClibc"
+ inherit git-2
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
+ export CTARGET=${CATEGORY/cross-}
+ fi
+fi
+
+MY_P=uClibc-${PV}
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc.org/"
+if [[ ${PV} != "9999" ]] ; then
+ PATCH_VER="1"
+ SRC_URI="http://uclibc.org/downloads/${MY_P}.tar.bz2
+ ${PATCH_VER:+mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2}"
+ KEYWORDS="-* ~amd64 ~arm ~m68k ~mips ~ppc ~sh ~sparc ~x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 nptl rpc ssp uclibc-compat wordexp crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+S=${WORKDIR}/${MY_P}
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+alt_build_kprefix() {
+ if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] ; then
+ echo /usr/include
+ else
+ echo /usr/${CTARGET}/usr/include
+ fi
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+ # XXX: this wont work for a toolchain which is bi-endian, but we
+ # dont have any such thing at the moment, so not a big deal
+ touch "${T}"/endian.s
+ $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+ case $(file "${T}"/endian.o) in
+ *" MSB "*) echo "BIG";;
+ *" LSB "*) echo "LITTLE";;
+ *) echo "NFC";;
+ esac
+ rm -f "${T}"/endian.{s,o}
+}
+
+pkg_setup() {
+ if [ ${CTARGET} == ${CHOST} ] ; then
+ case ${CHOST} in
+ *-uclinux*|*-uclibc*) ;;
+ *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+ esac
+ fi
+}
+
+# XXX: We should kill these off.
+CPU_ALPHA=""
+CPU_AMD64=""
+CPU_ARM="GENERIC_ARM ARM{610,710,7TDMI,720T,920T,922T,926T,10T,1136JF_S,1176JZ{_,F_}S,_{SA110,SA1100,XSCALE,IWMMXT},_CORTEX_{M3,M1}}"
+CPU_IA64=""
+CPU_M68K=""
+CPU_MIPS="MIPS_ISA_{1,2,3,4,MIPS{32{,R2},64}} MIPS_{N64,O32,N32}_ABI"
+CPU_PPC=""
+CPU_SH="SH{2,2A,3,4,5}"
+CPU_SPARC="SPARC_V{7,8,9,9B}"
+CPU_X86="GENERIC_386 {3,4,5,6}86 586MMX PENTIUM{II,III,4} K{6,7} ELAN CRUSOE WINCHIP{C6,2} CYRIXIII NEHEMIAH"
+IUSE_UCLIBC_CPU="${CPU_ARM} ${CPU_MIPS} ${CPU_PPC} ${CPU_SH} ${CPU_SPARC} ${CPU_X86}"
+
+check_cpu_opts() {
+ local cpu_var="CPU_$(echo $(tc-arch) | tr [a-z] [A-Z])"
+ [[ -z ${!cpu_var} ]] && return 0
+
+ if [[ -z ${UCLIBC_CPU} ]] ; then
+ ewarn "You really should consider setting UCLIBC_CPU"
+ ewarn "Otherwise, the build will be generic (read: slow)."
+ ewarn "Available CPU options:"
+ UCLIBC_CPU=$(eval echo ${!cpu_var})
+ echo ${UCLIBC_CPU}
+ case ${CTARGET} in
+ mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";;
+ sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";;
+ i[456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";;
+ *) export UCLIBC_CPU=${UCLIBC_CPU%% *};;
+ esac
+ else
+ local cpu found=0
+ for cpu in $(eval echo ${!cpu_var}) ; do
+ [[ ${UCLIBC_CPU} == "${cpu}" ]] && found=1 && break
+ done
+ if [[ ${found} -eq 0 ]] ; then
+ ewarn "UCLIBC_CPU choice '${UCLIBC_CPU}' not supported"
+ ewarn "Valid choices:"
+ eval echo ${!cpu_var}
+ die "pick a supported cpu type"
+ fi
+ fi
+}
+
+kconfig_q_opt() {
+ local flag=$1; shift
+ case ${flag} in
+ y|n) ;;
+ *) flag=$(usex ${flag} y n) ;;
+ esac
+
+ local var="defs_${flag}"
+ eval "${var}+=( $* )"
+}
+
+get_opt() {
+ (
+ unset ${1}
+ . ${2:-"${S}"/.config}
+ echo ${!1}
+ )
+}
+
+src_oldconfig() {
+ yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+src_config() {
+ restore_config .config
+ if [ -f .config ]; then
+ src_oldconfig
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ emake ARCH=${target} defconfig >/dev/null || die
+
+ local defs_{y,n} defs
+
+ defs=(
+ DO{DEBUG_PT,ASSERTS}
+ SUPPORT_LD_DEBUG_EARLY
+ UCLIBC_HAS_PROFILING
+ )
+ kconfig_q_opt n "${defs[@]}"
+ kconfig_q_opt debug DODEBUG SUPPORT_LD_DEBUG
+
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config
+ kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+ if [[ $(tc-is-softfloat) != "no" ]] ; then
+ kconfig_q_opt n UCLIBC_HAS_FPU
+ fi
+
+ if [[ ${CTARGET} == arm* ]] ; then
+ kconfig_q_opt n CONFIG_ARM_OABI
+ kconfig_q_opt y CONFIG_ARM_EABI
+ fi
+
+ defs=(
+ MALLOC_GLIBC_COMPAT
+ DO_C99_MATH
+ UCLIBC_HAS_{CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC}
+ UCLIBC_HAS_FENV
+ UCLIBC_HAS_{N,}FTW
+ UCLIBC_HAS_GNU_GLOB
+ UCLIBC_HAS_LIBUTIL
+ UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+ UCLIBC_HAS_RESOLVER_SUPPORT
+ UCLIBC_HAS_TZ_FILE_READ_MANY
+ UCLIBC_HAS_UTMPX
+ UCLIBC_SUSV3_LEGACY
+ UCLIBC_SUSV3_LEGACY_MACROS
+ UCLIBC_SUSV4_LEGACY
+ PTHREADS_DEBUG_SUPPORT
+ )
+ kconfig_q_opt y "${defs[@]}"
+ kconfig_q_opt n UCLIBC_HAS_CTYPE_UNSAFE
+ kconfig_q_opt n UCLIBC_HAS_LOCALE
+ kconfig_q_opt n HAS_NO_THREADS
+ kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+ kconfig_q_opt nptl UCLIBC_HAS_THREADS_NATIVE
+ kconfig_q_opt !nptl LINUXTHREADS_OLD
+ kconfig_q_opt rpc UCLIBC_HAS_{,{FULL,REENTRANT}_}RPC
+ kconfig_q_opt wordexp UCLIBC_HAS_WORDEXP
+ kconfig_q_opt uclibc-compat UCLIBC_HAS_LIB{NSL,RESOLV}_STUB COMPAT_ATEXIT
+
+ # we need to do it independently of hardened to get ssp.c built into libc
+ kconfig_q_opt y UCLIBC_HAS_SSP
+ kconfig_q_opt n UCLIBC_HAS_SSP_COMPAT
+ kconfig_q_opt y UCLIBC_HAS_ARC4RANDOM
+ kconfig_q_opt n PROPOLICE_BLOCK_ABRT
+ kconfig_q_opt y PROPOLICE_BLOCK_SEGV
+
+ # arm/mips do not emit PT_GNU_STACK, but if we enable this here
+ # it will be emitted as RWE, ppc has to be checked, x86 needs it
+ # this option should be used independently of hardened
+ if has $(tc-arch) x86 || has $(tc-arch) ppc ; then
+ kconfig_q_opt y UCLIBC_BUILD_NOEXECSTACK
+ else
+ kconfig_q_opt n UCLIBC_BUILD_NOEXECSTACK
+ fi
+ kconfig_q_opt y UCLIBC_BUILD_RELRO
+ kconfig_q_opt hardened UCLIBC_BUILD_PIE
+ kconfig_q_opt hardened UCLIBC_BUILD_NOW
+ kconfig_q_opt !ssp SSP_QUICK_CANARY
+ kconfig_q_opt ssp UCLIBC_BUILD_SSP
+
+ local def
+ for def in 1 2 ; do
+ # Run twice as some config opts depend on others being enabled first.
+ for def in ${defs_y[@]} ; do
+ sed -i -e "s:.*\<${def}\>.*set:${def}=y:g" .config
+ done
+ for def in ${defs_n[@]} ; do
+ sed -i -e "s:${def}=y:# ${def} is not set:g" .config
+ done
+ src_oldconfig
+ done
+
+ einfo "Enabled options:"
+ for def in ${defs_y[@]} ; do
+ einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+ done
+ einfo "Disabled options:"
+ for def in ${defs_n[@]} ; do
+ einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+ done
+
+ # setup build and run paths
+ sed -i \
+ -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${CTARGET}-\":" \
+ -e "/^KERNEL_HEADERS/s:=.*:=\"$(alt_build_kprefix)\":" \
+ -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \
+ -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \
+ -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \
+ -e "/^UCLIBC_EXTRA_CFLAGS/s:=.*:=\"${UCLIBC_EXTRA_CFLAGS}\":" \
+ .config || die
+
+ src_oldconfig
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-2_src_unpack
+ else
+ unpack ${A}
+ fi
+ cd "${S}"
+ if [[ -n ${PATCH_VER} ]] ; then
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ fi
+
+ check_cpu_opts
+
+ echo
+ einfo "Runtime Prefix: /"
+ einfo "Devel Prefix: /usr"
+ einfo "Kernel Prefix: $(alt_build_kprefix)"
+ einfo "CBUILD: ${CBUILD}"
+ einfo "CHOST: ${CHOST}"
+ einfo "CTARGET: ${CTARGET}"
+ einfo "CPU: ${UCLIBC_CPU:-default}"
+ einfo "ENDIAN: $(uclibc_endian)"
+ echo
+
+ ########## CPU SELECTION ##########
+
+ local target config_target
+ case $(tc-arch) in
+ alpha) target="alpha"; config_target="no cpu-specific options";;
+ amd64) target="x86_64"; config_target="no cpu-specific options";;
+ arm) target="arm"; config_target="GENERIC_ARM";;
+ avr) target="avr32"; config_target="no cpu-specific options";;
+ ia64) target="ia64"; config_target="no cpu-specific options";;
+ m68k) target="m68k"; config_target="no cpu-specific options";;
+ mips) target="mips"; config_target="MIPS_ISA_1";;
+ ppc) target="powerpc"; config_target="no cpu-specific options";;
+ sh) target="sh"; config_target="SH4";;
+ sparc) target="sparc"; config_target="no cpu-specific options";;
+ x86) target="i386"; config_target="GENERIC_386";;
+ *) die "$(tc-arch) lists no defaults :/";;
+ esac
+ sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \
+ extra/Configs/Config.${target}
+ sed -i -e "s:^HOSTCC.*=.*:HOSTCC=$(tc-getBUILD_CC):" Rules.mak
+
+ src_config
+
+ if use iconv ; then
+ # Run after make clean, otherwise files removed
+ find ./extra/locale/charmaps -name "*.pairs" > extra/locale/codesets.txt
+ if [[ ! -f /etc/locale.gen ]] ; then
+ # See ./extra/locale/LOCALES for examples
+ die "Please create an appropriate /etc/locale.gen for locale support"
+ fi
+ echo -e "@euro e\n@cyrillic c\n#---\nUTF-8 yes\n8-BIT yes\n#---\n\n" > ./extra/locale/locales.txt
+ cat /etc/locale.gen >> ./extra/locale/locales.txt
+ fi
+}
+
+src_compile() {
+ emake headers || die
+ just_headers && return 0
+
+ emake || die
+ if is_crosscompile ; then
+ emake -C utils hostutils || die
+ else
+ emake utils || die
+ fi
+}
+
+src_test() {
+ is_crosscompile && return 0
+
+ # assert test fails on pax/grsec enabled kernels - normal
+ # vfork test fails in sandbox (both glibc/uclibc)
+ emake UCLIBC_ONLY=1 check || die
+}
+
+src_install() {
+ local sysroot=${D}
+ is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+ local target="install"
+ just_headers && target="install_headers"
+ emake DESTDIR="${sysroot}" ${target} || die
+
+ save_config .config
+
+ # remove files coming from kernel-headers
+ rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ dosym usr/include /usr/${CTARGET}/sys-include
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig || die
+ newbin utils/ldd.host ${CTARGET}-ldd || die
+ fi
+ return 0
+ fi
+
+ emake DESTDIR="${D}" install_utils || die
+ dobin extra/scripts/getent
+ dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then
+ ewarn "Please remember to set your timezone in /etc/TZ"
+ mkdir -p "${ROOT}"/etc
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+ [ "${ROOT}" != "/" ] && return 0
+ # update cache before reloading init
+ ldconfig
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}