forked from WHC/Hermit
Termux: build with make, install to $PREFIX, no nl_langinfo on Android
- bootstrap_termux.sh installs pkg-config/binutils, builds with make, runs the tests and installs into Termux's $PREFIX/bin. - Makefile drops -lpthread on Android (pthreads are in bionic libc). - TUI assumes UTF-8 on Android: nl_langinfo needs API 26, Termux targets 24. All sources compile for aarch64-linux-android24 (NDK 27).
This commit is contained in:
@@ -6,6 +6,13 @@ PKG_CONFIG ?= pkg-config
|
||||
PREFIX ?= /usr/local
|
||||
DESTDIR ?=
|
||||
UNAME_S := $(shell uname -s 2>/dev/null)
|
||||
UNAME_O := $(shell uname -o 2>/dev/null)
|
||||
|
||||
# Android (Termux): pthreads live in libc.
|
||||
PTHREAD_LIBS := -lpthread
|
||||
ifeq ($(UNAME_O),Android)
|
||||
PTHREAD_LIBS :=
|
||||
endif
|
||||
|
||||
# macOS: Homebrew ncurses/curl are keg-only, so point pkg-config at them.
|
||||
# (macOS ships GNU make 3.81, whose $(shell) ignores exported variables.)
|
||||
@@ -41,7 +48,7 @@ PKG_LIBS := $(CURL_LIBS) $(CURSES_LIBS)
|
||||
|
||||
CPPFLAGS += -Iinclude -I$(SD_DIR)/include -I$(CJSON_DIR) -D_XOPEN_SOURCE_EXTENDED $(PKG_CFLAGS)
|
||||
LDFLAGS += -L$(SD_DIR)
|
||||
LDLIBS += -lsashidown -lm $(PKG_LIBS) -lpthread
|
||||
LDLIBS += -lsashidown -lm $(PKG_LIBS) $(PTHREAD_LIBS)
|
||||
|
||||
CORE_SRC = \
|
||||
$(CJSON_DIR)/cJSON.c \
|
||||
@@ -91,7 +98,7 @@ TESTS = \
|
||||
tests/test_undo \
|
||||
tests/test_config
|
||||
|
||||
TEST_LIBS = -lm $(CURL_LIBS) -lpthread
|
||||
TEST_LIBS = -lm $(CURL_LIBS) $(PTHREAD_LIBS)
|
||||
|
||||
.PHONY: all clean check demo sashidown-lib cmake-gcc cmake-clang asan install uninstall
|
||||
|
||||
|
||||
Reference in New Issue
Block a user