From c21df2d44cf49bbc2333e7e33bf400c542835c8b Mon Sep 17 00:00:00 2001 From: Rhialto The M Date: Mon, 3 May 2021 18:50:54 +0200 Subject: [PATCH] v: building on NetBSD (#9953) --- Makefile | 11 +++++++++-- vlib/v/builder/cc.v | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8ad82b5624..79a8b5eed8 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,11 @@ TCCOS := freebsd LDFLAGS += -lexecinfo endif +ifeq ($(_SYS),NetBSD) +TCCOS := netbsd +LDFLAGS += -lexecinfo +endif + ifdef ANDROID_ROOT ANDROID := 1 undefine LINUX @@ -94,10 +99,11 @@ clean: rm -rf $(TMPTCC) rm -rf $(VC) -latest_vc: $(VC)/.git/config ifndef local +latest_vc: $(VC)/.git/config cd $(VC) && $(GITCLEANPULL) else +latest_vc: @echo "Using local vc" endif @@ -105,11 +111,12 @@ fresh_vc: rm -rf $(VC) $(GITFASTCLONE) $(VCREPO) $(VC) -latest_tcc: $(TMPTCC)/.git/config ifndef ANDROID ifndef local +latest_tcc: $(TMPTCC)/.git/config cd $(TMPTCC) && $(GITCLEANPULL) else +latest_tcc: @echo "Using local tcc" endif endif diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index 7546c30ab1..a99876563f 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -386,8 +386,8 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) { if v.pref.os == .linux { ccoptions.linker_flags << '-ldl' } - if v.pref.os == .freebsd { - // FreeBSD: backtrace needs execinfo library while linking + if v.pref.os in [.freebsd, .netbsd] { + // Free/NetBSD: backtrace needs execinfo library while linking ccoptions.linker_flags << '-lexecinfo' } }