app-emulation/wine-staging: improve cross *FLAGS handling

Given wine will switch compiler, need to ensure unsupported flags were
stripped so that e.g. clang-specific flags won't cause a build failure.

strip-unsupported-flags doesn't act on CROSSCFLAGS, so use test-*
directly. Using := assignment so that users can override.

Additionally allowing LDFLAGS, there's not much to gain from it
but as long as unsupported is stripped it should cause no issues.

Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
This commit is contained in:
Ionen Wolkens
2022-05-17 22:43:45 -04:00
parent 22d035036d
commit 075774ab73
5 changed files with 25 additions and 5 deletions

View File

@@ -359,7 +359,11 @@ src_configure() {
if use mingw; then
use crossdev-mingw || PATH=${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH}
export CROSSCFLAGS="${CFLAGS}"
# use *FLAGS for mingw, but strip unsupported (e.g. --hash-style=gnu)
local mingwcc=${CROSSCC:-$(usex x86 i686 x86_64)-w64-mingw32-gcc}
: "${CROSSCFLAGS:=$(CC=${mingwcc} test-flags-CC ${CFLAGS:--O2})}"
: "${CROSSLDFLAGS:=$(CC=${mingwcc} test-flags-CCLD ${LDFLAGS})}"
export CROSS{C,LD}FLAGS
fi
multilib-minimal_src_configure

View File

@@ -359,7 +359,11 @@ src_configure() {
if use mingw; then
use crossdev-mingw || PATH=${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH}
export CROSSCFLAGS="${CFLAGS}"
# use *FLAGS for mingw, but strip unsupported (e.g. --hash-style=gnu)
local mingwcc=${CROSSCC:-$(usex x86 i686 x86_64)-w64-mingw32-gcc}
: "${CROSSCFLAGS:=$(CC=${mingwcc} test-flags-CC ${CFLAGS:--O2})}"
: "${CROSSLDFLAGS:=$(CC=${mingwcc} test-flags-CCLD ${LDFLAGS})}"
export CROSS{C,LD}FLAGS
fi
multilib-minimal_src_configure

View File

@@ -359,7 +359,11 @@ src_configure() {
if use mingw; then
use crossdev-mingw || PATH=${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH}
export CROSSCFLAGS="${CFLAGS}"
# use *FLAGS for mingw, but strip unsupported (e.g. --hash-style=gnu)
local mingwcc=${CROSSCC:-$(usex x86 i686 x86_64)-w64-mingw32-gcc}
: "${CROSSCFLAGS:=$(CC=${mingwcc} test-flags-CC ${CFLAGS:--O2})}"
: "${CROSSLDFLAGS:=$(CC=${mingwcc} test-flags-CCLD ${LDFLAGS})}"
export CROSS{C,LD}FLAGS
fi
multilib-minimal_src_configure

View File

@@ -357,7 +357,11 @@ src_configure() {
if use mingw; then
use crossdev-mingw || PATH=${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH}
export CROSSCFLAGS="${CFLAGS}"
# use *FLAGS for mingw, but strip unsupported (e.g. --hash-style=gnu)
local mingwcc=${CROSSCC:-$(usex x86 i686 x86_64)-w64-mingw32-gcc}
: "${CROSSCFLAGS:=$(CC=${mingwcc} test-flags-CC ${CFLAGS:--O2})}"
: "${CROSSLDFLAGS:=$(CC=${mingwcc} test-flags-CCLD ${LDFLAGS})}"
export CROSS{C,LD}FLAGS
fi
multilib-minimal_src_configure

View File

@@ -357,7 +357,11 @@ src_configure() {
if use mingw; then
use crossdev-mingw || PATH=${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH}
export CROSSCFLAGS="${CFLAGS}"
# use *FLAGS for mingw, but strip unsupported (e.g. --hash-style=gnu)
local mingwcc=${CROSSCC:-$(usex x86 i686 x86_64)-w64-mingw32-gcc}
: "${CROSSCFLAGS:=$(CC=${mingwcc} test-flags-CC ${CFLAGS:--O2})}"
: "${CROSSLDFLAGS:=$(CC=${mingwcc} test-flags-CCLD ${LDFLAGS})}"
export CROSS{C,LD}FLAGS
fi
multilib-minimal_src_configure