package/luajit: add option to enable Lua 5.2 compatibility

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
[Thomas: formatting tweaks.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Francois Perrad 2018-12-08 09:00:52 +01:00 committed by Thomas Petazzoni
parent 4e42366939
commit 8c2bc94547
2 changed files with 11 additions and 0 deletions

View File

@ -36,6 +36,11 @@ config BR2_PACKAGE_PROVIDES_LUAINTERPRETER
config BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION
default "5.1"
config BR2_PACKAGE_LUAJIT_COMPAT52
bool "Lua 5.2 compatibility"
help
Compile with Lua 5.2 compatibility.
endif
comment "luajit needs a toolchain w/ dynamic library"

View File

@ -14,6 +14,10 @@ LUAJIT_INSTALL_STAGING = YES
LUAJIT_PROVIDES = luainterpreter
ifeq ($(BR2_PACKAGE_LUAJIT_COMPAT52),y)
LUAJIT_XCFLAGS += -DLUAJIT_ENABLE_LUA52COMPAT
endif
ifeq ($(BR2_STATIC_LIBS),y)
LUAJIT_BUILDMODE = static
else
@ -48,6 +52,7 @@ define LUAJIT_BUILD_CMDS
HOST_CFLAGS="$(HOST_CFLAGS)" \
HOST_LDFLAGS="$(HOST_LDFLAGS)" \
BUILDMODE=$(LUAJIT_BUILDMODE) \
XCFLAGS=$(LUAJIT_XCFLAGS) \
-C $(@D) amalg
endef
@ -68,6 +73,7 @@ LUAJIT_POST_INSTALL_TARGET_HOOKS += LUAJIT_INSTALL_SYMLINK
define HOST_LUAJIT_BUILD_CMDS
$(HOST_MAKE_ENV) $(MAKE) PREFIX="$(HOST_DIR)" BUILDMODE=dynamic \
TARGET_LDFLAGS="$(HOST_LDFLAGS)" \
XCFLAGS=$(LUAJIT_XCFLAGS) \
-C $(@D) amalg
endef