kgcc64-4.1.2.ebuild 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. case ${CHOST} in
  5. hppa*) CTARGET=hppa64-${CHOST#*-};;
  6. mips*) CTARGET=${CHOST/mips/mips64};;
  7. powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
  8. s390*) CTARGET=${CHOST/s390/s390x};;
  9. sparc*) CTARGET=${CHOST/sparc/sparc64};;
  10. i?86*) CTARGET=x86_64-${CHOST#*-};;
  11. esac
  12. export CTARGET
  13. TOOLCHAIN_ALLOWED_LANGS="c"
  14. GCC_TARGET_NO_MULTILIB=true
  15. PATCH_VER="1.0.1"
  16. GCC_FILESDIR=${FILESDIR/${PN}/gcc}
  17. inherit eutils toolchain
  18. DESCRIPTION="64bit kernel compiler"
  19. KEYWORDS="-* hppa ~mips ~s390 sparc"
  20. # unlike every other target, hppa has not unified the 32/64 bit
  21. # ports in binutils yet
  22. DEPEND="hppa? ( sys-devel/binutils-hppa64 )
  23. !sys-devel/gcc-hppa64
  24. !sys-devel/gcc-mips64
  25. !sys-devel/gcc-powerpc64
  26. !sys-devel/gcc-sparc64"
  27. src_prepare() {
  28. toolchain_src_prepare
  29. # Fix cross-compiling
  30. epatch "${GCC_FILESDIR}"/4.1.0/gcc-4.1.0-cross-compile.patch
  31. }
  32. pkg_postinst() {
  33. toolchain_pkg_postinst
  34. cd "${ROOT}"/usr/bin
  35. local x
  36. for x in gcc cpp ; do
  37. cat <<-EOF >${CTARGET%%-*}-linux-${x}
  38. #!/bin/sh
  39. exec ${CTARGET}-${x} "\$@"
  40. EOF
  41. chmod a+rx ${CTARGET%%-*}-linux-${x}
  42. done
  43. }