diff --git a/GNUmakefile b/GNUmakefile index 4333565966..9084b145f9 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -32,9 +32,6 @@ export GOROOT = $(shell $(GO) env GOROOT) # Flags to pass to go test. GOTESTFLAGS ?= -# md5sum binary -MD5SUM = md5sum - # tinygo binary for tests TINYGO ?= $(call detect,tinygo,tinygo $(CURDIR)/build/tinygo) @@ -130,14 +127,14 @@ ifeq ($(OS),Windows_NT) USE_SYSTEM_BINARYEN ?= 1 else ifeq ($(shell uname -s),Darwin) - MD5SUM = md5 + MD5SUM ?= md5 CGO_LDFLAGS += -lxar USE_SYSTEM_BINARYEN ?= 1 else ifeq ($(shell uname -s),FreeBSD) - MD5SUM = md5 + MD5SUM ?= md5 START_GROUP = -Wl,--start-group END_GROUP = -Wl,--end-group else @@ -145,6 +142,9 @@ else END_GROUP = -Wl,--end-group endif +# md5sum binary default, can be overridden by an environment variable +MD5SUM ?= md5sum + # Libraries that should be linked in for the statically linked Clang. CLANG_LIB_NAMES = clangAnalysis clangAST clangASTMatchers clangBasic clangCodeGen clangCrossTU clangDriver clangDynamicASTMatchers clangEdit clangExtractAPI clangFormat clangFrontend clangFrontendTool clangHandleCXX clangHandleLLVM clangIndex clangLex clangParse clangRewrite clangRewriteFrontend clangSema clangSerialization clangSupport clangTooling clangToolingASTDiff clangToolingCore clangToolingInclusions CLANG_LIBS = $(START_GROUP) $(addprefix -l,$(CLANG_LIB_NAMES)) $(END_GROUP) -lstdc++ diff --git a/flake.nix b/flake.nix index 30e5cde1d7..53d8fab45b 100644 --- a/flake.nix +++ b/flake.nix @@ -72,6 +72,10 @@ export LLVM_AR=llvm-ar export LLVM_NM=llvm-nm + # Make `make smoketest` work (the default is `md5`, while Nix only + # has `md5sum`). + export MD5SUM=md5sum + # Ugly hack to make the Clang resources directory available. export GOFLAGS="\"-ldflags=-X github.com/tinygo-org/tinygo/goenv.clangResourceDir=${llvmPackages_16.clang.cc.lib}/lib/clang/16"\" '';