[Buildroot] [PATCH] micropython: new package

Vicente Olivert Riera Vincent.Riera at imgtec.com
Mon Sep 14 13:40:10 UTC 2015


Dear Chris Packham,

more comments:

On 09/14/2015 11:21 AM, Chris Packham wrote:
> diff --git a/package/micropython/micropython.mk b/package/micropython/micropython.mk
> new file mode 100644
> index 0000000..9b5e7d2
> --- /dev/null
> +++ b/package/micropython/micropython.mk
> @@ -0,0 +1,22 @@
> +################################################################################
> +# micropython
> +################################################################################
> +MICROPYTHON_VERSION = v1.4.5
> +MICROPYTHON_SITE = $(call github,micropython,micropython,$(MICROPYTHON_VERSION))
> +MICROPYTHON_LICENSE = MIT
> +MICROPYTHON_LICENSE_FILES = LICENSE
> +MICROPYTHON_DEPENDENCIES = libffi

micropython calls pkg-config in order to obtain the libraries and cflags
for libffi:

ifeq ($(MICROPY_PY_FFI),1)
LIBFFI_LDFLAGS_MOD := $(shell pkg-config --libs libffi)
LIBFFI_CFLAGS_MOD := $(shell pkg-config --cflags libffi)
CFLAGS_MOD += $(LIBFFI_CFLAGS_MOD) -DMICROPY_PY_FFI=1

So please, add host-pkgconf to MICROPYTHON_DEPENDENCIES. Otherwise it
will fail to compile with an error like this one:

LINK micropython
build/modffi.o: In function `ffifunc_call':
modffi.c:(.text+0x24c): undefined reference to `ffi_call'
modffi.c:(.text+0x260): undefined reference to `ffi_call'
build/modffi.o: In function `mod_ffi_callback':
modffi.c:(.text+0x7b0): undefined reference to `ffi_closure_alloc'
... and many more

> +
> +ifeq ($(BR2_powerpc),y)
> +MICROPYTHON_CFLAGS = -DMICROPY_GCREGS_SETJMP=1
> +endif
> +
> +define MICROPYTHON_INSTALL_TARGET_CMDS
> +	$(MAKE) -C $(@D)/unix \

Please add $(TARGET_MAKE_ENV) before $(MAKE). You need that in order to
Buildroot set the PATH variable so the pkg-config executable and the
libffi.pc file can be found.

Regards,

Vincent.

> +		CROSS_COMPILE=$(TARGET_CROSS) \
> +		DESTDIR=$(TARGET_DIR) \
> +		CFLAGS_EXTRA=$(MICROPYTHON_CFLAGS) \
> +		install
> +endef
> +
> +$(eval $(generic-package))
> 



More information about the buildroot mailing list