summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-02-27 18:10:40 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-02-28 11:09:29 +0200
commit793838a919c9cb848cb8c3f2d88d8b347bfd6083 (patch)
tree1e0fad7ffdda1cced753fa5b8e4d118f2cf7c82f
parent7ae69c6dc47be65fbc61140a00c38706ed880042 (diff)
downloadmicropython-793838a919c9cb848cb8c3f2d88d8b347bfd6083.tar.gz
micropython-793838a919c9cb848cb8c3f2d88d8b347bfd6083.zip
MICROPY_USE_READLINE: Selects link lib, so should be defined in mpconfigport.mk
This change allows to build unix version without libreadline installed.
-rw-r--r--unix/Makefile9
-rw-r--r--unix/mpconfigport.h5
-rw-r--r--unix/mpconfigport.mk5
3 files changed, 10 insertions, 9 deletions
diff --git a/unix/Makefile b/unix/Makefile
index 37583149cf..b0899ecac5 100644
--- a/unix/Makefile
+++ b/unix/Makefile
@@ -20,6 +20,12 @@ else
LDFLAGS = $(LDFLAGS_MOD) -lm -Wl,-Map=$@.map,--cref
endif
+ifeq ($(MICROPY_USE_READLINE),1)
+CFLAGS_MOD += -DMICROPY_USE_READLINE=1
+LDFLAGS_MOD += -lreadline
+# the following is needed for BSD
+#LDFLAGS_MOD += -ltermcap
+endif
ifeq ($(MICROPY_MOD_TIME),1)
CFLAGS_MOD += -DMICROPY_MOD_TIME=1
SRC_MOD += time.c
@@ -48,9 +54,6 @@ SRC_C = \
$(SRC_MOD)
OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
-LIB = -lreadline
-# the following is needed for BSD
-#LIB += -ltermcap
include ../py/mkrules.mk
diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h
index 456ec02d5b..99c13a7dc6 100644
--- a/unix/mpconfigport.h
+++ b/unix/mpconfigport.h
@@ -1,10 +1,5 @@
// options to control how Micro Python is built
-// Linking with GNU readline causes binary to be licensed under GPL
-#ifndef MICROPY_USE_READLINE
-#define MICROPY_USE_READLINE (1)
-#endif
-
#define MICROPY_EMIT_X64 (1)
#define MICROPY_EMIT_THUMB (0)
#define MICROPY_EMIT_INLINE_THUMB (0)
diff --git a/unix/mpconfigport.mk b/unix/mpconfigport.mk
index 6c7be237bc..d30be8b986 100644
--- a/unix/mpconfigport.mk
+++ b/unix/mpconfigport.mk
@@ -1,4 +1,7 @@
-# Enable/disable modules to be included in interpreter
+# Enable/disable modules and 3rd-party libs to be included in interpreter
+
+# Linking with GNU readline causes binary to be licensed under GPL
+MICROPY_USE_READLINE = 1
# Subset of CPython time module
MICROPY_MOD_TIME = 1