git: 85ffdceb6983 - main - lang/ocaml: fix build on powerpc*

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Sat, 15 Jul 2023 00:43:09 UTC
The branch main has been updated by pkubaj:

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

commit 85ffdceb69831fd6f4f188784aee626414ce5929
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2023-07-15 00:41:39 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2023-07-15 00:42:54 +0000

    lang/ocaml: fix build on powerpc*
    
    1. SYSTEM_ARCH needs to be set to power.
    2. To override LD, -fuse-ld=bfd needs to be appended to CC.
---
 lang/ocaml/Makefile | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lang/ocaml/Makefile b/lang/ocaml/Makefile
index 3e4b22ddb1dc..93eb441d046e 100644
--- a/lang/ocaml/Makefile
+++ b/lang/ocaml/Makefile
@@ -45,11 +45,10 @@ awk_CMD=	/usr/bin/awk
 SHEBANG_FILES=	tools/ocaml-instr-graph tools/ocaml-instr-report
 
 CONFIGURE_ARGS= --prefix="${PREFIX}"
-CONFIGURE_ENV=	CC="${CC}" \
-		LDFLAGS="${LDFLAGS}" \
+CONFIGURE_ENV=	LDFLAGS="${LDFLAGS}" \
 		ASPP="${CC} -c" \
 		PARTIALLD="${LD} -r"
-MAKE_ENV=	SYSTEM_ARCH="${ARCH}"
+MAKE_ENV=	SYSTEM_ARCH="${ARCH:C/powerpc.*/power/}"
 
 OPTIONS_DEFINE=	X11 THREADS DOCS EXAMPLES
 OPTIONS_DEFAULT=X11 THREADS
@@ -76,11 +75,13 @@ DOCS_DISTFILES=	${DISTNAME:R}-refman-html.tar.gz:docs \
 .include <bsd.port.pre.mk>
 
 .if ${ARCH} == armv6 || ${ARCH} == armv7
-CONFIGURE_ENV+=		AS="${AS} ${ASFLAGS} -meabi=5"
+CONFIGURE_ENV+=		AS="${AS} ${ASFLAGS} -meabi=5" \
+			CC="${CC}"
 .elif ${ARCH} == powerpc || ${ARCH} == powerpc64 || ${ARCH} == powerpc64le
-LLD_UNSAFE=		yes
+CONFIGURE_ENV+=		CC="${CC} -fuse-ld=bfd"
 .else
-CONFIGURE_ENV+=		AS="${AS} ${ASFLAGS}"
+CONFIGURE_ENV+=		AS="${AS} ${ASFLAGS}" \
+			CC="${CC}"
 .endif
 
 .if defined(NO_PROFILE) || ${ARCH:Mpowerpc} || ${ARCH:Mamd64}