LUAROCKS_LICENSE = MIT
LUAROCKS_LICENSE_FILES = COPYING
-HOST_LUAROCKS_DEPENDENCIES = host-lua
+HOST_LUAROCKS_DEPENDENCIES = host-luainterpreter
LUAROCKS_CONFIG_DIR = $(HOST_DIR)/usr/etc/luarocks
LUAROCKS_CONFIG_FILE = $(LUAROCKS_CONFIG_DIR)/config-$(LUAINTERPRETER_ABIVER).lua
+HOST_LUAROCKS_CONF_OPT = \
+ --prefix=$(HOST_DIR)/usr \
+ --sysconfdir=$(LUAROCKS_CONFIG_DIR) \
+ --with-lua=$(HOST_DIR)/usr
+
+ifeq ($(BR2_PACKAGE_LUAJIT),y)
+HOST_LUAROCKS_CONF_OPT += --lua-suffix=jit
+endif
+
define HOST_LUAROCKS_CONFIGURE_CMDS
- cd $(@D) && ./configure \
- --prefix=$(HOST_DIR)/usr \
- --sysconfdir=$(LUAROCKS_CONFIG_DIR) \
- --with-lua=$(HOST_DIR)/usr
+ cd $(@D) && ./configure $(HOST_LUAROCKS_CONF_OPT)
endef
define HOST_LUAROCKS_INSTALL_CMDS
$(eval $(host-generic-package))
LUAROCKS_RUN = LUA_PATH="$(HOST_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/?.lua" \
- $(HOST_DIR)/usr/bin/lua $(HOST_DIR)/usr/bin/luarocks
+ $(LUA_RUN) $(HOST_DIR)/usr/bin/luarocks