diff options
| author | ruki <[email protected]> | 2019-07-28 21:27:22 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-07-28 21:33:19 +0800 |
| commit | 41cf8c97d7817ab6d3b76b252bf6d75e2f565eb3 (patch) | |
| tree | 72bbf98d9bdd4d394e588fc49855be211baaab78 | |
| parent | 1bb412afcd5d416bec002ea882b797499e60417c (diff) | |
improve tmpdir for termux
| -rw-r--r-- | core/prefix.mak | 3 | ||||
| -rw-r--r-- | makefile | 3 | ||||
| -rw-r--r-- | 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 @@ -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 |
