diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2006-07-07 13:34:05 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2006-07-07 13:34:05 +0000 |
commit | 187d5302882b23e3373ec13f9c1dbea5e653f404 (patch) | |
tree | 195bfc779b20b84e28f948d299d73d31130edc3e /dev-libs | |
parent | stabilize (diff) | |
download | gentoo-2-187d5302882b23e3373ec13f9c1dbea5e653f404.tar.gz gentoo-2-187d5302882b23e3373ec13f9c1dbea5e653f404.tar.bz2 gentoo-2-187d5302882b23e3373ec13f9c1dbea5e653f404.zip |
Fix building with KBUILD_OUTPUT set, bug #139330. Also fix manpage
installation path, bug #122173. Also multilib related fixes.
(Portage version: 2.1.1_pre2-r4)
Diffstat (limited to 'dev-libs')
-rw-r--r-- | dev-libs/klibc/ChangeLog | 9 | ||||
-rw-r--r-- | dev-libs/klibc/files/digest-klibc-1.2.1-r2 | 3 | ||||
-rw-r--r-- | dev-libs/klibc/files/klibc-1.2.4-kbuild.patch | 14 | ||||
-rw-r--r-- | dev-libs/klibc/klibc-1.2.1-r2.ebuild | 195 |
4 files changed, 220 insertions, 1 deletions
diff --git a/dev-libs/klibc/ChangeLog b/dev-libs/klibc/ChangeLog index eefbd1836cea..b5c74887d029 100644 --- a/dev-libs/klibc/ChangeLog +++ b/dev-libs/klibc/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for dev-libs/klibc # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/ChangeLog,v 1.23 2006/07/01 10:26:27 pylon Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/ChangeLog,v 1.24 2006/07/07 13:34:05 azarah Exp $ + +*klibc-1.2.1-r2 (07 Jul 2006) + + 07 Jul 2006; Martin Schlemmer <azarah@gentoo.org> + +files/klibc-1.2.4-kbuild.patch, +klibc-1.2.1-r2.ebuild: + Fix building with KBUILD_OUTPUT set, bug #139330. Also fix manpage + installation path, bug #122173. Also multilib related fixes. 01 Jul 2006; Lars Weiler <pylon@gentoo.org> klibc-1.2.1-r1.ebuild: Stable on ppc; bug #130175. diff --git a/dev-libs/klibc/files/digest-klibc-1.2.1-r2 b/dev-libs/klibc/files/digest-klibc-1.2.1-r2 new file mode 100644 index 000000000000..b6bfd214458f --- /dev/null +++ b/dev-libs/klibc/files/digest-klibc-1.2.1-r2 @@ -0,0 +1,3 @@ +MD5 d5ce19f5df32e7f4f5bbb4562d0573be klibc-1.2.1.tar.bz2 451620 +RMD160 d0ea3418622c008884c0efb6dee693aa03eca90d klibc-1.2.1.tar.bz2 451620 +SHA256 c413b565ea6bd33d4f0af5ee3319d9bc1d804e5cb859b9f3284cad2c449d7c5c klibc-1.2.1.tar.bz2 451620 diff --git a/dev-libs/klibc/files/klibc-1.2.4-kbuild.patch b/dev-libs/klibc/files/klibc-1.2.4-kbuild.patch new file mode 100644 index 000000000000..431247a989b3 --- /dev/null +++ b/dev-libs/klibc/files/klibc-1.2.4-kbuild.patch @@ -0,0 +1,14 @@ +diff -Naurp klibc-1.2.4-orig/scripts/Makefile.host klibc-1.2.4/scripts/Makefile.host +--- klibc-1.2.4-orig/scripts/Makefile.host 2006-03-12 01:04:15.000000000 +0100 ++++ klibc-1.2.4/scripts/Makefile.host 2006-03-12 01:17:08.000000000 +0100 +@@ -85,8 +85,8 @@ ifeq ($(KBUILD_SRC),) + __hostc_flags = $(_hostc_flags) + __hostcxx_flags = $(_hostcxx_flags) + else +-__hostc_flags = -I$(obj) $(call flags,_hostc_flags) +-__hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags) ++__hostc_flags = -I$(obj) $(_hostc_flags) ++__hostcxx_flags = -I$(obj) $(_hostcxx_flags) + endif + + hostc_flags = -Wp,-MD,$(depfile) $(__hostc_flags) diff --git a/dev-libs/klibc/klibc-1.2.1-r2.ebuild b/dev-libs/klibc/klibc-1.2.1-r2.ebuild new file mode 100644 index 000000000000..89fab32a4dcd --- /dev/null +++ b/dev-libs/klibc/klibc-1.2.1-r2.ebuild @@ -0,0 +1,195 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/klibc-1.2.1-r2.ebuild,v 1.1 2006/07/07 13:34:05 azarah Exp $ + +inherit eutils linux-info multilib + +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} == ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi + +DESCRIPTION="A minimal libc subset for use with initramfs." +HOMEPAGE="http://www.zytor.com/mailman/listinfo/klibc" +SRC_URI="ftp://ftp.kernel.org/pub/linux/libs/klibc/${P}.tar.bz2 + ftp://ftp.kernel.org/pub/linux/libs/klibc/Stable/${P}.tar.bz2 + ftp://ftp.kernel.org/pub/linux/libs/klibc/Testing/${P}.tar.bz2" +LICENSE="|| ( GPL-2 LGPL-2 )" +# Mips patches needs updating ... +KEYWORDS="~amd64 -mips ~ppc ~x86" +IUSE="n32" +RESTRICT="nostrip" + +DEPEND="dev-lang/perl + virtual/linux-sources" +RDEPEND="dev-lang/perl" + +if [[ ${CTARGET} != ${CHOST} ]] ; then + SLOT="${CTARGET}" +else + SLOT="0" +fi + +is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } + +guess_arch() { + local x + local host=$(echo "${CTARGET%%-*}" | sed -e 's/i.86/i386/' \ + -e 's/sun4u/sparc64/' \ + -e 's/arm.*/arm/' \ + -e 's/sa110/arm/' \ + -e 's/powerpc/ppc/') + + # Sort reverse so that we will get ppc64 before ppc, etc + for x in $(ls -1 "${S}/include/arch/" | sort -r) ; do + if [[ ${host} == "${x}" ]] ; then + echo "${x}" + return 0 + fi + done + + return 1 +} + +pkg_setup() { + # Make sure kernel sources are OK + # (Override for linux-mod eclass) + check_kernel_built +} + +src_unpack() { + unpack ${A} + + if [[ ! -d /usr/${CTARGET} ]] ; then + echo + eerror "It does not look like your cross-compiler is setup properly!" + die "It does not look like your cross-compiler is setup properly!" + fi + + if ! guess_arch &>/dev/null ; then + echo + eerror "Could not guess klibc's ARCH from your CTARGET!" + die "Could not guess klibc's ARCH from your CTARGET!" + fi + + kernel_arch=$(readlink "${KV_OUT_DIR}/include/asm" | sed -e 's:asm-::') + if [[ ${kernel_arch} != $(guess_arch) ]] ; then + echo + eerror "Your kernel sources are not configured for your chosen arch!" + eerror "(KERNEL_ARCH=\"${kernel_arch}\", ARCH=\"$(guess_arch)\")" + die "Your kernel sources are not configured for your chosen arch!" + fi + + cd ${S} + + # Add our linux source tree symlink + ln -snf ${KV_DIR} linux + + # We do not want all the nice prelink warnings + # NOTE: for amd64, we might change below to '/usr/$(get_libdir)/klibc', + # but I do not do it right now, as the build system do not support + # the lib64 yet .... + cat > "${S}/70klibc" <<-EOF + PRELINK_PATH_MASK="/usr/lib/klibc" + EOF + + # Export the NOSTDINC_FLAGS to ensure -nostdlib is passed, bug #120678 + epatch ${FILESDIR}/${P}-nostdinc-flags.patch + + # Fix building when KBUILD_OUTPUT is set, bug #122173. + epatch "${FILESDIR}/${PN}-1.2.4-kbuild.patch" + + # klibc detects mips64 systems as having 64bit userland + # Force them to 32bit userlands instead +# if ! use n32; then +# epatch ${FILESDIR}/${PN}-1.1.16-mips32.patch +# fi + + # Linker path is awry +# epatch ${FILESDIR}/${PN}-1.1.16-mips-ldpaths.patch +} + +src_compile() { + local myargs + + [[ ${KV_DIR} != "${KV_OUT_DIR}" ]] && \ + myargs="KLIBCKERNELOBJ='${KV_OUT_DIR}/' KBUILD_SRC='1'" + + if is_cross ; then + einfo "ARCH = \"$(guess_arch)\"" + einfo "CROSS = \"${CTARGET}-\"" + emake ARCH=$(guess_arch) \ + CROSS="${CTARGET}-" \ + libdir="/usr/$(get_libdir)" \ + SHLIBDIR="/$(get_libdir)" \ + mandir="/usr/share/man" \ + INSTALLDIR="/usr/$(get_libdir)/klibc" \ + ${myargs} || die "Compile failed!" + else + env -u ARCH \ + emake \ + libdir="/usr/$(get_libdir)" \ + SHLIBDIR="/$(get_libdir)" \ + mandir="/usr/share/man" \ + INSTALLDIR="/usr/$(get_libdir)/klibc" \ + ${myargs} || die "Compile failed!" + fi +} + +src_install() { + local myargs klibc_prefix + + [[ ${KV_DIR} != "${KV_OUT_DIR}" ]] && \ + myargs="KLIBCKERNELOBJ='${KV_OUT_DIR}/' KBUILD_SRC='1'" + + if is_cross ; then + klibc_prefix=$("${S}/klcc/${CTARGET}-klcc" -print-klibc-prefix) + + make INSTALLROOT=${D} \ + ARCH=$(guess_arch) \ + CROSS="${CTARGET}-" \ + libdir="/usr/$(get_libdir)" \ + SHLIBDIR="/$(get_libdir)" \ + mandir="/usr/share/man" \ + INSTALLDIR="/usr/$(get_libdir)/klibc" \ + ${myargs} \ + install || die "Install failed!" + else + klibc_prefix=$("${S}/klcc/klcc" -print-klibc-prefix) + + env -u ARCH \ + make INSTALLROOT=${D} \ + libdir="/usr/$(get_libdir)" \ + SHLIBDIR="/$(get_libdir)" \ + mandir="/usr/share/man" \ + INSTALLDIR="/usr/$(get_libdir)/klibc" \ + ${myargs} \ + install || die "Install failed!" + fi + + # Hardlinks becoming copies + for x in gunzip zcat ; do + rm -f "${D}/${klibc_prefix}/bin/${x}" + dosym gzip "${klibc_prefix}/bin/${x}" + done + + if ! is_cross ; then + insinto /usr/share/aclocal + doins ${FILESDIR}/klibc.m4 + + doenvd ${S}/70klibc + + dodoc ${S}/README ${S}/klibc/{LICENSE,CAVEATS} + newdoc ${S}/klibc/README README.klibc + newdoc ${S}/klibc/arch/README README.klibc.arch + docinto dash; newdoc ${S}/dash/README.klibc README + docinto gzip; dodoc ${S}/gzip/{COPYING,README} + fi +} + +pkg_postinst() { + # Override for linux-mod eclass + return 0 +} |