From 590fbc65ef9a1f60c5fa4fc8937590e9c13f70cf Mon Sep 17 00:00:00 2001 From: Piotrek Marciniak Date: Wed, 22 Mar 2023 19:04:18 +0100 Subject: [PATCH] CR fixes --- Makefile.defs | 6 +++--- Makefile.third | 2 +- ffi/util.lua | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile.defs b/Makefile.defs index 95be650f4..9fd863278 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -191,11 +191,11 @@ endif ifneq (,$(filter $(UNAME), Darwin)) export DARWINHOST=1 ifneq (,$(filter $(UNAME_ARCH), arm64)) - export DARWINM1HOST=1 + export DARWIN_AARCH64_HOST=1 endif ifdef EMULATE_READER export DARWIN=1 - ifdef DARWINM1HOST + ifdef DARWIN_AARCH64_HOST export DARWIN_M1=1 endif endif @@ -507,7 +507,7 @@ ifdef MACOS HOST_ARCH:=-mtune=generic endif -ifdef DARWINM1HOST +ifdef DARWIN_AARCH64_HOST HOST_ARCH:=-mcpu=apple-m1 endif diff --git a/Makefile.third b/Makefile.third index 194407a22..f4fa0fa21 100644 --- a/Makefile.third +++ b/Makefile.third @@ -610,7 +610,7 @@ $(OPENSSL_LIB) $(OPENSSL_DIR): $(THIRDPARTY_DIR)/openssl/*.* -DRANLIB="$(RANLIB)" \ -DCHOST="$(CHOST)" \ $(if $(ANDROID),-DNDKABI=$(NDKABI),) \ - -DCONFIG_SCRIPT="$(if $(EMULATE_READER),$(if $(DARWIN),Configure $(if $(DARWIN_M1),darwin64-arm64-cc,darwin64-x86_64-cc),config),Configure $(if $(WIN32),mingw,))" \ + -DCONFIG_SCRIPT="$(if $(EMULATE_READER),$(if $(DARWIN),Configure $(if $(DARWIN_AARCH64),darwin64-arm64-cc,darwin64-x86_64-cc),config),Configure $(if $(WIN32),mingw,))" \ $(CURDIR)/$(THIRDPARTY_DIR)/openssl && \ $(CMAKE_MAKE_PROGRAM) $(CMAKE_MAKE_PROGRAM_FLAGS) diff --git a/ffi/util.lua b/ffi/util.lua index fc0192c66..5525bd2b3 100644 --- a/ffi/util.lua +++ b/ffi/util.lua @@ -63,7 +63,7 @@ int WideCharToMultiByte( local getlibprefix = function() -- Apple M1 homebrew installs libraries outside of default searchpaths, -- and dyld environment variables are sip-protected on MacOS, cf. https://github.com/Homebrew/brew/issues/13481#issuecomment-1181592842 - local libprefix = os.getenv("KO_DYLD_PREFIX"); + local libprefix = os.getenv("KO_DYLD_PREFIX") if not libprefix then local std_out = io.popen("brew --prefix", "r") @@ -73,7 +73,7 @@ local getlibprefix = function() end end - return libprefix or ""; + return libprefix; end require("ffi/posix_h")