summaryrefslogtreecommitdiffstats
path: root/package/lua
diff options
context:
space:
mode:
Diffstat (limited to 'package/lua')
-rw-r--r--package/lua/Config.in11
-rw-r--r--package/lua/lua.mk8
2 files changed, 19 insertions, 0 deletions
diff --git a/package/lua/Config.in b/package/lua/Config.in
index dde999f2c8..d9f85e2c93 100644
--- a/package/lua/Config.in
+++ b/package/lua/Config.in
@@ -33,6 +33,17 @@ config BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION
default "5.2" if BR2_PACKAGE_LUA_5_2
default "5.3" if BR2_PACKAGE_LUA_5_3
+if BR2_PACKAGE_LUA_5_3
+config BR2_PACKAGE_LUA_32BITS
+ bool "Use 32 bit numbers"
+ default y if !BR2_ARCH_IS_64
+ help
+ Use a 32 bit data type for numbers / integers instead of the
+ default 64 bit type. This option is particularly attractive
+ for small machines and embedded systems.
+
+endif
+
choice
prompt "Lua command-line editing"
default BR2_PACKAGE_LUA_EDITING_NONE
diff --git a/package/lua/lua.mk b/package/lua/lua.mk
index 0e30186ebf..f008d3495a 100644
--- a/package/lua/lua.mk
+++ b/package/lua/lua.mk
@@ -58,6 +58,14 @@ ifneq ($(BR2_LARGEFILE),y)
LUA_CFLAGS += -D_FILE_OFFSET_BITS=32
endif
+ifeq ($(BR2_PACKAGE_LUA_32BITS),y)
+define LUA_32BITS_LUACONF
+ $(SED) 's/\/\* #define LUA_32BITS \*\//#define LUA_32BITS/' $(@D)/src/luaconf.h
+endef
+
+LUA_POST_PATCH_HOOKS += LUA_32BITS_LUACONF
+endif
+
# We never want to have host-readline and host-ncurses as dependencies
# of host-lua.
HOST_LUA_DEPENDENCIES =
OpenPOWER on IntegriCloud