lua: add option 32bits
authorFrancois Perrad <fperrad@gmail.com>
Fri, 16 Jan 2015 21:09:52 +0000 (22:09 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 2 Feb 2015 15:09:46 +0000 (16:09 +0100)
[Peter: tweak config/help text]
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/lua/Config.in
package/lua/lua.mk
package/luabitop/Config.in

index dde999f2c8867803a31f7fcffce9877a23ba18de..d9f85e2c9311ef404d39b8e2d2dc09df9436b75b 100644 (file)
@@ -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
index 0e30186ebfc8109e56c29422e7a14102e6677fd0..f008d3495af24c80d13621f9c1848713a95f1377 100644 (file)
@@ -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 =
index 83a85b16cd4711aae56c87309a4d4339127fc4f0..c5b3f602bdd2cb0e37c80418e45819fb4ed60819 100644 (file)
@@ -1,7 +1,11 @@
 config BR2_PACKAGE_LUABITOP
        bool "luabitop"
+       depends on !BR2_PACKAGE_LUA_32BITS
        help
          Lua BitOp is a C extension module for Lua 5.1/5.2 which adds bitwise
          operations on numbers.
 
          http://bitop.luajit.org
+
+comment "luabitop needs a full Lua interpreter"
+       depends on BR2_PACKAGE_LUA_32BITS