libuci: Lua binding needs mmu and version 5.1
authorYegor Yefremov <yegorslists@googlemail.com>
Sat, 5 Apr 2014 14:36:57 +0000 (16:36 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 5 Apr 2014 17:06:41 +0000 (19:06 +0200)
The Lua binding option of libuci uses fork() so it needs the MMU.

Finally, libuci fails to build with Lua 5.2 because it uses functions
removed from this version. Fix it by activating the option only with
Lua 5.1.

[Thomas: use LIBUCI_ and not LIBUBOX_ otherwise the patch doesn't
work.]

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/libuci/libuci.mk

index 736b94689ad85cac8fb64513db783561af29610f..a7d3a809d47e91f6a87caef7b2da31925be2c39d 100644 (file)
@@ -10,10 +10,14 @@ LIBUCI_LICENSE = LGPLv2.1
 LIBUCI_INSTALL_STAGING = YES
 LIBUCI_DEPENDENCIES = libubox
 
-ifeq ($(BR2_PACKAGE_LUA),y)
-       LIBUCI_DEPENDENCIES += lua
+ifeq ($(BR2_USE_MMU),y) # fork()
+ifeq ($(BR2_PACKAGE_LUA_5_1),y)
+LIBUCI_DEPENDENCIES += lua
+LIBUCI_CONF_OPT += -DLUAPATH=$(STAGING_DIR)/usr/lib/lua/5.1 \
+       -DLUA_CFLAGS=-I$(STAGING_DIR)/usr/include
 else
-       LIBUCI_CONF_OPT += -DBUILD_LUA:BOOL=OFF
+LIBUCI_CONF_OPT += -DBUILD_LUA:BOOL=OFF
 endif
+endif # MMU
 
 $(eval $(cmake-package))