From 637bb0f69719761c735ea3d7d4bad948913bf681 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 28 Mar 2025 16:57:52 -0400 Subject: [PATCH] Add conditional LDLIBS for openbsd --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a7e2d7f..2926f45 100644 --- a/Makefile +++ b/Makefile @@ -34,13 +34,20 @@ else CWARN += -Wno-missing-field-initializers endif -OSFLAGS != case $$(uname -s) in *BSD|Darwin) echo '-D_BSD_SOURCE';; Linux) echo '-D_GNU_SOURCE';; *) echo '-D_DEFAULT_SOURCE';; esac +OS := $(shell uname -s) + +OSFLAGS != case $(OS) in *BSD|Darwin) echo '-D_BSD_SOURCE';; Linux) echo '-D_GNU_SOURCE';; *) echo '-D_DEFAULT_SOURCE';; esac EXTRA= G=-ggdb O=-Og CFLAGS=$(CCONFIG) $(EXTRA) $(CWARN) $(G) $(O) $(OSFLAGS) $(LTO) CFLAGS_PLACEHOLDER="$$(printf '\033[2m\033[m\n')" LDLIBS=-lgc -lcord -lm -lunistring -lgmp + +ifeq ($(OS),OpenBSD) + LDLIBS += -lpthread -lexecinfo +endif + COMPILER_OBJS=$(patsubst %.c,%.o,$(wildcard src/*.c)) STDLIB_OBJS=$(patsubst %.c,%.o,$(wildcard src/stdlib/*.c)) TESTS=$(patsubst test/%.tm,test/results/%.tm.testresult,$(wildcard test/*.tm))