diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-01-12 00:50:53 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-01-12 00:50:53 +0000 |
commit | 8e320d7866bdf4a47725402f69b78c919da33ea3 (patch) | |
tree | 78180eb4f92d25f75e8c6fc4e368d9d12381c6ea | |
parent | punt old fat label stuff #77487 (Manifest recommit) (diff) | |
download | gentoo-2-8e320d7866bdf4a47725402f69b78c919da33ea3.tar.gz gentoo-2-8e320d7866bdf4a47725402f69b78c919da33ea3.tar.bz2 gentoo-2-8e320d7866bdf4a47725402f69b78c919da33ea3.zip |
import
-rw-r--r-- | sys-libs/uclibc/ChangeLog | 209 | ||||
-rw-r--r-- | sys-libs/uclibc/Manifest | 43 | ||||
-rw-r--r-- | sys-libs/uclibc/files/digest-uclibc-0.9.26-r8 | 3 | ||||
-rwxr-xr-x | sys-libs/uclibc/files/getent | 48 | ||||
-rw-r--r-- | sys-libs/uclibc/metadata.xml | 22 | ||||
-rw-r--r-- | sys-libs/uclibc/uclibc-0.9.26-r8.ebuild | 308 |
6 files changed, 633 insertions, 0 deletions
diff --git a/sys-libs/uclibc/ChangeLog b/sys-libs/uclibc/ChangeLog new file mode 100644 index 000000000000..27741de2c29f --- /dev/null +++ b/sys-libs/uclibc/ChangeLog @@ -0,0 +1,209 @@ +# 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. diff --git a/sys-libs/uclibc/Manifest b/sys-libs/uclibc/Manifest new file mode 100644 index 000000000000..92f811f7ffd9 --- /dev/null +++ b/sys-libs/uclibc/Manifest @@ -0,0 +1,43 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +MD5 1265061fc51e9b3db8020c13f2e25a76 ChangeLog 8165 +MD5 e96b4dfc373a1cdf7735aeae52c4cf7e metadata.xml 999 +MD5 965ff7a705ad0a3133b02c98f8100e92 uclibc-0.9.21.ebuild 1097 +MD5 17ba3d0e6436718dafb750dade5d0869 uclibc-0.9.26-r5.ebuild 7658 +MD5 64742403e39911df25935b6099d30043 uclibc-0.9.26-r7.ebuild 7862 +MD5 c2b3545d487eac266e731aee91620602 uclibc-0.9.26-r8.ebuild 9426 +MD5 14f021d1cfb0e76ce684b8eefba1adfc uclibc-9999.ebuild 5442 +MD5 d16f404e56abc9f0ab5c372b88a6905d files/Makefile-cp-order-fix.patch 897 +MD5 799adc7fb6ec9ffd653831cea1d32dd5 files/digest-uclibc-0.9.21 67 +MD5 0b733285f186f31c1be9ffcc42f1064e files/getent 973 +MD5 e0556dd58957468793213ab327c590d3 files/digest-uclibc-0.9.26-r8 232 +MD5 6d2b5c523d34c86df9bc37747d9261dc files/digest-uclibc-0.9.26-r5 231 +MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-uclibc-9999 0 +MD5 6d2b5c523d34c86df9bc37747d9261dc files/digest-uclibc-0.9.26-r7 231 +MD5 17ecd222df47b5253f35787097440a5a files/0.9.23/uClibc-0.9.23-etdyn.patch 5832 +MD5 298b7b42f80e1f8ae395df81c47eb213 files/0.9.23/uClibc-0.9.23-flipturn.patch 1821 +MD5 4216cdf86d54f45fa04cb44a5425b3ff files/0.9.23/uClibc-0.9.23-pax.patch 3607 +MD5 7eea15a7a3e8d8a2a222b815e57dc221 files/cvs/13_all_uClibc-enable-ssp.patch 331 +MD5 9cb04f6f038b903868f99d90f81e7e61 files/cvs/21_all_uClibc-ld-relro.patch 1040 +MD5 df59fcf3a02c17b7dac6999bd9262d05 files/cvs/22_all_uClibc-ld-now.patch 1072 +MD5 46d965d8bdfe981f75fb8696799d9d2a files/0.9.26/ssp.c 3937 +MD5 2416f5e954ccb8b39b1c0d6a3cf5e827 files/0.9.26/uClibc-0.9.26-Makefile.patch 1478 +MD5 bdd1e91ee48fb8be0d28cabdfcfdf3ff files/0.9.26/uClibc-0.9.26-pie-option.patch 863 +MD5 49671ccbdf2c8055efc6cde0003cb6c5 files/0.9.26/arm-fix-missing-syscalls.patch 2264 +MD5 874260fc77637deccf7588cfc1c76674 files/0.9.26/uClibc-20040613-do_rem.patch 391 +MD5 b9df87c681aa3a1ef3033cb195e516df files/0.9.26/uclibc-0.9.26-arm-dl-sysdep.patch 795 +MD5 d35beaf332590fed8c619483d4598dc6 files/0.9.26/uclibc-0.9.26-ssp-gcc34-after-frandom.patch 542 +MD5 f7c264d37687f1a32f1c6e31239f2276 files/0.9.26/uclibc-0.9.26-noexecstack.patch 15273 +MD5 6835449424e7a8a38e9c85ecf1b73577 files/0.9.26/arm-ucontext.patch 303 +MD5 efd96414f3be520f07eabd1c02be1ecb files/0.9.26/uclibc-0.9.26-resolve-segfault.patch 1227 +MD5 7157f784ba7672c9904d289712131a52 files/0.9.26/uclibc-0.9.26-ldso-cache.patch 410 +MD5 7ff9f1e05cdfbbe0e156ea81bf8b55ee files/0.9.26/uClibc-20040921-ldso-unsecvars.patch 1024 +MD5 a503ef49001f5f67d61cd40b0809fb76 files/0.9.26/unsecvars.h 682 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.9.14 (GNU/Linux) + +iD8DBQFB43AqroRuSHgZdywRAkz9AJ97qifC1HRxNe2/sx7W47TTP1ViMwCfTmlR +PzPgsUYl+C5wwvRlsF7Hiro= +=S87t +-----END PGP SIGNATURE----- diff --git a/sys-libs/uclibc/files/digest-uclibc-0.9.26-r8 b/sys-libs/uclibc/files/digest-uclibc-0.9.26-r8 new file mode 100644 index 000000000000..d630ae20babd --- /dev/null +++ b/sys-libs/uclibc/files/digest-uclibc-0.9.26-r8 @@ -0,0 +1,3 @@ +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 diff --git a/sys-libs/uclibc/files/getent b/sys-libs/uclibc/files/getent new file mode 100755 index 000000000000..5617cb0c6e0f --- /dev/null +++ b/sys-libs/uclibc/files/getent @@ -0,0 +1,48 @@ +#!/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 diff --git a/sys-libs/uclibc/metadata.xml b/sys-libs/uclibc/metadata.xml new file mode 100644 index 000000000000..0d08e066b126 --- /dev/null +++ b/sys-libs/uclibc/metadata.xml @@ -0,0 +1,22 @@ +<?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> diff --git a/sys-libs/uclibc/uclibc-0.9.26-r8.ebuild b/sys-libs/uclibc/uclibc-0.9.26-r8.ebuild new file mode 100644 index 000000000000..61017c88c57c --- /dev/null +++ b/sys-libs/uclibc/uclibc-0.9.26-r8.ebuild @@ -0,0 +1,308 @@ +# 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 +} |