File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11include ../py/mkenv.mk
2+ -include mpconfigport.mk
23
34# define main target
45PROG = micropython
@@ -10,9 +11,16 @@ QSTR_DEFS = qstrdefsport.h
1011include ../py/py.mk
1112
1213# compiler settings
13- CFLAGS = -I. -I$(PY_SRC ) -Wall -Werror -ansi -std=gnu99 -DUNIX
14- CFLAGS += -I/usr/lib/libffi-3.0.13/include
15- LDFLAGS = -lm -ldl -lffi
14+ CFLAGS = -I. -I$(PY_SRC ) -Wall -Werror -ansi -std=gnu99 -DUNIX $(CFLAGS_MOD )
15+ LDFLAGS = $(LDFLAGS_MOD ) -lm
16+
17+ ifeq ($(MICROPY_MOD_FFI ) ,1)
18+ # Note - include path below is specific to @dpgeorge
19+ CFLAGS_MOD += -I/usr/lib/libffi-3.0.13/include -DMICROPY_MOD_FFI=1
20+ LDFLAGS_MOD += -ldl -lffi
21+ SRC_MOD += ffi.c
22+ endif
23+
1624
1725# Debugging/Optimization
1826ifdef DEBUG
@@ -26,7 +34,7 @@ SRC_C = \
2634 main.c \
2735 file.c \
2836 socket.c \
29- ffi.c \
37+ $( SRC_MOD )
3038
3139OBJ = $(PY_O ) $(addprefix $(BUILD ) /, $(SRC_C:.c=.o ) )
3240LIB = -lreadline
Original file line number Diff line number Diff line change @@ -242,7 +242,9 @@ int main(int argc, char **argv) {
242242
243243 file_init ();
244244 rawsocket_init ();
245+ #if MICROPY_MOD_FFI
245246 ffi_init ();
247+ #endif
246248
247249 // Here is some example code to create a class and instance of that class.
248250 // First is the Python, then the C code.
Original file line number Diff line number Diff line change 1+ # Enable/disable modules to be included in interpreter
2+
3+ # ffi module requires libffi (libffi-dev Debian package)
4+ MICROPY_MOD_FFI = 0
You can’t perform that action at this time.
0 commit comments