aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2020-11-26 01:49:35 +0800
committerPiotr Kubaj <pkubaj@FreeBSD.org>2020-11-26 01:49:35 +0800
commitaa99f2904cce6ff33fbccced47fe0d3b87028180 (patch)
treea3f73de72dda2182af67eda40780b30db5c5a0af /lang
parent16f2119df1dbc3aff551107bb574450f114b8852 (diff)
downloadfreebsd-ports-gnome-aa99f2904cce6ff33fbccced47fe0d3b87028180.tar.gz
freebsd-ports-gnome-aa99f2904cce6ff33fbccced47fe0d3b87028180.tar.zst
freebsd-ports-gnome-aa99f2904cce6ff33fbccced47fe0d3b87028180.zip
lang/quickjs: fix build on GCC architectures
Don't use Clang if we need to use GCC PR: 251030 Approved by: yuri (maintainer timeout) MFH: 2020Q4 (fix build blanket)
Diffstat (limited to 'lang')
-rw-r--r--lang/quickjs/Makefile14
-rw-r--r--lang/quickjs/files/extra-clang-patch-Makefile (renamed from lang/quickjs/files/patch-Makefile)0
-rw-r--r--lang/quickjs/files/extra-gcc-patch-Makefile36
3 files changed, 48 insertions, 2 deletions
diff --git a/lang/quickjs/Makefile b/lang/quickjs/Makefile
index 0c6ac7e5634c..f20d42ac008d 100644
--- a/lang/quickjs/Makefile
+++ b/lang/quickjs/Makefile
@@ -11,6 +11,16 @@ COMMENT= Embeddable Javascript interpreter in C
LICENSE= MIT
-USES= gmake tar:xz
+USES= compiler:c11 gmake tar:xz
-.include <bsd.port.mk>
+EXTRA_PATCHES= ${FILESDIR}/extra-${CHOSEN_COMPILER_TYPE}-patch-Makefile
+
+.include <bsd.port.pre.mk>
+
+.if ${CHOSEN_COMPILER_TYPE} == gcc
+post-patch:
+ @${REINPLACE_CMD} -e 's/%%GCC_DEFAULT%%/${GCC_DEFAULT}/' \
+ ${WRKSRC}/Makefile
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/lang/quickjs/files/patch-Makefile b/lang/quickjs/files/extra-clang-patch-Makefile
index d4014c7285af..d4014c7285af 100644
--- a/lang/quickjs/files/patch-Makefile
+++ b/lang/quickjs/files/extra-clang-patch-Makefile
diff --git a/lang/quickjs/files/extra-gcc-patch-Makefile b/lang/quickjs/files/extra-gcc-patch-Makefile
new file mode 100644
index 000000000000..bdaf4f8a3c7d
--- /dev/null
+++ b/lang/quickjs/files/extra-gcc-patch-Makefile
@@ -0,0 +1,36 @@
+--- Makefile.orig 2020-09-06 09:31:51 UTC
++++ Makefile
+@@ -25,6 +25,9 @@
+ ifeq ($(shell uname -s),Darwin)
+ CONFIG_DARWIN=y
+ endif
++ifeq ($(shell uname -s),FreeBSD)
++CONFIG_FREEBSD=y
++endif
+ # Windows cross compilation from Linux
+ #CONFIG_WIN32=y
+ # use link time optimization (smaller and faster executables but slower build)
+@@ -39,6 +42,12 @@ ifdef CONFIG_DARWIN
+ CONFIG_CLANG=y
+ CONFIG_DEFAULT_AR=y
+ endif
++ifdef CONFIG_FREEBSD
++# use clang instead of gcc
++CONFIG_CLANG=
++CONFIG_DEFAULT_AR=y
++CONFIG_LTO=
++endif
+
+ # installation directory
+ prefix=/usr/local
+@@ -81,8 +90,8 @@ ifdef CONFIG_CLANG
+ endif
+ endif
+ else
+- HOST_CC=gcc
+- CC=$(CROSS_PREFIX)gcc
++ HOST_CC=gcc%%GCC_DEFAULT%%
++ CC=$(CROSS_PREFIX)gcc%%GCC_DEFAULT%%
+ CFLAGS=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d
+ CFLAGS += -Wno-array-bounds -Wno-format-truncation
+ ifdef CONFIG_LTO