summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs/uclibc')
-rw-r--r--sys-libs/uclibc/ChangeLog8
-rw-r--r--sys-libs/uclibc/Manifest15
-rw-r--r--sys-libs/uclibc/uclibc-0.9.30_rc1.ebuild471
3 files changed, 482 insertions, 12 deletions
diff --git a/sys-libs/uclibc/ChangeLog b/sys-libs/uclibc/ChangeLog
index 8d2dfaaf0f09..e27f055fa254 100644
--- a/sys-libs/uclibc/ChangeLog
+++ b/sys-libs/uclibc/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-libs/uclibc
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.36 2008/08/23 03:32:16 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.37 2008/09/23 21:30:52 solar Exp $
+
+*uclibc-0.9.30_rc1 (23 Sep 2008)
+
+ 23 Sep 2008; <solar@gentoo.org> +uclibc-0.9.30_rc1.ebuild:
+ - Initial import of 0.9.30_rc1 branch for gentoo testing/QA before final the
+ release. (many thanks to torindel for helping out with this)
23 Aug 2008; Doug Goldstein <cardoe@gentoo.org> metadata.xml:
add GLEP 56 USE flag desc from use.local.desc
diff --git a/sys-libs/uclibc/Manifest b/sys-libs/uclibc/Manifest
index c141e47a8c0b..891f9726d86d 100644
--- a/sys-libs/uclibc/Manifest
+++ b/sys-libs/uclibc/Manifest
@@ -1,6 +1,3 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
DIST uClibc-0.9.27-cvs-update-20050114.patch.bz2 839 RMD160 08439855b6dc481216132d3882b8f634ecbe4555 SHA1 0e1a400745f0cbd739c6c08f45951eea836b1102 SHA256 83b86570ed0f0109f2ff04e753daf18a9bf59eab5b01b8d04a2406bb4100c423
DIST uClibc-0.9.27-patches-1.6.tar.bz2 24001 RMD160 eca81853e00e5144c165b2eb4733059d53f93234 SHA1 93beb60660145c1b661c577f1e89a7217841c0c9 SHA256 78ff8162423b5563b1a97ae5294ab1e919b9489e171962053da54c04ee127797
DIST uClibc-0.9.27.tar.bz2 1693895 RMD160 4c580c0c468bcd7e77a6b4223847f17b6ad241cc SHA1 e0de53949998253e25e6b946b564062babb723b4 SHA256 d43098b9d1cac5cc983672f885d82b59459c3abcb12ef8141653581c77cd0d9c
@@ -9,18 +6,14 @@ DIST uClibc-0.9.28.3-patches-1.3.tar.bz2 21241 RMD160 c78dda0bdbc751721559d91bdd
DIST uClibc-0.9.28.3-patches-1.7.tar.bz2 22796 RMD160 73c13613f93115533b5b2065ab65ef8d18cf67a2 SHA1 8f072be977039725a080438ce13e8ed7e23337e5 SHA256 936f744539787ee0537ca733efbee6323cb48ad9e11d52aba2971e6cfe89b915
DIST uClibc-0.9.28.3-patches-1.8.tar.bz2 27909 RMD160 7c936749075162939c76489aa5a88278f235b48f SHA1 5bb582cb8f95407bd9fa938a9dd09027dcf0db0b SHA256 9496394de9de241551497c496b7fb8ece32b23536485bd81bd20128c2e104790
DIST uClibc-0.9.28.3.tar.bz2 1795383 RMD160 61591281f4193d4dcd0fa3252fb3286028d4cb63 SHA1 77c5220697a1772d0d9da4bda0d866e4f4b68540 SHA256 1d86d5dad6060e7057cfe023ffc7b7661bdc7fe95112b37447851c0a75b547a1
+DIST uClibc-0.9.30-rc1-patches-0.1.tar.bz2 15953 RMD160 f23788f547924f69ed0a0cb962ee721e8413610c SHA1 de5f5263605aa3187214508e3c24e3d4e35a0cbc SHA256 5e3cabc7f51a0bc4feb6ef9803b62e77e419461718c81a07877f19a5610bced9
+DIST uClibc-0.9.30-rc1.tar.bz2 2304763 RMD160 e4503b4df92e6849966ad6822860a0bf1dd854df SHA1 2249f6cb1f561417daed8fa6d58d7c4be8f786d7 SHA256 494ce5d3c0ae09eaf17fccc7954e3698a8347d13d7d1c290a85618a40e82c779
DIST uClibc-locale-030818.tgz 236073 RMD160 8e3f4b20b94e07e535cbbbe81287186014c5f151 SHA1 78f901e6ed228ed84106bd034c1b97eee1eecb50 SHA256 c4362be318a38f18d98dccf462d22d95bab92f05548bb93f65298fe9afaebd57
EBUILD uclibc-0.9.27-r1.ebuild 12343 RMD160 fc942541ccf1a6f0213005b4936456705bf89bbb SHA1 fe4072f852dfa9ac1cd14af58eb73fe6bc926098 SHA256 6201d1cd508883a5bc614be83169439b9e7865ab144489cf822a37f7929376fe
EBUILD uclibc-0.9.28.3-r3.ebuild 14479 RMD160 8c98d256d1cb59dc47feb1b32903e83639323ff7 SHA1 a084eb0fa2a32c0aeb625693a2617f4ec97ce733 SHA256 90453171437194b2af4dc420628069856eaf26d59063d74e0bfc6863299c1293
EBUILD uclibc-0.9.28.3-r6.ebuild 14482 RMD160 e3b0b96cc63a8072bae29d285d1c196425f67dd0 SHA1 fdf655357b0f8e5d73b796acf2e653f1e006150c SHA256 e777ff6a3f19e6a0e2d00dd20e07d14a428be3d0bde412b3fb7975ca113a63a7
EBUILD uclibc-0.9.28.3-r7.ebuild 14482 RMD160 052a487bc9bd7089bf89140ff463aaf05a787b27 SHA1 74487eec2a54f4ecd51b111c2c985b00cdbf31a4 SHA256 9169228e774caae1e67f797014a4a9be2dae967827453c7072457cdefa56455d
EBUILD uclibc-0.9.28.3.ebuild 14473 RMD160 89e8993f578da9f77cf4b9b320ff0221672ff078 SHA1 6dc607dc6d665bb015deeb325efa3c2a207db09b SHA256 7e5ea21ddfd6943b3f934e917b6808c758644eb02bd84e0a55224ac8ed4e3ff6
-MISC ChangeLog 13827 RMD160 2af879617909ef415360ba334f1e7c731990a635 SHA1 fceac6f34caf7ce55bc800067c8dee332eeb69cc SHA256 51958961138acd7e20641f1e510670f3e482189909bbbe2b0ee6619921bbb4ed
+EBUILD uclibc-0.9.30_rc1.ebuild 14429 RMD160 ab4c6b96263a12503ff195f015f47ff3f6d0a67c SHA1 bebdb8a592db0dadb38925ae7358e7c04690c089 SHA256 86e1c44404f94a3a36ee46560ffc28f6003fef84a13df2f4926f4057f51a6546
+MISC ChangeLog 14064 RMD160 c5d31dc25a4bf3e0dabaa13eb1dc87266fc91330 SHA1 9929143f9be018b17a45d32f8a9da913f41f70d6 SHA256 297923e9259d9dc9a027ad3e576e5e22a8f76e1f010a2f1698a8e4997b75c55c
MISC metadata.xml 1382 RMD160 aec15535239f8395eb53ba3f0d1730f9e02693e3 SHA1 1ade2f09631f7c0bfe424dc775f6787928e21e5a SHA256 503af91d433a322b80e8ed4c9c1606c7be47dd5feecd46a07fd57eb5e5a3813f
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.9 (GNU/Linux)
-
-iEYEARECAAYFAkivhMUACgkQoeSe8B0zEfx2FwCeMG+g7P84k1ifIdhnvKpMSJik
-3cMAoIrvoWeTJ5A3+VdLiHpeaBSGUBgD
-=Mown
------END PGP SIGNATURE-----
diff --git a/sys-libs/uclibc/uclibc-0.9.30_rc1.ebuild b/sys-libs/uclibc/uclibc-0.9.30_rc1.ebuild
new file mode 100644
index 000000000000..72faec77c620
--- /dev/null
+++ b/sys-libs/uclibc/uclibc-0.9.30_rc1.ebuild
@@ -0,0 +1,471 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.30_rc1.ebuild,v 1.1 2008/09/23 21:30:52 solar Exp $
+
+#ESVN_REPO_URI="svn://uclibc.org/trunk/uClibc"
+#inherit subversion
+inherit eutils flag-o-matic toolchain-funcs savedconfig
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
+ export CTARGET=${CATEGORY/cross-}
+ fi
+fi
+# Handle the case where we want uclibc on glibc ...
+if [[ ${CTARGET} == ${CHOST} ]] && [[ ${CHOST} != *-uclibc* ]] ; then
+ export UCLIBC_AND_GLIBC="sitting in a tree"
+ export CTARGET=${CHOST%%-*}-pc-linux-uclibc
+fi
+
+MY_P=uClibc-0.9.30-rc1
+SVN_VER=""
+PATCH_VER="0.1"
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc.org/"
+SRC_URI="http://uclibc.org/downloads/${MY_P}.tar.bz2
+ iconv? ( !userlocales? ( pregen? ( http://www.uclibc.org/downloads/uClibc-locale-030818.tgz
+ ) ) )"
+[[ -z ${SVN_VER} ]] || \
+ SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-svn-update-${SVN_VER}.patch.bz2"
+[[ -z ${PATCH_VER} ]] || \
+ SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2"
+
+LICENSE="LGPL-2"
+[[ ${CTARGET} != ${CHOST} ]] \
+ && SLOT="${CTARGET}" \
+ || SLOT="0"
+KEYWORDS="-* ~arm ~m68k -mips ~ppc ~sh ~sparc ~x86 ~amd64"
+IUSE="build uclibc-compat debug hardened iconv ipv6 minimal nls pregen userlocales wordexp crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+RDEPEND=""
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ DEPEND="virtual/os-headers app-misc/pax-utils"
+ PROVIDE="virtual/libc"
+else
+ DEPEND=""
+fi
+
+S=${WORKDIR}/${MY_P}
+
+alt_build_kprefix() {
+ if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] \
+ || [[ -n ${UCLIBC_AND_GLIBC} ]]
+ then
+ echo /usr/include
+ else
+ echo /usr/${CTARGET}/usr/include
+ fi
+}
+just_headers() {
+ use crosscompile_opts_headers-only && [[ ${CHOST} != ${CTARGET} ]]
+}
+
+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) "${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() {
+ just_headers && return 0
+ has_version ${CATEGORY}/uclibc || return 0
+ [[ -n ${UCLIBC_AND_GLIBC} ]] && return 0
+ [[ ${ROOT} != "/" ]] && return 0
+ [[ ${CATEGORY} == cross-* ]] && return 0
+
+ if use iconv ; then
+ eerror "iconv - bad idea"
+ fi
+ if use nls ; then
+ eerror "nls - even worse idea"
+ fi
+ if use pregen || use userlocales ; then
+ eerror "pregen, userlocales - meaningless without nls"
+ fi
+ if use iconv || use nls || use pregen || use userlocales ; then
+ eerror "compile without nls/gettext support"
+ fi
+ if ! built_with_use --missing false ${CATEGORY}/uclibc nls && use nls && ! use pregen ; then
+ eerror "You previously built uclibc with USE=-nls."
+ eerror "You cannot generate locale data with this"
+ eerror "system. Please rerun emerge with USE=pregen."
+ die "host cannot support locales"
+ elif built_with_use --missing false ${CATEGORY}/uclibc nls && ! use nls ; then
+ eerror "You previously built uclibc with USE=nls."
+ eerror "Rebuilding uClibc with USE=-nls will prob"
+ eerror "destroy your system."
+# die "switching from nls is baaaad"
+ fi
+}
+
+PIE_STABLE="arm mips ppc x86"
+
+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}}"
+CPU_IA64=""
+CPU_M68K=""
+CPU_MIPS="MIPS_ISA_{1,2,3,4,MIPS{32,64}} MIPS_{N64,O32,N32}_ABI"
+CPU_PPC=""
+CPU_SH="SH{2,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
+}
+
+set_opt() {
+ sed -i -e "/^\# $1 is not set/d" -e "/^$1=.*/d" .config
+ echo "$1=$2" >> .config
+}
+
+src_unpack() {
+ [[ -n ${ESVN_REPO_URI} ]] \
+ && subversion_src_unpack \
+ || unpack ${A}
+ cd "${S}"
+
+ 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
+
+ ########## PATCHES ##########
+
+ [[ -n ${SVN_VER} ]] && \
+ epatch "${WORKDIR}"/${MY_P}-cvs-update-${SVN_VER}.patch
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ unpack ${MY_P}-patches-${PATCH_VER}.tar.bz2
+ EPATCH_SUFFIX="patch"
+ epatch "${WORKDIR}"/patch
+ # math functions (sinf,cosf,tanf,atan2f,powf,fabsf,copysignf,scalbnf,rem_pio2f)
+ cp "${WORKDIR}"/patch/math/libm/* "${S}"/libm/ || die
+ epatch "${WORKDIR}"/patch/math
+ fi
+
+ if [[ -d "${FILESDIR}"/patches-${PV} ]] ; then
+ EPATCH_SUFFIX="patch"
+ epatch "${FILESDIR}"/patches-${PV}
+ if [[ -d "${FILESDIR}"/patches-${PV}/math/libm ]] ; then
+ # math functions (sinf,cosf,tanf,atan2f,powf,fabsf,copysignf,scalbnf,rem_pio2f)
+ cp "${FILESDIR}"/patches-${PV}/math/libm/* "${S}"/libm/ || die
+ epatch "${FILESDIR}"/patches-${PV}/math
+ fi
+ fi
+
+ ########## 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";;
+ 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
+
+ ########## CONFIG SETUP ##########
+
+ make ARCH=${target} defconfig >/dev/null || die "could not config"
+
+ for def in DO{DEBUG{,_PT},ASSERTS} SUPPORT_LD_DEBUG{,_EARLY} ; do
+ sed -i -e "s:${def}=y:# ${def} is not set:" .config
+ done
+ if use debug ; then
+ set_opt SUPPORT_LD_DEBUG y
+ set_opt DODEBUG y
+ fi
+
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config
+ set_opt "ARCH_WANTS_$(uclibc_endian | tr [a-z] [A-Z])_ENDIAN" y
+
+ if [[ $(tc-is-softfloat) != "no" ]] ; then
+ set_opt UCLIBC_HAS_FPU n
+ fi
+
+ if [[ ${CTARGET/eabi} != ${CTARGET} ]] ; then
+ set_opt CONFIG_ARM_OABI n
+ set_opt CONFIG_ARM_EABI y
+ fi
+
+ local moredefs="COMPAT_ATEXIT"
+ local compat_sym=atexit
+
+ # We need todo this for a few months. .29 is a major upgrade.
+ # Don't do it from cross-compiling case though
+ if ! use uclibc-compat ; then
+ if [[ -z ${UCLIBC_AND_GLIBC} ]] && [[ -z ${UCLIBC_SCANNED_COMPAT} ]] && \
+ ! just_headers && [[ ${CHOST} == ${CTARGET} ]] ; then
+ local fnames=""
+ einfo "Doing a scanelf in paths for bins containing the ${compat_sym} symbol"
+ fnames=$(scanelf -pyqs${compat_sym} -F%F#s)
+ if [[ -z ${fnames} ]] ; then
+ einfo "This system is clean."
+ einfo "To prevent the scanning of files again in the future you can export UCLIBC_SCANNED_COMPAT=1"
+ moredefs=""
+ else
+ ewarn "You need to remerge the packages that contain the following files before you can remerge ${P} without USE=uclibc-compat enabled."
+ ewarn "qfile -Cq $(echo ${fnames}) | sort | uniq"
+ echo
+ ewarn "Leaving on ${moredefs}"
+ fi
+ else
+ moredefs=""
+ fi
+ fi
+ for def in ${moredefs} MALLOC_GLIBC_COMPAT DO_C99_MATH UCLIBC_HAS_{RPC,FULL_RPC,CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC,FTW} UCLIBC_HAS_REENTRANT_RPC UCLIBC_HAS_GNU_GLOB PTHREADS_DEBUG_SUPPORT UCLIBC_HAS_TZ_FILE_READ_MANY UCLIBC_HAS_FENV UCLIBC_SUSV3_LEGACY UCLIBC_SUSV3_LEGACY_MACROS UCLIBC_HAS_PROGRAM_INVOCATION_NAME ; do
+ set_opt "${def}" y
+ done
+ set_opt UCLIBC_HAS_CTYPE_UNSAFE n
+
+ if use iconv ; then
+ set_opt UCLIBC_HAS_LOCALE y
+ set_opt UCLIBC_HAS_XLOCALE n
+ set_opt UCLIBC_HAS_GLIBC_DIGIT_GROUPING y
+ set_opt UCLIBC_HAS_SCANF_LENIENT_DIGIT_GROUPING y
+
+ if use nls ; then
+ set_opt UCLIBC_HAS_GETTEXT_AWARENESS y
+ set_opt UCLIBC_MJN3_ONLY y
+ else
+ set_opt UCLIBC_HAS_GETTEXT_AWARENESS n
+ fi
+
+ if use pregen ; then
+ set_opt UCLIBC_PREGENERATED_LOCALE_DATA y
+ set_opt UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA y
+ if use userlocales ; then
+ cp "${DISTDIR}"/${MY_P}-user-locale.tar.gz \
+ extra/locale/uClibc-locale-030818.tgz \
+ || die "could not copy ${MY_P}-user-locale.tar.gz"
+ else
+ cp "${DISTDIR}"/uClibc-locale-030818.tgz \
+ extra/locale/uClibc-locale-030818.tgz \
+ || die "could not copy locale"
+ fi
+ else
+ set_opt UCLIBC_PREGENERATED_LOCALE_DATA n
+ fi
+ else
+ set_opt UCLIBC_HAS_LOCALE n
+ fi
+
+ use ipv6 && set_opt UCLIBC_HAS_IPV6 y
+
+ use wordexp && set_opt UCLIBC_HAS_WORDEXP y
+
+ # we need to do it independently of hardened to get ssp.c built into libc
+ set_opt UCLIBC_HAS_SSP y
+ set_opt UCLIBC_HAS_SSP_COMPAT y
+ set_opt UCLIBC_HAS_ARC4RANDOM y
+ set_opt PROPOLICE_BLOCK_ABRT n
+ set_opt PROPOLICE_BLOCK_SEGV y
+
+ # 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
+ # relro could be also moved out of hardened
+ if has $(tc-arch) x86 ; then
+ set_opt UCLIBC_BUILD_NOEXECSTACK y
+ else
+ set_opt UCLIBC_BUILD_NOEXECSTACK n
+ fi
+ set_opt UCLIBC_BUILD_RELRO y
+ if use hardened ; then
+ if has $(tc-arch) ${PIE_STABLE} ; then
+ set_opt UCLIBC_BUILD_PIE y
+ else
+ set_opt UCLIBC_BUILD_PIE n
+ fi
+ set_opt SSP_QUICK_CANARY n
+ set_opt UCLIBC_BUILD_SSP y
+ set_opt UCLIBC_BUILD_NOW y
+ else
+ set_opt UCLIBC_BUILD_PIE n
+ set_opt SSP_QUICK_CANARY y
+ set_opt UCLIBC_BUILD_SSP n
+ set_opt UCLIBC_BUILD_NOW n
+ fi
+
+ restore_config .config
+
+ # setup build and run paths
+ local cross=${CTARGET}-
+ type -p ${cross}ar > /dev/null || cross=""
+ sed -i \
+ -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${cross}\":" \
+ -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
+
+ yes "" 2> /dev/null | make -s oldconfig > /dev/null || die "could not make oldconfig"
+
+ cp .config myconfig
+
+ emake -s clean > /dev/null || die "could not clean"
+}
+
+setup_locales() {
+ cd "${S}"/extra/locale
+ if use userlocales && [[ -f ${ROOT}/etc/locales.build ]] ; then
+ :;
+ elif use minimal ; then
+ find ./charmaps -name ASCII.pairs > codesets.txt
+ find ./charmaps -name ISO-8859-1.pairs >> codesets.txt
+ cat <<-EOF > locales.txt
+ @euro e
+ UTF-8 yes
+ 8-bit yes
+ en_US ISO-8859-1
+ en_US.UTF-8 UTF-8
+ EOF
+ else
+ find ./charmaps -name '*.pairs' > codesets.txt
+ cp LOCALES locales.txt
+ fi
+ cd -
+}
+
+src_compile() {
+ cp myconfig .config
+
+ emake headers || die "make headers failed"
+ just_headers && return 0
+
+ if use iconv && ! use pregen ; then
+ cd extra/locale
+ make clean || die "make locale clean failed"
+ setup_locales
+ emake || die "make locales failed"
+ cd ../..
+ fi
+
+ emake || die "make failed"
+ if [[ ${CTARGET} != ${CHOST} ]] ; then
+ emake -C utils hostutils || die "make hostutils failed"
+ elif [[ ${CHOST} == *-uclibc* ]] ; then
+ emake utils || die "make utils failed"
+ fi
+}
+
+src_test() {
+ [[ ${CHOST} != ${CTARGET} ]] && return 0
+ [[ ${CBUILD} != ${CHOST} ]] && return 0
+
+ # assert test fails on pax/grsec enabled kernels - normal
+ # vfork test fails in sandbox (both glibc/uclibc)
+ make UCLIBC_ONLY=1 check || die "test failed"
+}
+
+src_install() {
+ local sysroot=${D}
+ [[ ${CHOST} != ${CTARGET} ]] && sysroot="${sysroot}/usr/${CTARGET}"
+
+ local target="install"
+ just_headers && target="install_headers"
+ emake DESTDIR="${sysroot}" ${target} || die "install failed"
+
+ just_headers && return 0
+
+ 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 [[ ${CTARGET} != ${CHOST} ]] ; then
+ dosym usr/include /usr/${CTARGET}/sys-include
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig || die
+ newbin utils/ldd.host ${CTARGET}-ldd || die
+ return 0
+ fi
+
+ if [[ ${CHOST} == *-uclibc* ]] ; then
+ make DESTDIR="${D}" install_utils || die "install-utils failed"
+ dobin extra/scripts/getent
+ fi
+
+ if ! use build ; then
+ dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3
+ doman docs/man/*.[1-9]
+ fi
+}
+
+pkg_postinst() {
+ [[ ${CTARGET} != ${CHOST} ]] && return 0
+ [[ ${CHOST} != *-uclibc* ]] && return 0
+
+ if [[ ! -e ${ROOT}/etc/TZ ]] ; then
+ ewarn "Please remember to set your timezone in /etc/TZ"
+ [[ ! -d ${ROOT}/etc ]] && mkdir -p "${ROOT}"/etc
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+
+ if [[ ${ROOT} == "/" ]] ; then
+ # update cache before reloading init
+ /sbin/ldconfig
+ # reload init ...
+ [[ -x /sbin/telinit ]] && /sbin/telinit U &> /dev/null
+ fi
+}