$NetBSD$

Add linker flags for libgmp anf libutf8proc.

--- Makefile.orig	2025-03-28 15:28:03.000000000 +0000
+++ Makefile
@@ -1,11 +1,11 @@ CFLAGS = -O3 -flto=full -DNDEBUG -g  -std=gnu23 -Wall 
 # callcc requires clang/llvm.
 CC = clang
 CFLAGS = -O3 -flto=full -DNDEBUG -g  -std=gnu23 -Wall  -march=native -mtune=native -ffat-lto-objects -Wextra -Wnull-dereference  -Wshadow -Wno-unused-parameter
-LIBS = -lm -lgmp -lutf8proc
+LIBS = -lm -lgmp -lutf8proc ${LDFLAGS} $(shell pkg-config --libs gmp libutf8proc)
 SRCS = c/alloc_table.c c/gc.c c/runtime.c c/util/list.c c/util/bitset.c c/callcc.S c/rodata_handler.c
 OBJECTS = $(patsubst %, %.o, $(basename $(SRCS)))
 SCM_LIB_SRCS = lib/runtime.scm lib/eval.scm lib/read.scm lib/equal.scm lib/hashtable.scm lib/str2num.scm  
-SCM_COMPILER_SRCS = compiler/bc.scm compiler/expand.scm compiler/fix-letrec.scm compiler/library-manager.scm compiler/match.scm compiler/memory_layout.scm compiler/passes.scm compiler/qq.scm compiler/sua.scm compiler/util.scm compiler/gen-libraries.scm compiler/callcc.scm
+SCM_COMPILER_SRCS = compiler/bc.scm compiler/bc-libs.scm compiler/expand.scm compiler/fix-letrec.scm compiler/library-manager.scm compiler/match.scm compiler/memory_layout.scm compiler/passes.scm compiler/qq.scm compiler/sua.scm compiler/util.scm compiler/gen-libraries.scm compiler/callcc.scm
 SCM_SRCS = ${SCM_LIB_SRCS} ${SCM_COMPILER_SRCS}
 SRFI_SRCS = lib/srfi2/srfi/*.scm
 PREFIX ?= /usr
@@ -60,12 +60,14 @@ install: bin/callcc
 	install -d ${PREFIX}/lib/callcc/lib
 	install -d ${PREFIX}/lib/callcc/compiler
 	install libcallcc.a ${PREFIX}/lib/callcc/
-	install -m644 compiler/bc.* ${PREFIX}/lib/callcc/compiler
+	install -m644 compiler/bc*scm ${PREFIX}/lib/callcc/compiler
+	install -m644 compiler/bc*sld ${PREFIX}/lib/callcc/compiler
 	install -m644 compiler/passes.* ${PREFIX}/lib/callcc/compiler
 	install -m644 compiler/fix-letrec.scm ${PREFIX}/lib/callcc/compiler
 	install -m644 compiler/qq.scm ${PREFIX}/lib/callcc/compiler
 	install -m644 compiler/sua.scm ${PREFIX}/lib/callcc/compiler
-	install -m644 lib/runtime2.scm ${PREFIX}/lib/callcc/lib
+	# runtime2.scm does not exist? and runtime.scm is missing
+	install -m644 lib/runtime.scm ${PREFIX}/lib/callcc/lib
 	install -m644 lib/eval.scm ${PREFIX}/lib/callcc/lib
 	install -m644 compiler/memory_layout.scm ${PREFIX}/lib/callcc/compiler
 	install -m644 lib/str2num.scm ${PREFIX}/lib/callcc/lib
