From 41cf8c97d7817ab6d3b76b252bf6d75e2f565eb3 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 28 Jul 2019 21:27:22 +0800 Subject: improve tmpdir for termux --- core/prefix.mak | 3 ++- makefile | 3 ++- xmake/core/base/os.lua | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/prefix.mak b/core/prefix.mak index ce68486b9..ddfc4944a 100644 --- a/core/prefix.mak +++ b/core/prefix.mak @@ -4,7 +4,8 @@ include $(PRO_DIR)/project.mak # the temporary directory -TMP_DIR :=$(if $(TMP_DIR),$(TMP_DIR),/tmp) +TMP_DIR :=$(if $(TMP_DIR),$(TMP_DIR),$(TMPDIR)) +TMP_DIR :=$(if $(TMP_DIR),$(TMP_DIR),/tmp) # the source directory SRC_DIR = $(PRO_DIR)/src diff --git a/makefile b/makefile index 66ed8a704..7346738da 100644 --- a/makefile +++ b/makefile @@ -6,10 +6,11 @@ verbose:= #verbose:=-v # prefix +prefix:=$(if $(prefix),$(prefix),$(PREFIX)) # for termux prefix:=$(if $(prefix),$(prefix),$(if $(findstring /usr/local/bin,$(PATH)),/usr/local,/usr)) - # the temporary directory +TMP_DIR :=$(if $(TMP_DIR),$(TMP_DIR),$(TMPDIR)) # for termux TMP_DIR :=$(if $(TMP_DIR),$(TMP_DIR),/tmp) # platform diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index 57353d4d8..59f36b062 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -493,7 +493,7 @@ function os.tmpdir() -- get root tmpdir if os._ROOT_TMPDIR == nil then - os._ROOT_TMPDIR = os.getenv("XMAKE_TMPDIR") or os._tmpdir() + os._ROOT_TMPDIR = os.getenv("XMAKE_TMPDIR") or os.getenv("TMPDIR") or os._tmpdir() end local tmpdir_root = os._ROOT_TMPDIR -- cgit v1.3.1