commit:     6d1e7c4b64b5f2dad745d87fcb45f957cbe39cce
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 16 15:17:09 2026 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sat Jan 17 15:18:12 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d1e7c4b

dev-libs/nspr: Determine arch configure args using tc-get-ptr-size

--enable-n32 was dropped years ago, and it was only for IRIX anyway. That leaves
--enable-x32 as the only special case.

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/17

 dev-libs/nspr/nspr-4.38.2.ebuild | 24 ++++--------------------
 1 file changed, 4 insertions(+), 20 deletions(-)

diff --git a/dev-libs/nspr/nspr-4.38.2.ebuild b/dev-libs/nspr/nspr-4.38.2.ebuild
index a50b8c577076..03eea63a2379 100644
--- a/dev-libs/nspr/nspr-4.38.2.ebuild
+++ b/dev-libs/nspr/nspr-4.38.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2025 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -96,25 +96,9 @@ multilib_src_configure() {
        # that trigger some code conditional to platform & arch. This really
        # matters for the few common arches (x86, ppc) but we pass a little
        # more of them to be future-proof.
-
-       # use ABI first, this will work for most cases
-       case "${ABI}" in
-               alpha|arm|hppa|m68k|o32|ppc|s390|sh|sparc|x86) ;;
-               n32) myconf+=( --enable-n32 );;
-               x32) myconf+=( --enable-x32 );;
-               s390x|*64) myconf+=( --enable-64bit );;
-               default) # no abi actually set, fall back to old check
-                       einfo "Running a short build test to determine 
64bit'ness"
-                       # TODO: Port this to toolchain-funcs 
tc-get-ptr-size/tc-get-build-ptr-size
-                       echo > "${T}"/test.c || die
-                       ${CC} ${CFLAGS} ${CPPFLAGS} -fno-lto -c "${T}"/test.c 
-o "${T}"/test.o || die
-                       case $(file -S "${T}"/test.o) in
-                               *32-bit*x86-64*) myconf+=( --enable-x32 );;
-                               *64-bit*|*ppc64*|*x86_64*) myconf+=( 
--enable-64bit );;
-                               *32-bit*|*ppc*|*i386*) ;;
-                               *) die "Failed to detect whether your arch is 
64bits or 32bits, disable distcc if you're using it, please";;
-                       esac ;;
-               *) ;;
+       case $(tc-get-ptr-size) in
+               4) use abi_x86_x32 && myconf+=( --enable-x32 );;
+               8) myconf+=( --enable-64bit );;
        esac
 
        # Ancient autoconf needs help finding the right tools.

Reply via email to