> src_configure() {
> cd "${S}"/build
>
> echo > "${T}"/test.c
> $(tc-getCC) -c "${T}"/test.c -o "${T}"/test.o
> case $(scanelf -BF'%M' "${T}"/test.o)$(scanmacho -BF'%M' "${T}"/test.o) in
> ELFCLASS64*|POWERPC64*|X86_64*) myconf="${myconf} --enable-64bit";;
> ELFCLASS32*|POWERPC*|I386*|ARM*) ;;
> *) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";;
> esac
Why do you need such complex detection? Also in nss ebuild I see
different detection:
> Index: nss-3.12.10.ebuild
[snip]
> src_compile() {
> strip-flags
>
> echo > "${T}"/test.c
> $(tc-getCC) ${CFLAGS} -c "${T}"/test.c -o "${T}"/test.o
> case $(file "${T}"/test.o) in
> *64-bit*|*ppc64*|*x86_64*) export USE_64=1;;
> *32-bit*|*ppc*|*i386*) ;;
> *) die "Failed to detect whether your arch is 64bits or 32bits,
disable distcc if you're using it, please";;
> esac
It looks like good idea to unify them.
--
Peter.
05-16-2011, 09:33 AM
Diego Elio Pettenò
gentoo-x86 commit in dev-libs/nspr: nspr-4.8.8.ebuild ChangeLog
Il giorno lun, 16/05/2011 alle 13.15 +0400, Peter Volkov ha scritto:
> It looks like good idea to unify them.
Or you could use, you know, $(tc-arch) from toolchain-funcs.eclass?
05-16-2011, 09:39 AM
"Paweł Hajdan, Jr."
gentoo-x86 commit in dev-libs/nspr: nspr-4.8.8.ebuild ChangeLog
On 5/16/11 11:15 AM, Peter Volkov wrote:
> Why do you need such complex detection?
Is it possibly similar to the scenario from
<http://bugs.gentoo.org/show_bug.cgi?id=296917>, i.e. multilib portage
and other non-standard configurations? If so, it may also be useful to
re-use the detection logic in www-client/chromium and dev-lang/v8.