From 075774ab73e00b549b9e166f2fd76e141503c55a Mon Sep 17 00:00:00 2001 From: Ionen Wolkens Date: Tue, 17 May 2022 22:43:45 -0400 Subject: 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 --- app-emulation/wine-staging/wine-staging-7.5-r1.ebuild | 6 +++++- app-emulation/wine-staging/wine-staging-7.6-r1.ebuild | 6 +++++- app-emulation/wine-staging/wine-staging-7.7.ebuild | 6 +++++- app-emulation/wine-staging/wine-staging-7.8.ebuild | 6 +++++- app-emulation/wine-staging/wine-staging-9999.ebuild | 6 +++++- 5 files changed, 25 insertions(+), 5 deletions(-) (limited to 'app-emulation') diff --git a/app-emulation/wine-staging/wine-staging-7.5-r1.ebuild b/app-emulation/wine-staging/wine-staging-7.5-r1.ebuild index 5a8aa3f539f4..13ce77523323 100644 --- a/app-emulation/wine-staging/wine-staging-7.5-r1.ebuild +++ b/app-emulation/wine-staging/wine-staging-7.5-r1.ebuild @@ -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 diff --git a/app-emulation/wine-staging/wine-staging-7.6-r1.ebuild b/app-emulation/wine-staging/wine-staging-7.6-r1.ebuild index c814bc62907c..2e0e2a06247c 100644 --- a/app-emulation/wine-staging/wine-staging-7.6-r1.ebuild +++ b/app-emulation/wine-staging/wine-staging-7.6-r1.ebuild @@ -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 diff --git a/app-emulation/wine-staging/wine-staging-7.7.ebuild b/app-emulation/wine-staging/wine-staging-7.7.ebuild index c814bc62907c..2e0e2a06247c 100644 --- a/app-emulation/wine-staging/wine-staging-7.7.ebuild +++ b/app-emulation/wine-staging/wine-staging-7.7.ebuild @@ -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 diff --git a/app-emulation/wine-staging/wine-staging-7.8.ebuild b/app-emulation/wine-staging/wine-staging-7.8.ebuild index a8f7b0e6ad1c..78a3e9fb8778 100644 --- a/app-emulation/wine-staging/wine-staging-7.8.ebuild +++ b/app-emulation/wine-staging/wine-staging-7.8.ebuild @@ -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 diff --git a/app-emulation/wine-staging/wine-staging-9999.ebuild b/app-emulation/wine-staging/wine-staging-9999.ebuild index a8f7b0e6ad1c..78a3e9fb8778 100644 --- a/app-emulation/wine-staging/wine-staging-9999.ebuild +++ b/app-emulation/wine-staging/wine-staging-9999.ebuild @@ -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 -- cgit v1.2.3-65-gdbad