aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile31
1 files changed, 30 insertions, 1 deletions
diff --git a/makefile b/makefile
index d7e85d3..acdeb1b 100644
--- a/makefile
+++ b/makefile
@@ -54,13 +54,42 @@ endif
54 INCLUDES += -I $(SRC_PATH)/3rdParty/lua 54 INCLUDES += -I $(SRC_PATH)/3rdParty/lua
55 LINK_FLAGS += -L $(SRC_PATH)/3rdParty/lua -llua -ldl 55 LINK_FLAGS += -L $(SRC_PATH)/3rdParty/lua -llua -ldl
56endif 56endif
57
58# Detect Android Termux environment
59# Termux typically has ANDROID_ROOT environment variable set and PREFIX points to Termux directory
60IS_TERMUX := false
61ANDROID_ROOT_VAR := $(shell echo $$ANDROID_ROOT)
62PREFIX_VAR := $(shell echo $$PREFIX)
63ifneq ($(ANDROID_ROOT_VAR),)
64 # Check if PREFIX environment variable points to Termux directory
65 ifneq ($(PREFIX_VAR),)
66 ifneq ($(findstring com.termux,$(PREFIX_VAR)),)
67 IS_TERMUX := true
68 endif
69 endif
70 # Alternative check: verify if Termux installation path exists
71 ifeq ($(IS_TERMUX),false)
72 ifneq ($(shell test -d /data/data/com.termux/files/usr && echo yes),)
73 IS_TERMUX := true
74 endif
75 endif
76endif
77
78# Auto-set NO_WATCHER for Termux environment if not explicitly set
79ifeq ($(IS_TERMUX),true)
80 ifeq ($(NO_WATCHER),)
81 NO_WATCHER := true
82 $(info Detected Android Termux environment, automatically setting NO_WATCHER=true)
83 endif
84endif
85
57ifeq ($(NO_WATCHER),true) 86ifeq ($(NO_WATCHER),true)
58 COMPILE_FLAGS += -DYUE_NO_WATCHER 87 COMPILE_FLAGS += -DYUE_NO_WATCHER
59endif 88endif
60 89
61# Add platform related linker flag 90# Add platform related linker flag
62ifneq ($(UNAME_S),Darwin) 91ifneq ($(UNAME_S),Darwin)
63 LINK_FLAGS += -lstdc++fs -Wl,-E 92 LINK_FLAGS += -Wl,-E
64 PLAT = linux 93 PLAT = linux
65else 94else
66 LINK_FLAGS += -framework CoreFoundation -framework CoreServices 95 LINK_FLAGS += -framework CoreFoundation -framework CoreServices