diff --git a/package/micropython/Config.in b/package/micropython/Config.in index b5dc47279d..30161c8b70 100644 --- a/package/micropython/Config.in +++ b/package/micropython/Config.in @@ -2,7 +2,6 @@ config BR2_PACKAGE_MICROPYTHON bool "micropython" depends on BR2_TOOLCHAIN_HAS_THREADS depends on !BR2_STATIC_LIBS - select BR2_PACKAGE_LIBFFI help Micro Python is a lean and fast implementation of the Python 3 programming language that is optimised to run on a diff --git a/package/micropython/micropython.mk b/package/micropython/micropython.mk index 41bd32099b..37c148da94 100644 --- a/package/micropython/micropython.mk +++ b/package/micropython/micropython.mk @@ -12,7 +12,7 @@ MICROPYTHON_SOURCE = micropython-$(MICROPYTHON_VERSION).tar.xz # and most of the copied code is not used in the unix build. MICROPYTHON_LICENSE = MIT, BSD-1-Clause, BSD-3-Clause, Zlib MICROPYTHON_LICENSE_FILES = LICENSE -MICROPYTHON_DEPENDENCIES = host-pkgconf libffi host-python3 +MICROPYTHON_DEPENDENCIES = host-python3 MICROPYTHON_CPE_ID_VENDOR = micropython # Use fallback implementation for exception handling on architectures that don't @@ -36,6 +36,13 @@ MICROPYTHON_MAKE_OPTS += \ LDFLAGS_EXTRA="$(TARGET_LDFLAGS)" \ CWARN= +ifeq ($(BR2_PACKAGE_LIBFFI),y) +MICROPYTHON_DEPENDENCIES += host-pkgconf libffi +MICROPYTHON_MAKE_OPTS += MICROPY_PY_FFI=1 +else +MICROPYTHON_MAKE_OPTS += MICROPY_PY_FFI=0 +endif + define MICROPYTHON_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/mpy-cross $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/ports/unix \