From 793838a919c9cb848cb8c3f2d88d8b347bfd6083 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 27 Feb 2014 18:10:40 +0200 Subject: [PATCH] MICROPY_USE_READLINE: Selects link lib, so should be defined in mpconfigport.mk This change allows to build unix version without libreadline installed. --- unix/Makefile | 9 ++++++--- unix/mpconfigport.h | 5 ----- unix/mpconfigport.mk | 5 ++++- 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