ramspeed-3.5.0-r2.ebuild 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit flag-o-matic toolchain-funcs
  5. MY_PN="ramsmp"
  6. MY_P="${MY_PN}-${PV}"
  7. DESCRIPTION="Benchmarking for memory and cache"
  8. HOMEPAGE="http://www.alasir.com/software/ramspeed/"
  9. SRC_URI="http://www.alasir.com/software/${PN}/${MY_P}.tar.gz"
  10. LICENSE="Alasir"
  11. SLOT="0"
  12. KEYWORDS="amd64 x86"
  13. IUSE="cpu_flags_x86_sse pic"
  14. S="${WORKDIR}/${MY_P}"
  15. src_configure(){
  16. local obj
  17. local arch_prefix=./
  18. use x86 && arch_prefix=i386/
  19. use amd64 && arch_prefix=amd64/
  20. tc-export CC AS
  21. #fix the stack
  22. append-ldflags -Wl,-z,noexecstack
  23. obj=( ramsmp.o ${arch_prefix}{fltmark,fltmem,intmark,intmem}.o )
  24. use pic && append-ldflags -nopie
  25. if use amd64; then
  26. sed -i \
  27. -e 's/call.*free/call\tfree@PLT/' \
  28. -e 's/call.*gettimeofday/call\tgettimeofday@PLT/' \
  29. -e 's/call.*malloc/call\tmalloc@PLT/' \
  30. ${arch_prefix}/*.s || die
  31. fi
  32. use x86 && obj+=( ${arch_prefix}{cpuinfo/cpuinfo_main,cpuinfo/cpuinfo_ext}.o )
  33. if use cpu_flags_x86_sse; then
  34. use x86 && append-flags "-DLINUX -DI386_ASM"
  35. use amd64 && append-flags "-DLINUX -DAMD64_ASM"
  36. obj+=( ${arch_prefix}{mmxmark,mmxmem,ssemark,ssemem}.o )
  37. fi
  38. echo "ramsmp: ${obj[@]}" > Makefile
  39. }
  40. src_install(){
  41. dobin ramsmp
  42. dosym ramsmp /usr/bin/ramspeed
  43. dodoc HISTORY README
  44. }