aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2021-10-22 11:42:44 +0000
committerPiotr Kubaj <pkubaj@FreeBSD.org>2021-10-22 11:42:44 +0000
commit91a4c28de9dc90927ba0acc201c6c1577f4fde0c (patch)
treea8f8013874140fa77090faab970c34f8feba1e0a
parentab467871db4051ab0162256fccdfe872ae40b959 (diff)
downloadports-91a4c28de9dc90927ba0acc201c6c1577f4fde0c.tar.gz
ports-91a4c28de9dc90927ba0acc201c6c1577f4fde0c.zip
misc/bb: fix building on non-x86
regparm is strictly i386, but clang allows it on amd64. Building on other architectures fails with: In file included from zoom.c:56: In file included from ./zoom.h:30: ./formulas.h:53:63: error: 'regparm' is not valid on this platform int (*calculate) (number_t, number_t, number_t, number_t) REGISTERS(3); ^ ~ ./config.h:42:38: note: expanded from macro 'REGISTERS' GCC builts in just fine.
-rw-r--r--misc/bb/Makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/misc/bb/Makefile b/misc/bb/Makefile
index 91a4fb01cfaa..e938b862d9ae 100644
--- a/misc/bb/Makefile
+++ b/misc/bb/Makefile
@@ -15,11 +15,6 @@ LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS= libaa.so:graphics/aalib \
libmikmod.so:audio/libmikmod
-BROKEN_aarch64= fails to build: regparm is not valid on this platform
-BROKEN_armv6= fails to build: regparm is not valid on this platform
-BROKEN_armv7= fails to build: regparm is not valid on this platform
-BROKEN_riscv64= fails to build: regparm is not valid on this platform
-
GNU_CONFIGURE= yes
WRKSRC= ${WRKDIR}/bb-1.3.0
PORTDOCS= README
@@ -28,6 +23,12 @@ PLIST_FILES= bin/bb man/man1/bb.1.gz share/bb/bb.s3m share/bb/bb2.s3m \
OPTIONS_DEFINE= DOCS
+.include <bsd.port.options.mk>
+
+.if ${ARCH} != amd64 && ${ARCH} != i386
+USES+= compiler:gcc-c++11-lib
+.endif
+
pre-patch:
@${FIND} ${WRKSRC} -type f | ${XARGS} ${REINPLACE_CMD} -E -e "s@#include +<malloc.h>@#include <stdlib.h>@g" \
-e 's, REGISTERS \(3\),,g'