git: d422cb7e4a2a - main - math/symfpu: fix build on non-x86

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Tue, 18 Apr 2023 21:55:57 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d422cb7e4a2a459719a4c4e1b28c0ee4416e4765

commit d422cb7e4a2a459719a4c4e1b28c0ee4416e4765
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-04-17 21:51:52 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-04-18 21:55:30 +0000

    math/symfpu: fix build on non-x86
    
    Only supply x86-specific CXXFLAGS on i386 and amd64.
    
    Approved by:    portmgr (build fix blanket)
---
 math/symfpu/Makefile          | 9 ++++++---
 math/symfpu/files/patch-flags | 5 +++++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/math/symfpu/Makefile b/math/symfpu/Makefile
index c3a04d80a98f..0823dff67a16 100644
--- a/math/symfpu/Makefile
+++ b/math/symfpu/Makefile
@@ -15,12 +15,15 @@ USE_GITHUB=	yes
 GH_ACCOUNT=	martin-cs
 GH_TAGNAME=	c3acaf6
 
-CXXFLAGS+=	-I${WRKSRC}
-
 ALL_TARGET=	subdirs symfpu.a
-
 MAKE_ARGS=	SUBDIRS=baseTypes
 
+# these flags are x86-only and have been patched out
+# of ${WRKSRC}/flags for portability
+CXXFLAGS_amd64=	-msse -mfma -mno-fma4 -mfpmath=sse
+CXXFLAGS_i386=	${CXXFLAGS_amd64}
+CXXFLAGS+=	${CXXFLAGS_${ARCH}} -I${WRKSRC}
+
 do-install:
 	${MKDIR} \
 		${STAGEDIR}${PREFIX}/include/symfpu/core \
diff --git a/math/symfpu/files/patch-flags b/math/symfpu/files/patch-flags
new file mode 100644
index 000000000000..404a3e9f2053
--- /dev/null
+++ b/math/symfpu/files/patch-flags
@@ -0,0 +1,5 @@
+--- flags.orig	2023-04-17 21:44:48 UTC
++++ flags
+@@ -1 +1 @@
+-CXXFLAGS+=-std=gnu++11 -Wall -W -frounding-math -fsignaling-nans -ffp-contract=off -msse2 -mfpmath=sse -pedantic -mfma -mno-fma4
++CXXFLAGS+=-std=gnu++11 -Wall -W -frounding-math -fsignaling-nans -ffp-contract=off -pedantic