diff options
| author | ruki <[email protected]> | 2020-02-28 22:58:23 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-02-28 11:50:23 +0800 |
| commit | 9fe4b550970a66fbfebff7c97baf7ef418dd0c8d (patch) | |
| tree | 50e708b8cc30d96d88b44ba59b67c44ec501dd7b | |
| parent | 75e37c2f401c6547b417b157d7666dee293101e7 (diff) | |
fix makefile for termux/ci
| -rw-r--r-- | core/makefile | 11 | ||||
| -rw-r--r-- | core/plat/linux/prefix.mak | 18 | ||||
| -rw-r--r-- | makefile | 7 |
3 files changed, 25 insertions, 11 deletions
diff --git a/core/makefile b/core/makefile index 5105a95d3..c777aea70 100644 --- a/core/makefile +++ b/core/makefile @@ -176,11 +176,16 @@ ARCH :=$(if $(findstring x64,$(ARCH)),x86_64,$(ARCH)) # for arm linux? ifeq ($(PLAT),linux) -ARCHSTR := $(shell uname -m) +ifneq ($(TERMUX_ARCH),) +ARCHSTR := $(TERMUX_ARCH) # on termux/ci +else +ARCHSTR := $(shell uname -m) # on arm device, e.g. termux app +endif ARCH := $(if $(findstring aarch64,$(ARCHSTR)),arm64,$(ARCH)) ARCH := $(if $(findstring arm64,$(ARCHSTR)),arm64,$(ARCH)) ARCH := $(if $(findstring armv7,$(ARCHSTR)),armv7,$(ARCH)) ARCH := $(if $(findstring arm,$(ARCHSTR)),arm,$(ARCH)) +ARCH := $(if $(findstring i686,$(ARCHSTR)),i386,$(ARCH)) endif endif @@ -279,8 +284,12 @@ base_LIBPATH := base_LIBNAMES := base_LIBNAMES += $(shell if { cat detect/curses.c | $(CC) -xc - -lcurses -ltinfo -o /dev/null 2>/dev/null; }; then echo curses tinfo; fi ) base_LIBNAMES += $(shell if { cat detect/readline.c | $(CC) -xc - -lreadline -o /dev/null 2>/dev/null; }; then echo readline; fi ) +ifneq ($(TERMUX_ARCH),) # on termux/ci? +base_LIBNAMES += m dl +else base_LIBNAMES += m dl pthread endif +endif # check jit compiler ifeq ($(PLAT),linux) diff --git a/core/plat/linux/prefix.mak b/core/plat/linux/prefix.mak index 663e31210..9a38121f3 100644 --- a/core/plat/linux/prefix.mak +++ b/core/plat/linux/prefix.mak @@ -19,12 +19,12 @@ ASM_SUFFIX = .S PRE_ := $(if $(BIN),$(BIN)/$(PRE),) # tool -CC = $(PRE_)gcc -LD = $(PRE_)gcc -AR = $(PRE_)ar -STRIP = $(PRE_)strip -RANLIB = $(PRE_)ranlib -AS = $(CC) +CC := $(if $(CC),$(CC),$(PRE_)gcc) +LD := $(if $(CC),$(CC),$(PRE_)gcc) # we do not use ld directly +AR := $(if $(AR),$(AR),$(PRE_)ar) +STRIP := $(if $(STRIP),$(STRIP),$(PRE_)strip) +RANLIB := $(if $(RANLIB),$(RANLIB),$(PRE_)ranlib) +AS := $(CC) RM = rm -f RMDIR = rm -rf CP = cp @@ -79,7 +79,7 @@ endif # cflags: .c files CFLAGS_RELEASE = CFLAGS_DEBUG = -CFLAGS = \ +CFLAGS := $(CFLAGS) \ -std=gnu99 \ -D_GNU_SOURCE=1 -D_REENTRANT \ -fno-math-errno @@ -87,12 +87,12 @@ CFLAGS = \ # ccflags: .cc/.cpp files CCFLAGS_RELEASE = -fno-rtti CCFLAGS_DEBUG = -CCFLAGS = -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 +CCFLAGS := $(CXXFLAGS) -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 # ldflags LDFLAGS_RELEASE = LDFLAGS_DEBUG = -rdynamic -LDFLAGS = $(AHFLAGS) $(LDFLAGS_CHECK) +LDFLAGS := $(LDFLAGS) $(AHFLAGS) $(LDFLAGS_CHECK) LDFLAGS-L = -L LDFLAGS-l = -l LDFLAGS-f = @@ -51,11 +51,16 @@ ARCH :=$(if $(findstring x64,$(ARCH)),x86_64,$(ARCH)) # for arm linux? ifeq ($(PLAT),linux) -ARCHSTR := $(shell uname -m) +ifneq ($(TERMUX_ARCH),) +ARCHSTR := $(TERMUX_ARCH) # on termux/ci +else +ARCHSTR := $(shell uname -m) # on arm device, e.g. termux app +endif ARCH := $(if $(findstring aarch64,$(ARCHSTR)),arm64,$(ARCH)) ARCH := $(if $(findstring arm64,$(ARCHSTR)),arm64,$(ARCH)) ARCH := $(if $(findstring armv7,$(ARCHSTR)),armv7,$(ARCH)) ARCH := $(if $(findstring arm,$(ARCHSTR)),arm,$(ARCH)) +ARCH := $(if $(findstring i686,$(ARCHSTR)),i386,$(ARCH)) endif endif |
