Index: head/lang/quickjs/Makefile =================================================================== --- head/lang/quickjs/Makefile (revision 556298) +++ head/lang/quickjs/Makefile (revision 556299) @@ -1,16 +1,26 @@ # $FreeBSD$ PORTNAME= quickjs DISTVERSION= 2020.09.06 CATEGORIES= lang devel MASTER_SITES= https://bellard.org/${PORTNAME}/ DISTNAME= ${PORTNAME}-${DISTVERSION:S/./-/g} MAINTAINER= yuri@FreeBSD.org COMMENT= Embeddable Javascript interpreter in C LICENSE= MIT -USES= gmake tar:xz +USES= compiler:c11 gmake tar:xz -.include +EXTRA_PATCHES= ${FILESDIR}/extra-${CHOSEN_COMPILER_TYPE}-patch-Makefile + +.include + +.if ${CHOSEN_COMPILER_TYPE} == gcc +post-patch: + @${REINPLACE_CMD} -e 's/%%GCC_DEFAULT%%/${GCC_DEFAULT}/' \ + ${WRKSRC}/Makefile +.endif + +.include Index: head/lang/quickjs/files/patch-Makefile =================================================================== --- head/lang/quickjs/files/patch-Makefile (revision 556298) +++ head/lang/quickjs/files/patch-Makefile (nonexistent) @@ -1,25 +0,0 @@ ---- Makefile.orig 2019-09-18 18:34:20 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) -@@ -38,6 +41,12 @@ ifdef CONFIG_DARWIN - # use clang instead of gcc - CONFIG_CLANG=y - CONFIG_DEFAULT_AR=y -+endif -+ifdef CONFIG_FREEBSD -+# use clang instead of gcc -+CONFIG_CLANG=y -+CONFIG_DEFAULT_AR=y -+CONFIG_LTO= - endif - - # installation directory Property changes on: head/lang/quickjs/files/patch-Makefile ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/lang/quickjs/files/extra-clang-patch-Makefile =================================================================== --- head/lang/quickjs/files/extra-clang-patch-Makefile (nonexistent) +++ head/lang/quickjs/files/extra-clang-patch-Makefile (revision 556299) @@ -0,0 +1,25 @@ +--- Makefile.orig 2019-09-18 18:34:20 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) +@@ -38,6 +41,12 @@ ifdef CONFIG_DARWIN + # use clang instead of gcc + CONFIG_CLANG=y + CONFIG_DEFAULT_AR=y ++endif ++ifdef CONFIG_FREEBSD ++# use clang instead of gcc ++CONFIG_CLANG=y ++CONFIG_DEFAULT_AR=y ++CONFIG_LTO= + endif + + # installation directory Property changes on: head/lang/quickjs/files/extra-clang-patch-Makefile ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/lang/quickjs/files/extra-gcc-patch-Makefile =================================================================== --- head/lang/quickjs/files/extra-gcc-patch-Makefile (nonexistent) +++ head/lang/quickjs/files/extra-gcc-patch-Makefile (revision 556299) @@ -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 Property changes on: head/lang/quickjs/files/extra-gcc-patch-Makefile ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property