--- /dev/null
+# ChangeLog for dev-libs/uclibc
+# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.1 2005/01/12 00:50:53 vapier Exp $
+
+ 11 Jan 2005; Mike Frysinger <vapier@gentoo.org> uclibc-0.9.26-r8.ebuild:
+ Merge psm & my cross compile work together and BAM we have a sweet ebuild.
+
+ 14 Dec 2004; <solar@gentoo.org> uclibc-0.9.26-r8.ebuild:
+ - Improved hardened handling bug 73699. Initial support for xattr.
+
+ 10 Nov 2004; <solar@gentoo.org> uclibc-0.9.26-r8.ebuild:
+ uclibc updates
+
+*uclibc-0.9.26-r8 (06 Nov 2004)
+
+ 06 Nov 2004; Mike Frysinger <vapier@gentoo.org> +uclibc-0.9.26-r8.ebuild:
+ Add the ability to select CPU/endian type #69871.
+
+ 28 Oct 2004; <solar@gentoo.org> uclibc-0.9.26-r7.ebuild:
+ uclibc-0.9.26-r7 marked stable for x86/arm/ppc/mips. 30 days in ~arch,
+ security changes only which mark unsecvars stable
+
+ 13 Oct 2004; <solar@gentoo.org> files/0.9.26/ssp.c:
+ more updates to ssp.c
+
+ 12 Oct 2004; <solar@gentoo.org> files/0.9.26/ssp.c:
+ reverting to old ssp behavior
+
+*uclibc-0.9.26-r7 (28 Sep 2004)
+
+ 28 Sep 2004; <solar@gentoo.org>
+ +files/0.9.26/uClibc-20040921-ldso-unsecvars.patch,
+ +files/0.9.26/unsecvars.h, +uclibc-0.9.26-r7.ebuild:
+ added unsecvars handling to uclibc. testing ground here and going mainline
+ afterwords
+
+ 06 Sep 2004; Ciaran McCreesh <ciaranm@gentoo.org> uclibc-0.9.26-r3.ebuild,
+ uclibc-0.9.26-r4.ebuild, uclibc-0.9.26-r5.ebuild, uclibc-9999.ebuild:
+ Switch to use epause and ebeep, bug #62950
+
+*uclibc-9999 (25 Aug 2004)
+
+ 25 Aug 2004; Mike Frysinger <vapier@gentoo.org>
+ +uclibc-9999.ebuild:
+ CVS ebuild to make our (well mine at least) lives easier.
+
+ 19 Aug 2004; <solar@gentoo.org> uclibc-0.9.26-r1.ebuild,
+ uclibc-0.9.26-r2.ebuild, uclibc-0.9.26-r3.ebuild, uclibc-0.9.26-r4.ebuild,
+ uclibc-0.9.26-r5.ebuild:
+ update RDEPEND. bug 60911
+
+ 09 Aug 2004; Mike Frysinger <vapier@gentoo.org>
+ +files/0.9.26/uclibc-0.9.26-ldso-cache.patch, uclibc-0.9.26-r5.ebuild:
+ Add a small patch to allow loading of ELF_LIBC0 libraries.
+
+ 09 Aug 2004; Mike Frysinger <vapier@gentoo.org>
+ +files/0.9.26/uclibc-0.9.26-resolve-segfault.patch, uclibc-0.9.26-r5.ebuild:
+ Add a homebrewed patch to fix the bug with gethostname() which didnt setup the
+ h_aliases data.
+
+*uclibc-0.9.26-r5 (09 Aug 2004)
+
+ 09 Aug 2004; <solar@gentoo.org> uclibc-0.9.26-r5.ebuild:
+ version bump requested by spanky
+
+ 06 Aug 2004; Mike Frysinger <vapier@gentoo.org>
+ +files/0.9.26/arm-ucontext.patch, uclibc-0.9.26-r4.ebuild:
+ Make sure arm/ucontext.h includes the right context files and fix the ld utils
+ to properly read/write /etc/ld.so.* files.
+
+*uclibc-0.9.26-r4 (30 Jul 2004)
+
+ 30 Jul 2004; <solar@gentoo.org> uclibc-0.9.26-r4.ebuild:
+ updated the cvs snapshot so we can get some header updates
+
+ 13 Jul 2004; <solar@gentoo.org> uclibc-0.9.26-r3.ebuild:
+ paying respect to mjn3 and his DEDICATION to his wife in the docs
+
+*uclibc-0.9.26-r3 (12 Jul 2004)
+
+ 12 Jul 2004; <solar@gentoo.org> uclibc-0.9.26-r3.ebuild,
+ files/0.9.26/uclibc-0.9.26-noexecstack.patch:
+ more uclibc updates from Peter S. Mazinger
+
+ 05 Jul 2004; <solar@gentoo.org> uclibc-0.9.21.ebuild,
+ uclibc-0.9.26-r1.ebuild, uclibc-0.9.26-r2.ebuild, files/getent:
+ added getent which is a shell replacement (uclibc does not have it, but
+ ebuild.sh uses it. So we need it!
+
+ 01 Jul 2004; Jeremy Huddleston <eradicator@gentoo.org> uclibc-0.9.21.ebuild,
+ uclibc-0.9.26-r1.ebuild, uclibc-0.9.26-r2.ebuild:
+ virtual/glibc -> virtual/libc
+
+ 27 Jun 2004; <solar@gentoo.org> uclibc-0.9.21.ebuild,
+ uclibc-0.9.26-r1.ebuild, uclibc-0.9.26-r2.ebuild:
+ updated PROVIDES for virtual/libc
+
+*uclibc-0.9.26-r2 (23 Jun 2004)
+
+ 23 Jun 2004; <solar@gentoo.org> uclibc-0.9.26-r2.ebuild,
+ files/0.9.26/uclibc-0.9.26-arm-dl-sysdep.patch:
+ Added patch for ARCH=arm to prevent a static inlines from being included more
+ than one time. sent patch upstream
+
+ 22 Jun 2004; <solar@gentoo.org> files/0.9.26/ssp.c,
+ files/0.9.26/uClibc-20040613-do_rem.patch,
+ files/0.9.26/uclibc-0.9.26-ssp-gcc34-after-frandom.patch:
+ major uclibc cleanups. New IUSE= flags and functionality
+
+ 26 May 2004; Mike Frysinger <vapier@gentoo.org>
+ +files/0.9.26/arm-fix-missing-syscalls.patch, uclibc-0.9.26-r1.ebuild:
+ Add patch to allow arm building
+
+ 01 Feb 2004; <solar@gentoo.org> uclibc-0.9.23.ebuild,
+ uclibc-0.9.26-r1.ebuild, uclibc-0.9.26.ebuild:
+ The etdyn local use flag has been renamed to pie (Position Independent
+ Executable) Removed old ebuilds.. Keeping 0.9.21 as stable till Gentoo has a
+ working uClibc toolchain in place
+
+*uclibc-0.9.26-r1 (08 Jan 2004)
+
+ 08 Jan 2004; <solar@gentoo.org> uclibc-0.9.26-r1.ebuild,
+ files/0.9.26/uClibc-0.9.26-Makefile.patch,
+ files/0.9.26/uClibc-0.9.26-pie-option.patch:
+ Attached is one patch needed to really enable FORCE_SHAREABLE_SEGMENTS
+ option, the other is to build uclibc against the installed kernel-headers
+ (not kernel-source) - Peter S. Mazinger gentoo-embedded mailing list.
+
+*uclibc-0.9.26 (04 Jan 2004)
+
+ 04 Jan 2004; <solar@gentoo.org> uclibc-0.9.25-r1.ebuild,
+ uclibc-0.9.25.ebuild, uclibc-0.9.26.ebuild:
+ version bump.. there was a pthread bug that slipped though uclibc.org testing
+
+*uclibc-0.9.25-r1 (04 Jan 2004)
+
+ 04 Jan 2004; <solar@gentoo.org> uclibc-0.9.21.ebuild, uclibc-0.9.23.ebuild,
+ uclibc-0.9.25-r1.ebuild, uclibc-0.9.25.ebuild:
+ added back etdyn/pie support for x86. If -fstack-protector is in the users
+ CFLAGS then let uclibc provide __guard symbols
+
+*uclibc-0.9.25 (03 Jan 2004)
+
+ 03 Jan 2004; Mike Frysinger <vapier@gentoo.org> :
+ Version bumpage #36235. Patches no longer needed since they've all been
+ integrated upstream.
+
+*uclibc-0.9.23 (15 Nov 2003)
+
+ 21 Nov 2003; <solar@gentoo.org> metadata.xml:
+ update metadata.xml
+
+ 21 Nov 2003; <solar@gentoo.org> uclibc-0.9.22.ebuild,
+ files/uClibc-0.9.22-etdyn.patch, files/uClibc-0.9.22-pax.patch,
+ files/0.9.23/uClibc-0.9.23-etdyn.patch,
+ files/0.9.23/uClibc-0.9.23-flipturn.patch:
+ updated etdyn patches. no major functional changes to revision bump, removed
+ buggy 0.9.22 code from portage
+
+ 15 Nov 2003; <solar@gentoo.org> uclibc-0.9.23.ebuild,
+ files/0.9.23/uClibc-0.9.23-etdyn.patch,
+ files/0.9.23/uClibc-0.9.23-flipturn.patch,
+ files/0.9.23/uClibc-0.9.23-pax.patch:
+ version bump, 0.9.22 was braindead.. In this release we continue support for
+ PaX etdyn executabes thanks to the PaX Team and Peter S. Mazinger as well as
+ add a small patch that was submited to the uClibc by Rob McMullen
+
+*uclibc-0.9.22 (11 Nov 2003)
+
+ 11 Nov 2003; <solar@gentoo.org> uclibc-0.9.22.ebuild,
+ files/uClibc-0.9.22-etdyn.patch, files/uClibc-0.9.22-pax.patch:
+ version bump, this ebuild includes experimental pax-etdyn support for uclibc
+ when local use flag etdyn is used
+
+ 04 Oct 2003; <solar@gentoo.org> uclibc-0.9.21.ebuild:
+ marking stable on x86, and added a metadata.xml
+
+*uclibc-0.9.21 (10 Sep 2003)
+
+ 30 Sep 2003; Joshua Kinard <kumba@gentoo.org> uclibc-0.9.21.ebuild:
+ Added ~sparc & ~mips to KEYWORDS
+ Useful for building our netboot images with
+
+ 10 Sep 2003; <solar@gentoo.org> uclibc-0.9.21.ebuild:
+ andersee is pleased to announce the immediate availability of uClibc 0.9.21.
+ This release has been brewing for several months now, and provides quite a lot
+ of additional functionality as well as quite a few bug fixes. The biggest
+ thing in this release (and I do mean that literally) is that uClibc now has
+ full ANSI/ISO C99 locale support. The most interesting thing for uClinux are
+ the additional config options that will let you tune the library to be even
+ smaller, for example, by disabling all the strerror() messages.
+
+*uclibc-0.9.20 (09 Jul 2003)
+
+ 09 Jul 2003; Mike Frysinger <vapier@gentoo.org> :
+ Version bumpage.
+
+*uclibc-0.9.19 (19 Jun 2003)
+
+ 19 Jun 2003; Mike Frysinger <vapier@gentoo.org> :
+ Version bump #15579 thanks to David Bryson <mutex@kerneli.org>.
+
+*uclibc-0.9.16 (11 Nov 2002)
+
+ 25 May 2003; Martin Holzer <mholzer@gentoo.org> uclibc-0.9.16.ebuild:
+ now uses mirror://kernel
+
+ 11 Nov 2002; Mike Frysinger <vapier@gentoo.org> :
+ Initial import. Ebuild submitted by me.
--- /dev/null
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+MD5 a592172d210be32e6b23bb873a87c4e6 ChangeLog 8164
+MD5 e96b4dfc373a1cdf7735aeae52c4cf7e metadata.xml 999
+MD5 df615cdf63852f4f6fa1c9f9c2bf0f7f uclibc-0.9.26-r8.ebuild 9415
+MD5 0b733285f186f31c1be9ffcc42f1064e files/getent 973
+MD5 e0556dd58957468793213ab327c590d3 files/digest-uclibc-0.9.26-r8 232
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.9.14 (GNU/Linux)
+
+iD8DBQFB5HSIroRuSHgZdywRAru9AJ9j725uhZg5MteWzUeQDAURpPoBhgCaA+F1
+am5Sg7UfDfkLIKT9dqXVGA8=
+=L47o
+-----END PGP SIGNATURE-----
--- /dev/null
+MD5 7212713c432dd0de6ec2140c2a6212e4 uClibc-0.9.26.tar.bz2 1604543
+MD5 27f9c3067674f1f479a4ea6491c7e63b uClibc-0.9.26-cvs-update-20041209.patch.bz2 403987
+MD5 87c26182b2254e65682408444adb9e90 uClibc-0.9.26-patches-1.4.tar.bz2 35502
--- /dev/null
+#!/bin/sh
+
+search_entry() {
+ if [ -e "$1" ] ; then
+ /bin/egrep -v "^#" $1 | /bin/sed 's/#.*$//' | /bin/egrep "${string}" | /bin/sed -n 1p
+ retval=$?
+ [ "$retval" = 0 ] || retval=2
+ else
+ retval=2
+ fi
+}
+
+file="/etc/$1"
+string="dummy"
+
+#aliases|ethers|group|hosts|netgroup|networks|passwd|protocols|rpc|services|shadow)
+# dns based search is not supported for hosts|networks
+# networks searches ^string
+# protocols|rpc|services searches string anywhere
+# ethers|netgroup ?
+# it returns only the first match
+case $1 in
+ group|passwd|shadow)
+ string="^\<$2\>:"
+ ;;
+ aliases)
+ if [ -f /etc/postfix/aliases ] ; then
+ file="/etc/postfix/aliases"
+ elif [ -f /etc/mail/aliases ] ; then
+ file="/etc/mail/aliases"
+ fi
+ string="^\<$2\>:"
+ ;;
+ networks)
+ string="^\<$2\>"
+ ;;
+ hosts|protocol|rpc|services)
+ string="\<$2\>"
+ ;;
+ *)
+ echo "Unknown database: $1"
+ exit 1
+ ;;
+esac
+
+search_entry $file $2
+
+exit $retval
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>embedded</herd>
+ <maintainer>
+ <email>vapier@gentoo.org</email>
+ <description>Primary Maintainer</description>
+ </maintainer>
+ <maintainer>
+ <email>solar@gentoo.org</email>
+ <description>Secondary Maintainer</description>
+ </maintainer>
+ <longdescription>
+uClibc pronounced yew-see-lib-see is a C library for developing embedded Linux
+systems. It is much smaller than the GNU C Library, but nearly all applications supported
+by glibc also work perfectly with uClibc. Porting applications from glibc to uClibc
+typically involves just recompiling the source code. uClibc even supports shared libraries
+and threading. It currently runs on standard Linux and MMU-less (also known as uClinux)
+systems with support for alpha, ARM, cris, i386, i960, h8300, m68k, mips/mipsel, PowerPC,
+SH, SPARC, and v850 processors.
+</longdescription>
+</pkgmetadata>
--- /dev/null
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.26-r8.ebuild,v 1.1 2005/01/12 00:50:53 vapier Exp $
+
+inherit eutils flag-o-matic toolchain-funcs
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
+ export CTARGET=${CATEGORY/cross-}
+ fi
+fi
+
+# To make a new CVS_VER we do.
+# wget -O - http://uclibc.org/downloads/snapshots/uClibc-`date +%Y%m%d`.tar.bz2 | tar jxf -
+# tar jxf /usr/portage/distfiles/uClibc-0.9.26.tar.bz2
+# diff -urN --exclude .cvsignore --exclude CVS uClibc-0.9.26 uClibc | bzip2 - > uClibc-0.9.26-cvs-update-`date +%Y%m%d`.patch.bz2
+# rm -rf uClibc-0.9.26-cvs-update-`date +%Y%m%d`.patch.bz2 uClibc uClibc-0.9.26
+
+MY_P=${P/ucl/uCl}
+# only CVS_VER >= 20041117 is supported
+CVS_VER="20041209"
+PATCH_VER="1.4"
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc.org/"
+SRC_URI="http://www.kernel.org/pub/linux/libs/uclibc/${MY_P}.tar.bz2
+ mirror://gentoo/${MY_P}-cvs-update-${CVS_VER}.patch.bz2
+ mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2"
+
+LICENSE="LGPL-2"
+[[ ${CTARGET} != ${CHOST} ]] \
+ && SLOT="${CTARGET}" \
+ || SLOT="0"
+KEYWORDS="~arm ~mips ~ppc ~sh ~sparc ~x86"
+IUSE="alsa build debug hardened ipv6 static xattr" # nls is not supported yet
+RESTRICT="nostrip"
+
+# 2004/11/16 the only binutils w/ relro support for uclibc
+DEPEND="sys-devel/gcc"
+RDEPEND=""
+PROVIDE="virtual/glibc virtual/libc"
+
+S="${WORKDIR}/${MY_P}"
+
+alt_prefix() {
+ if [[ ${CTARGET} = ${CHOST} ]] ; then
+ echo /usr
+ else
+ echo /usr/${CTARGET}
+ fi
+}
+alt_rprefix() {
+ if [[ ${CTARGET} = ${CHOST} ]] ; then
+ echo /
+ else
+ echo /usr/${CTARGET}
+ fi
+}
+
+CPU_ARM="GENERIC_ARM ARM{610,710,720T,920T,922T,926T,_{SA110,SA1100,XSCALE}}"
+CPU_MIPS="MIPS_ISA_{1,2,3,4,MIPS{32,64}}"
+CPU_PPC=""
+CPU_SH="SH{2,3,4,5}"
+CPU_X86="GENERIC_386 {3,4,5,6}86 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_X86}"
+
+check_cpu_opts() {
+ local cpu_var="CPU_$(echo $(tc-arch ${CTARGET}) | tr [a-z] [A-Z])"
+ 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}
+ export UCLIBC_CPU=${UCLIBC_CPU%% *}
+ 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
+}
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ check_cpu_opts
+
+ ########## PATCHES ##########
+
+ [[ -n ${CVS_VER} ]] && \
+ epatch ${DISTDIR}/${MY_P}-cvs-update-${CVS_VER}.patch.bz2
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ unpack ${MY_P}-patches-${PATCH_VER}.tar.bz2
+ epatch ${WORKDIR}/patch
+ # math functions (sinf,cosf,tanf,atan2f,powf,fabsf,copysignf,scalbnf,rem_pio2f)
+ use build || epatch ${WORKDIR}/patch/math
+ fi
+
+ ########## CPU SELECTION ##########
+
+ local target config_target
+ case $(tc-arch ${CTARGET}) in
+ arm) target="arm"; config_target="GENERIC_ARM";;
+ mips) target="mips"; config_target="MIPS_ISA_1";;
+ ppc) target="powerpc"; config_target="no cpu-specific options";;
+ sh) target="sh"; config_target="SH4";;
+ x86) target="i386"; config_target="GENERIC_386";;
+ *) die "$(tc-arch ${CTARGET}) lists no defaults :/";;
+ esac
+ sed -i -e "s:default TARGET_i386:default TARGET_${target}:" \
+ extra/Configs/Config.in
+ sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \
+ extra/Configs/Config.${target}
+
+ ########## CONFIG SETUP ##########
+
+ make defconfig >/dev/null || die "could not config"
+
+ for def in UCLIBC_PROFILING DO{DEBUG,ASSERTS} SUPPORT_LD_DEBUG{,_EARLY} ; do
+ sed -i -e "s:${def}=y:# ${def} is not set:" .config
+ done
+ if use debug ; then
+ echo "SUPPORT_LD_DEBUG=y" >> .config
+ echo "DODEBUG=y" >> .config
+ fi
+
+ sed -i -e 's:^ARCH_.*_ENDIAN=y::' .config
+ echo "ARCH_$(tc-endian | tr [a-z] [A-Z])_ENDIAN=y" >> .config
+
+ for def in DO_C99_MATH UCLIBC_HAS_{RPC,CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC,FTW} ; do
+ sed -i -e "s:# ${def} is not set:${def}=y:" .config
+ done
+ echo "UCLIBC_HAS_FULL_RPC=y" >> .config
+ echo "PTHREADS_DEBUG_SUPPORT=y" >> .config
+
+ #if use nls ; then
+ # sed -i -e "s:# UCLIBC_HAS_LOCALE is not set:UCLIBC_HAS_LOCALE=y:" .config
+ # echo "UCLIBC_HAS_XLOCALE=n" >> .config
+ # echo "UCLIBC_HAS_GLIBC_DIGIT_GROUPING=y" >> .config
+ # echo "UCLIBC_HAS_SCANF_LENIENT_DIGIT_GROUPING=y" >> .config
+ # # removed on 20040907 by mjn3
+ # echo "UCLIBC_HAS_GETTEXT_AWARENESS=y" >> .config
+ # # on pax enabled kernels the locale files can't be built
+ # echo "UCLIBC_PREGENERATED_LOCALE_DATA=n" >> .config
+ #fi
+ # we disable LOCALE for any case, gettext has to be used
+ echo "UCLIBC_HAS_LOCALE=n" >> .config
+
+ use ipv6 && sed -i -e "s:# UCLIBC_HAS_IPV6 is not set:UCLIBC_HAS_IPV6=y:" .config
+
+ # uncomment if you miss wordexp (alsa-lib)
+ use alsa && sed -i -e "s:# UCLIBC_HAS_WORDEXP is not set:UCLIBC_HAS_WORDEXP=y:" .config
+
+ # we need to do it independently of hardened to get ssp.c built into libc
+ sed -i -e "s:# UCLIBC_SECURITY.*:UCLIBC_SECURITY=y:" .config
+ einfo "Enable Stack Smashing Protections support in ${P}"
+ echo "UCLIBC_HAS_SSP=y:" >> .config
+ echo "PROPOLICE_BLOCK_ABRT=n" >> .config
+ if use debug ; then
+ echo "PROPOLICE_BLOCK_SEGV=y" >> .config
+ echo "PROPOLICE_BLOCK_KILL=n" >> .config
+ else
+ echo "PROPOLICE_BLOCK_SEGV=n" >> .config
+ echo "PROPOLICE_BLOCK_KILL=y" >> .config
+ fi
+
+ if use hardened ; then
+ if has $(tc-arch ${CTARGET}) mips ppc x86 ; then
+ echo "UCLIBC_BUILD_PIE=y" >> .config
+ else
+ echo "UCLIBC_BUILD_PIE=n" >> .config
+ fi
+
+ echo "UCLIBC_BUILD_SSP=y" >> .config
+ echo "UCLIBC_BUILD_RELRO=y" >> .config
+ echo "UCLIBC_BUILD_NOW=y" >> .config
+ echo "UCLIBC_BUILD_NOEXECSTACK=y" >> .config
+ else
+ echo "UCLIBC_BUILD_PIE=n" >> .config
+ echo "UCLIBC_BUILD_SSP=n" >> .config
+ echo "UCLIBC_BUILD_RELRO=n" >> .config
+ echo "UCLIBC_BUILD_NOW=n" >> .config
+ echo "UCLIBC_BUILD_NOEXECSTACK=n" >> .config
+ fi
+
+ use xattr && echo "UCLIBC_XATTR=y" >> .config
+
+ # we are building against system installed kernel headers
+ sed -i \
+ -e "s:KERNEL_SOURCE.*:KERNEL_SOURCE=\"$(alt_prefix)\":" \
+ -e "s:SHARED_LIB_LOADER_PREFIX=.*:SHARED_LIB_LOADER_PREFIX=\"$(alt_rprefix)/$(get_libdir)\":" \
+ -e "s:DEVEL_PREFIX=.*:DEVEL_PREFIX=\"$(alt_prefix)\":" \
+ -e "s:RUNTIME_PREFIX=.*:RUNTIME_PREFIX=\"$(alt_rprefix)\":" \
+ .config
+
+ yes "" | make -s oldconfig > /dev/null || die "could not make oldconfig"
+
+ chmod +x extra/scripts/relative_path.sh
+
+ cp .config myconfig
+
+ emake clean >/dev/null || die "could not clean"
+}
+
+src_compile() {
+ # running tests require this
+ use build || addwrite /dev/ptmx
+ cp myconfig .config
+
+ #if use nls ; then
+ # # these can be built only if the build system supports locales (as of 0.9.26)
+ # emake -j1 headers
+ # cd extra/locale
+ # make clean
+ # find ./charmaps -name "*.pairs" > codesets.txt
+ # cp LOCALES locales.txt
+ # emake -j1 || die "could not make locales"
+ # cd ../..
+ #fi
+ local makeopts
+ type -p ${CTARGET}-ar && makeopts="CROSS=${CTARGET}-"
+
+ emake -j1 ${makeopts} || die "could not make"
+ [[ ${CTARGET} != ${CHOST} ]] && return 0
+
+ if [[ ${CHOST} == *-uclibc ]] ; then
+ emake -j1 ${makeopts} utils || die "could not make utils"
+ fi
+
+ if ! use build ; then
+ if ! hasq maketest $RESTRICT ; then
+ src_test
+ fi
+ fi
+}
+
+src_test() {
+ # assert test fails on pax/grsec enabled kernels - normal
+ # vfork test fails in sandbox (both glibc/uclibc)
+ cd test
+ make
+}
+
+src_install() {
+ emake PREFIX="${D}" install || die "install failed"
+
+ # remove files coming from kernel-headers
+ # scsi is uclibc's own directory since cvs 20040212
+ rm -r "${D}"$(alt_prefix)/include/{asm,linux,asm-generic}
+
+ [[ ${CTARGET} != ${CHOST} ]] && return 0
+
+ if [[ ${CHOST} == *-uclibc ]] ; then
+# rm -f "${D}"$(alt_prefix)/lib/lib*_pic.a
+# ! use static && use build && rm -f "${D}"$(alt_prefix)/lib/lib*.a
+
+ emake PREFIX="${D}" install_utils || die "install-utils failed"
+ dodir /usr/bin
+ exeinto /usr/bin
+ doexe extra/scripts/getent
+ fi
+
+ if ! use build ; then
+ dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3
+ doman debian/*.1
+ fi
+}
+
+pkg_postinst() {
+[[ ${CTARGET} != ${CHOST} ]] && return 0
+
+if [[ ${CHOST} == *-uclibc ]] ; then
+ # remove invalid symlinks if any
+ #local x=
+ #for x in TZ ld.so.conf ld.so.preload ; do
+ # [ ! -e "${ROOT}/etc/${x}" ] && rm -f ${ROOT}/etc/${x}
+ #done
+
+ if [[ ! -e ${ROOT}/etc/TZ ]] ; then
+ echo "Please remember to set your timezone in /etc/TZ."
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+
+ if [[ ! -e ${ROOT}/etc/ld.so.conf ]] ; then
+ [[ -d ${ROOT}/usr/X11R6/lib ]] \
+ && echo "/usr/X11R6/lib" > "${ROOT}"/etc/ld.so.conf \
+ || > "${ROOT}"/etc/ld.so.conf
+ fi
+
+ if [[ ${ROOT} == "/" ]] ; then
+ # update cache before reloading init
+ /sbin/ldconfig
+ # reload init ...
+ [ -x /sbin/init ] && /sbin/init U &> /dev/null
+ # add entries for alternatives (like minit)
+ fi
+#else
+#should we add the libdir on a non-uclibc based system to ld.so.conf?
+fi
+}