--- src/ibrowse/erlang.mk.orig 2025-05-03 02:23:23.000000000 +0800 +++ src/ibrowse/erlang.mk 2025-09-25 05:57:21.000000000 +0800 @@ -763,9 +763,9 @@ UNAME_SYS := $(shell uname -s) ifeq ($(UNAME_SYS), Darwin) CC ?= cc - CFLAGS ?= -O3 -std=c99 -arch x86_64 -finline-functions -Wall -Wmissing-prototypes - CXXFLAGS ?= -O3 -arch x86_64 -finline-functions -Wall - LDFLAGS ?= -arch x86_64 -flat_namespace -undefined suppress + CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes + CXXFLAGS ?= -O3 -finline-functions -Wall + LDFLAGS ?= -flat_namespace -undefined suppress else ifeq ($(UNAME_SYS), FreeBSD) CC ?= cc CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes --- src/couch_quickjs/quickjs/Makefile.orig 2025-05-02 12:20:47.000000000 +0800 +++ src/couch_quickjs/quickjs/Makefile 2025-09-25 06:01:34.000000000 +0800 @@ -43,7 +43,7 @@ #CONFIG_COSMO=y # installation directory -PREFIX?=/usr/local +PREFIX?=@PREFIX@ # use the gprof profiler #CONFIG_PROFILE=y @@ -67,8 +67,6 @@ endif ifdef CONFIG_DARWIN -# use clang instead of gcc -CONFIG_CLANG=y CONFIG_DEFAULT_AR=y endif ifdef CONFIG_FREEBSD @@ -125,23 +123,20 @@ CFLAGS += -Wno-array-bounds -Wno-format-truncation AR=cosmoar else - HOST_CC=gcc - CC=$(CROSS_PREFIX)gcc + HOST_CC=@CC@ + CC=@CC@ CFLAGS+=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d CFLAGS += -Wno-array-bounds -Wno-format-truncation -Wno-infinite-recursion ifdef CONFIG_LTO - AR=$(CROSS_PREFIX)gcc-ar + AR=ar else AR=$(CROSS_PREFIX)ar endif endif STRIP?=$(CROSS_PREFIX)strip -ifdef CONFIG_M32 -CFLAGS+=-msse2 -mfpmath=sse # use SSE math for correct FP rounding ifndef CONFIG_WIN32 -CFLAGS+=-m32 -LDFLAGS+=-m32 -endif +CFLAGS+=@ARCHFLAG@ +LDFLAGS+=@ARCHFLAG@ endif CFLAGS+=-fwrapv # ensure that signed overflows behave as expected ifdef CONFIG_WERROR @@ -188,7 +183,9 @@ CFLAGS+=-fsanitize=undefined -fno-omit-frame-pointer LDFLAGS+=-fsanitize=undefined -fno-omit-frame-pointer endif -ifdef CONFIG_WIN32 +ifdef CONFIG_DARWIN +CFLAGS+=-isystem@PREFIX@/include/LegacySupport +LDFLAGS+=-lMacportsLegacySupport LDEXPORT= else LDEXPORT=-rdynamic @@ -205,11 +202,11 @@ PROGS=qjs$(EXE) qjsc$(EXE) run-test262$(EXE) ifneq ($(CROSS_PREFIX),) -QJSC_CC=gcc +QJSC_CC=@CC@ QJSC=./host-qjsc PROGS+=$(QJSC) else -QJSC_CC=$(CC) +QJSC_CC=@CC@ QJSC=./qjsc$(EXE) endif PROGS+=libquickjs.a @@ -243,7 +240,7 @@ QJS_OBJS=$(OBJDIR)/qjs.o $(OBJDIR)/repl.o $(QJS_LIB_OBJS) -HOST_LIBS=-lm -ldl -lpthread +HOST_LIBS=-lm -ldl -lpthread -lMacportsLegacySupport LIBS=-lm -lpthread ifndef CONFIG_WIN32 LIBS+=-ldl