summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2018-09-09 02:40:51 +0300
committerDamien George <damien.p.george@gmail.com>2018-10-19 17:22:37 +1100
commit6ddcfe68b8f6378ac5a233052dec876582ea0b75 (patch)
tree8750771af07c14e9806d2d925ec55262b6ed0465
parent5f7088f84dc491c006fcf6262d89096a8e2ffc44 (diff)
unix/Makefile: Allow to override/omit pthread lib name.
For example, on Android, pthread functions are part of libc, so LIBPTHREAD should be empty.
-rw-r--r--ports/unix/Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/ports/unix/Makefile b/ports/unix/Makefile
index dc80af69f..badfac7c8 100644
--- a/ports/unix/Makefile
+++ b/ports/unix/Makefile
@@ -76,6 +76,9 @@ LDFLAGS_ARCH = -Wl,-Map=$@.map,--cref -Wl,--gc-sections
endif
LDFLAGS = $(LDFLAGS_MOD) $(LDFLAGS_ARCH) -lm $(LDFLAGS_EXTRA)
+# Flags to link with pthread library
+LIBPTHREAD = -lpthread
+
ifeq ($(MICROPY_FORCE_32BIT),1)
# Note: you may need to install i386 versions of dependency packages,
# starting with linux-libc-dev:i386
@@ -101,7 +104,7 @@ SRC_MOD += modusocket.c
endif
ifeq ($(MICROPY_PY_THREAD),1)
CFLAGS_MOD += -DMICROPY_PY_THREAD=1 -DMICROPY_PY_THREAD_GIL=0
-LDFLAGS_MOD += -lpthread
+LDFLAGS_MOD += $(LIBPTHREAD)
endif
ifeq ($(MICROPY_PY_FFI),1)