Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* usb_modeswitch: make tcl optional dependance

 * uclibc: 0.9.32.1 version with fixes for crossdev and sandbox. See https://bugs.gentoo.org/show_bug.cgi?id=308477

Signed-off-by: Vladimir Smirnov <civil.over@gmail.com>
  • Loading branch information...
commit ed9ee636587411a6dd2fb98fff90b499e8fa1e08 1 parent 14b9cd5
@Civil Civil authored
View
1  README
@@ -0,0 +1 @@
+Overlay with some fixed ebuilds for uclibc and other embedded systems
View
1  profiles/repo_name
@@ -0,0 +1 @@
+emg-overlay
View
121 sys-apps/usb_modeswitch/ChangeLog
@@ -0,0 +1,121 @@
+# ChangeLog for sys-apps/usb_modeswitch
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/usb_modeswitch/ChangeLog,v 1.22 2012/01/01 17:50:04 rafaelmartins Exp $
+
+*usb_modeswitch-1.2.1 (01 Jan 2012)
+
+ 01 Jan 2012; Rafael G. Martins <rafaelmartins@gentoo.org>
+ +usb_modeswitch-1.2.1.ebuild:
+ Version bump.
+
+ 04 Oct 2011; Pawel Hajdan jr <phajdan.jr@gentoo.org>
+ usb_modeswitch-1.1.9.ebuild:
+ x86 stable wrt bug #384937
+
+ 04 Oct 2011; Tony Vroon <chainsaw@gentoo.org> usb_modeswitch-1.1.9.ebuild:
+ Marked stable on AMD64 based on arch testing by Agostino "ago" Sarubbo & Ian
+ "idella4" Delaney in bug #384937.
+
+*usb_modeswitch-1.1.9 (12 Aug 2011)
+
+ 12 Aug 2011; Hanno Boeck <hanno@gentoo.org> +usb_modeswitch-1.1.9.ebuild:
+ Version bump.
+
+ 07 Aug 2011; Pawel Hajdan jr <phajdan.jr@gentoo.org>
+ usb_modeswitch-1.1.7.ebuild:
+ x86 stable wrt bug #377123
+
+ 02 Aug 2011; Markos Chandras <hwoarang@gentoo.org>
+ usb_modeswitch-1.1.7.ebuild:
+ Stable on amd64 wrt bug #377123
+
+*usb_modeswitch-1.1.8 (30 Jul 2011)
+
+ 30 Jul 2011; Rafael G. Martins <rafaelmartins@gentoo.org>
+ -usb_modeswitch-1.1.6.ebuild, +usb_modeswitch-1.1.8.ebuild:
+ Version bump (bug #376753). Removed old.
+
+*usb_modeswitch-1.1.7 (08 Mar 2011)
+
+ 08 Mar 2011; Rafael G. Martins <rafaelmartins@gentoo.org>
+ -usb_modeswitch-1.1.2.ebuild, -files/usb_modeswitch-1.1.2-makefile.diff,
+ -usb_modeswitch-1.1.3.ebuild, -usb_modeswitch-1.1.3-r1.ebuild,
+ +usb_modeswitch-1.1.7.ebuild:
+ Version bump (bug #357855) and old versions clean up.
+
+*usb_modeswitch-1.1.6 (12 Feb 2011)
+
+ 12 Feb 2011; Rafael G. Martins <rafaelmartins@gentoo.org>
+ +usb_modeswitch-1.1.6.ebuild:
+ Version bump.
+
+ 30 Jan 2011; Rafael G. Martins <rafaelmartins@gentoo.org> metadata.xml:
+ Added myself to metadata.xml
+
+ 10 Oct 2010; Pawel Hajdan jr <phajdan.jr@gentoo.org>
+ usb_modeswitch-1.1.4.ebuild:
+ x86 stable wrt bug #339880
+
+ 08 Oct 2010; Markos Chandras <hwoarang@gentoo.org>
+ usb_modeswitch-1.1.4.ebuild:
+ Stable on amd64 wrt bug #339880
+
+*usb_modeswitch-1.1.4 (02 Sep 2010)
+
+ 02 Sep 2010; Samuli Suominen <ssuominen@gentoo.org>
+ +usb_modeswitch-1.1.4.ebuild:
+ Version bump (by Agostino "ago" Sarubbo from Freenode).
+
+*usb_modeswitch-1.1.3-r1 (12 Jul 2010)
+
+ 12 Jul 2010; Samuli Suominen <ssuominen@gentoo.org>
+ +usb_modeswitch-1.1.3-r1.ebuild:
+ Revision bump for usb-modeswitch-data-20100707.
+
+*usb_modeswitch-1.1.3 (26 Jun 2010)
+
+ 26 Jun 2010; Samuli Suominen <ssuominen@gentoo.org>
+ +usb_modeswitch-1.1.3.ebuild:
+ Version bump.
+
+*usb_modeswitch-1.1.2 (14 May 2010)
+
+ 14 May 2010; Hanno Boeck <hanno@gentoo.org> +usb_modeswitch-1.1.2.ebuild,
+ +files/usb_modeswitch-1.1.2-makefile.diff:
+ Version bump, now needs usb_modeswitch-data for udev rules. Patch to
+ respect LDFLAGS and to make dodir command unneccessary.
+
+*usb_modeswitch-1.1.1 (05 Apr 2010)
+
+ 05 Apr 2010; Peter Volkov <pva@gentoo.org> +usb_modeswitch-1.1.1.ebuild:
+ Version bump.
+
+*usb_modeswitch-1.1.0 (21 Feb 2010)
+
+ 21 Feb 2010; Robin H. Johnson <robbat2@gentoo.org>
+ +usb_modeswitch-1.1.0.ebuild:
+ Version bump per bug #306133
+
+ 11 Nov 2009; Robin H. Johnson <robbat2@gentoo.org>
+ usb_modeswitch-0.9.4.ebuild, usb_modeswitch-1.0.2.ebuild:
+ Bug #282532: make sure to bring in virtual/libusb:0 so that libusb-1 is
+ not used.
+
+*usb_modeswitch-1.0.2 (27 Jun 2009)
+
+ 27 Jun 2009; Hanno Boeck <hanno@gentoo.org> +usb_modeswitch-1.0.2.ebuild:
+ Version bump.
+
+ 23 Feb 2009; Diego E. Pettenò <flameeyes@gentoo.org>
+ usb_modeswitch-0.9.4.ebuild:
+ Fix building with --as-needed and respect CPPFLAGS. Thanks to Kevin Pyle
+ in bug #248397 for the patch.
+
+*usb_modeswitch-0.9.4 (25 Aug 2008)
+
+ 25 Aug 2008; Wolfram Schlich <wschlich@gentoo.org>
+ +files/91-usb_modeswitch.rules.udev-ge-106,
+ +files/91-usb_modeswitch.rules.udev-lt-106, +metadata.xml,
+ +usb_modeswitch-0.9.4.ebuild:
+ initial import
+
View
5 sys-apps/usb_modeswitch/Manifest
@@ -0,0 +1,5 @@
+DIST usb-modeswitch-1.2.1.tar.bz2 256713 RMD160 f2d9c9baa274967c24f19ab24f93e6e6a315c1a2 SHA1 a0d27f8624a4d4dcd5b1d05652cc0830e9e3d2a9 SHA256 88a253ef86a8aeeba9e6d5b40dd8a7b6b82d166b02bf6af922bf60f370b4d6cb
+DIST usb-modeswitch-data-20111023.tar.bz2 20451 RMD160 2a186079009a3bca899dfdafbc3ae2a0a0780c5e SHA1 d43d6385bd6b6311598412e08f25e93519862a99 SHA256 5ec18220bc9b3cefac3f8ded18b9b843b11b67052a0502c02a81735779284c67
+EBUILD usb_modeswitch-1.2.1.ebuild 1160 RMD160 0b70cd8158732500bd50441b9e5258817aa71b05 SHA1 4007e86f45368bc6804c09a1c5e98d38c4b908be SHA256 2b7711517e03f55c484fcb2ff27724350207d943e2708caebb12e0ef45d240a8
+MISC ChangeLog 3908 RMD160 ecf656a7bde57aec7296102734b805221a81bb32 SHA1 95705f097f7162592f0737902d4c99f29645b538 SHA256 5303dc7820f6685ad54024ae78092a9c9d46cba2665e619c8f2d7c5c1a4aef3d
+MISC metadata.xml 239 RMD160 72cf69b05bba6d6d9747781c7fccfc8609eb860e SHA1 7e0a118ed9e8a8e8575e9d92bc4202ac061e7276 SHA256 20cbeab0e959173d18ae92cec2bd741d4002a19dd620cc38967797bf7d6d9bbc
View
8 sys-apps/usb_modeswitch/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>rafaelmartins@gentoo.org</email>
+ <name>Rafael G. Martins</name>
+</maintainer>
+</pkgmetadata>
View
42 sys-apps/usb_modeswitch/usb_modeswitch-1.2.1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/usb_modeswitch/usb_modeswitch-1.2.1.ebuild,v 1.1 2012/01/01 17:50:04 rafaelmartins Exp $
+
+EAPI="4"
+inherit multilib toolchain-funcs
+
+MY_PN="${PN/_/-}"
+MY_P="${MY_PN}-${PV}"
+DATA_VER="20111023"
+
+DESCRIPTION="USB_ModeSwitch is a tool for controlling 'flip flop' (multiple devices) USB gear like UMTS sticks"
+HOMEPAGE="http://www.draisberghof.de/usb_modeswitch/"
+SRC_URI="http://www.draisberghof.de/${PN}/${MY_P}.tar.bz2
+ http://www.draisberghof.de/${PN}/${MY_PN}-data-${DATA_VER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="tcl"
+
+DEPEND="virtual/libusb:0"
+RDEPEND="${DEPEND}
+ tcl? ( dev-lang/tcl )" # usb_modeswitch script is tcl
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ sed -i -e 's/-s //' Makefile || die 'sed failed.'
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ local udevdir="${D}/$(get_libdir)/udev"
+ emake DESTDIR="${D}" UDEVDIR="${udevdir}" install
+
+ cd ../"${MY_PN}-data-${DATA_VER}"
+ emake DESTDIR="${D}" RULESDIR="${udevdir}/rules.d" files-install db-install
+}
View
3  sys-libs/uclibc/Manifest
@@ -0,0 +1,3 @@
+AUX uclibc-0.9.32-BJA-sandbox.diff 369 RMD160 eb69d8813be34edc9e7e0714551b5e3264219d37 SHA1 761ddfd185e118873f446ad9c8d4bf3447943da9 SHA256 1d31852f9e0871a215df783416ca8fad2f3039152349478f90e953370ab4456b
+DIST uClibc-0.9.32.tar.bz2 2796416 RMD160 0d3e2acc8cd609283e331bb914abd610a0c65ec7 SHA1 f8edc4ffcd9e8d1e8ae5348b9b879f5175010e67 SHA256 23c133f788cbb55ef526793a25deeda8216e833fb93cc6fb9ab0b4b7991d8e28
+EBUILD uclibc-0.9.32.1.ebuild 11708 RMD160 59880097543699167ea611a25ac35188798814de SHA1 7522cfe3a73bba961be246d935fc6a5aafa5f5f3 SHA256 6f5426a15c6ddc5e66b5f6a02e0806582031d84f32e92f219d82a5f600d7e0d3
View
9 sys-libs/uclibc/files/uclibc-0.9.32-BJA-sandbox.diff
@@ -0,0 +1,9 @@
+--- ./libubacktrace/Makefile.in.ori 2011-07-25 19:14:19.427297221 +0200
++++ ./libubacktrace/Makefile.in 2011-07-25 19:14:34.380349907 +0200
+@@ -71,5 +71,4 @@
+ $(do_ar)
+
+ CLEAN_libubacktrace:
+- $(do_rm) $(addprefix $(libubacktrace_OUT)/*., o os oS a) \
+- $(addprefix $(libubacktrace_ARCH_OUT)/*., o os oS a)
++ $(do_rm) $(addprefix $(libubacktrace_OUT)/*., o os oS a)
View
26 sys-libs/uclibc/files/uclibc-0.9.32.1-crossdev.patch
@@ -0,0 +1,26 @@
+>From 364a3a9c576d604bed146efe0b8b33d2b81d4c64 Mon Sep 17 00:00:00 2001
+From: Jason Woodward <jason.woodward@timesys.com>
+Date: Sat, 11 Jun 2011 01:08:48 -0400
+Subject: [PATCH 1/3] Conditionalize use libgcc_eh when libubacktrace is not enabled
+
+Signed-off-by: Jason Woodward <jason.woodward@timesys.com>
+---
+ libubacktrace/Makefile.in | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/libubacktrace/Makefile.in b/libubacktrace/Makefile.in
+index f75f68b..880a8af 100644
+--- a/libubacktrace/Makefile.in
++++ b/libubacktrace/Makefile.in
+@@ -12,7 +12,7 @@ CFLAGS-libubacktrace := -DNOT_IN_libc -DIS_IN_libubacktrace $(SSP_ALL_CFLAGS)
+
+ LDFLAGS-libubacktrace.so := $(LDFLAGS) $(top_builddir)lib/libdl-$(VERSION).so
+
+-ifeq ($(CONFIG_ARM_EABI),y)
++ifeq ($(UCLIBC_HAS_BACKTRACE)$(CONFIG_ARM_EABI),yy)
+ LIBGCC += $(shell $(CC) -print-file-name=libgcc_eh.a)
+ endif
+
+--
+1.7.0.4
+
View
384 sys-libs/uclibc/uclibc-0.9.32.1.ebuild
@@ -0,0 +1,384 @@
+# Copyright 1999-2011 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.1-r1.ebuild,v 1.9 2011/04/20 18:10:38 ulm 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.32
+PATCH_VER=""
+SVN_VER=""
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc.org/"
+SRC_URI="http://uclibc.org/downloads/${MY_P}.tar.bz2"
+
+[[ -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"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~arm ~m68k ~mips ~ppc ~sh ~sparc ~x86"
+IUSE="build uclibc-compat debug hardened ssp ipv6 minimal nptl wordexp crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+RDEPEND=""
+if [[ -n $CTARGET && ${CTARGET} != ${CHOST} ]]; then
+ DEPEND=">=cross-${CTARGET}/binutils-2.21.51.0.7"
+ SLOT="${CTARGET}"
+else
+ DEPEND="virtual/os-headers app-misc/pax-utils"
+ SLOT="0"
+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 ${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() {
+ just_headers && return 0
+ has_version ${CATEGORY}/uclibc || return 0
+ [[ -n ${UCLIBC_AND_GLIBC} ]] && return 0
+ [[ ${ROOT} != "/" ]] && return 0
+ [[ ${CATEGORY} == cross-* ]] && return 0
+
+}
+
+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},_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
+}
+
+set_opt() {
+ sed -i -e "/^\# $1 is not set/d" -e "/^$1=.*/d" .config
+ echo "$1=$2" >> .config
+}
+get_opt() {
+ (
+ unset $1
+ . ${2:-"${S}"/.config}
+ echo ${!1}
+ )
+}
+
+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
+ fi
+
+ epatch "${FILESDIR}"/${PN}-0.9.32-BJA-sandbox.diff
+ epatch "${FILESDIR}"/${P}-crossdev.patch
+
+ ########## 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
+
+ ########## CONFIG SETUP ##########
+
+ make ARCH=${target} defconfig >/dev/null || die "could not config"
+
+ for def in DO{DEBUG{,_PT},ASSERTS} SUPPORT_LD_DEBUG{,_EARLY} UCLIBC_HAS_PROFILING; 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. .30 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
+ set_opt UCLIBC_HAS_LOCALE n
+ set_opt HAS_NO_THREADS n
+
+ use nptl && set_opt LINUXTHREADS_NEW y
+
+ 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
+ if has $(tc-arch) x86 || has $(tc-arch) ppc; 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 UCLIBC_BUILD_NOW y
+ use ssp && {
+ set_opt SSP_QUICK_CANARY n
+ set_opt UCLIBC_BUILD_SSP 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"
+}
+
+src_compile() {
+ cp myconfig .config
+
+ emake headers || die "make headers failed"
+ just_headers && return 0
+
+ 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"
+
+ 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
+ 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
+
+ if [[ ${CHOST} == *-uclibc* ]] ; then
+ emake DESTDIR="${D}" install_utils || die "install-utils failed"
+ dobin extra/scripts/getent
+ fi
+
+ dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3
+}
+
+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
+ [[ ${ROOT} != "/" ]] && return 0
+ # update cache before reloading init
+ /sbin/ldconfig
+ # reload init ...
+ [[ -x /sbin/telinit ]] && /sbin/telinit U &> /dev/null
+}

0 comments on commit ed9ee63

Please sign in to comment.
Something went wrong with that request. Please try again.