git: dcbc273b6b19 - main - lang/gcc12: fix build on powerpc64* with CPUTYPE?=g[3-5]

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Mon, 19 Jun 2023 13:18:08 UTC
The branch main has been updated by pkubaj:

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

commit dcbc273b6b19b13eac1b1fbbb013148e1721dc85
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2023-06-18 19:25:47 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2023-06-19 13:18:06 +0000

    lang/gcc12: fix build on powerpc64* with CPUTYPE?=g[3-5]
    
    GCC doesn't support -mcpu=g4, but it supports -mcpu=G4. Same for g3 and g5.
---
 lang/gcc12/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lang/gcc12/Makefile b/lang/gcc12/Makefile
index 1604c7fcfec8..fcca3cfd875d 100644
--- a/lang/gcc12/Makefile
+++ b/lang/gcc12/Makefile
@@ -60,6 +60,11 @@ MULTILIB_CONFIGURE_ENABLE=	multilib
 CONFIGURE_ARGS+=	--disable-multilib
 .endif
 
+.if ${CPUTYPE:Mg[3-5]}
+CFLAGS:=	${CFLAGS:S/mcpu=g/mcpu=G/}
+CXXFLAGS:=	${CFLAGS:S/mcpu=g/mcpu=G/}
+.endif
+
 .include <bsd.port.pre.mk>
 
 # Extraction fails with poudriere on aarch64 for GCC 12.