2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2007-11-30 02:08:36 +01:00
|
|
|
#
|
|
|
|
# lua
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2007-11-30 02:08:36 +01:00
|
|
|
|
2015-01-16 22:09:50 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_LUA_5_3),y)
|
|
|
|
LUA_VERSION = 5.3.0
|
|
|
|
else
|
2014-01-17 18:47:35 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_LUA_5_2),y)
|
2015-03-08 11:56:16 +01:00
|
|
|
LUA_VERSION = 5.2.4
|
2014-01-17 18:47:35 +01:00
|
|
|
else
|
2012-07-14 15:11:59 +02:00
|
|
|
LUA_VERSION = 5.1.5
|
2014-01-17 18:47:35 +01:00
|
|
|
endif
|
2015-01-16 22:09:50 +01:00
|
|
|
endif
|
2010-04-29 23:03:45 +02:00
|
|
|
LUA_SITE = http://www.lua.org/ftp
|
|
|
|
LUA_INSTALL_STAGING = YES
|
2012-08-03 04:53:49 +02:00
|
|
|
LUA_LICENSE = MIT
|
2014-09-13 01:22:36 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_LUA_5_1),y)
|
2012-08-03 04:53:49 +02:00
|
|
|
LUA_LICENSE_FILES = COPYRIGHT
|
2014-09-13 01:22:36 +02:00
|
|
|
else
|
|
|
|
LUA_LICENSE_FILES = doc/readme.html
|
|
|
|
endif
|
2007-11-30 02:08:36 +01:00
|
|
|
|
2014-05-15 19:37:05 +02:00
|
|
|
LUA_PROVIDES = luainterpreter
|
|
|
|
|
2014-02-26 11:03:16 +01:00
|
|
|
LUA_CFLAGS = -Wall -fPIC -DLUA_USE_POSIX
|
2012-03-11 15:24:56 +01:00
|
|
|
|
2014-01-17 18:47:35 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_LUA_5_2),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
LUA_CFLAGS += -DLUA_COMPAT_ALL
|
2014-01-17 18:47:35 +01:00
|
|
|
endif
|
2015-01-16 22:09:50 +01:00
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_LUA_5_3),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
LUA_CFLAGS += -DLUA_COMPAT_5_2
|
2014-01-17 18:47:35 +01:00
|
|
|
endif
|
|
|
|
|
2014-12-03 22:41:29 +01:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
LUA_BUILDMODE = static
|
2014-02-26 11:03:16 +01:00
|
|
|
else
|
2015-03-31 09:21:57 +02:00
|
|
|
LUA_BUILDMODE = dynamic
|
|
|
|
LUA_CFLAGS += -DLUA_USE_DLOPEN
|
|
|
|
LUA_MYLIBS += -ldl
|
2014-02-26 11:03:16 +01:00
|
|
|
endif
|
|
|
|
|
2014-04-05 17:21:43 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_LUA_READLINE),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
LUA_DEPENDENCIES = readline ncurses
|
|
|
|
LUA_MYLIBS += -lreadline -lhistory -lncurses
|
|
|
|
LUA_CFLAGS += -DLUA_USE_READLINE
|
2012-12-03 07:12:14 +01:00
|
|
|
else
|
2014-04-05 17:21:43 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_LUA_LINENOISE),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
LUA_DEPENDENCIES = linenoise
|
|
|
|
LUA_MYLIBS += -llinenoise
|
|
|
|
LUA_CFLAGS += -DLUA_USE_LINENOISE
|
2010-04-29 23:03:45 +02:00
|
|
|
endif
|
2012-12-03 07:12:14 +01:00
|
|
|
endif
|
2007-11-30 02:08:36 +01:00
|
|
|
|
2015-01-16 22:09:52 +01:00
|
|
|
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
|
|
|
|
|
2012-07-20 14:40:18 +02:00
|
|
|
# We never want to have host-readline and host-ncurses as dependencies
|
|
|
|
# of host-lua.
|
|
|
|
HOST_LUA_DEPENDENCIES =
|
2012-07-18 15:59:12 +02:00
|
|
|
HOST_LUA_CFLAGS = -Wall -fPIC -DLUA_USE_DLOPEN -DLUA_USE_POSIX
|
2012-01-26 18:42:17 +01:00
|
|
|
HOST_LUA_MYLIBS = -ldl
|
|
|
|
|
2010-04-29 23:03:45 +02:00
|
|
|
define LUA_BUILD_CMDS
|
2010-08-22 08:01:55 +02:00
|
|
|
$(MAKE) \
|
|
|
|
CC="$(TARGET_CC)" RANLIB="$(TARGET_RANLIB)" \
|
2012-07-18 15:59:12 +02:00
|
|
|
CFLAGS="$(TARGET_CFLAGS) $(LUA_CFLAGS)" \
|
2010-04-29 23:03:45 +02:00
|
|
|
MYLIBS="$(LUA_MYLIBS)" AR="$(TARGET_CROSS)ar rcu" \
|
2014-02-26 11:03:16 +01:00
|
|
|
BUILDMODE=$(LUA_BUILDMODE) \
|
2010-04-29 23:03:45 +02:00
|
|
|
PKG_VERSION=$(LUA_VERSION) -C $(@D)/src all
|
|
|
|
endef
|
|
|
|
|
2012-01-26 18:42:17 +01:00
|
|
|
define HOST_LUA_BUILD_CMDS
|
|
|
|
$(MAKE) \
|
2012-07-18 15:59:12 +02:00
|
|
|
CFLAGS="$(HOST_LUA_CFLAGS)" \
|
2013-06-20 09:33:47 +02:00
|
|
|
MYLDFLAGS="$(HOST_LDFLAGS)" \
|
2012-01-26 18:42:17 +01:00
|
|
|
MYLIBS="$(HOST_LUA_MYLIBS)" \
|
2014-02-26 11:03:16 +01:00
|
|
|
BUILDMODE=static \
|
2012-01-26 18:42:17 +01:00
|
|
|
PKG_VERSION=$(LUA_VERSION) -C $(@D)/src all
|
|
|
|
endef
|
|
|
|
|
2010-04-29 23:03:45 +02:00
|
|
|
define LUA_INSTALL_STAGING_CMDS
|
2014-02-26 11:03:15 +01:00
|
|
|
$(MAKE) INSTALL_TOP="$(STAGING_DIR)/usr" -C $(@D) install
|
2010-04-29 23:03:45 +02:00
|
|
|
$(INSTALL) -m 0644 -D $(@D)/etc/lua.pc \
|
2010-05-02 23:22:45 +02:00
|
|
|
$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc
|
2010-04-29 23:03:45 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define LUA_INSTALL_TARGET_CMDS
|
2014-02-26 11:03:15 +01:00
|
|
|
$(MAKE) INSTALL_TOP="$(TARGET_DIR)/usr" -C $(@D) install
|
2010-04-29 23:03:45 +02:00
|
|
|
endef
|
|
|
|
|
2012-01-26 18:42:17 +01:00
|
|
|
define HOST_LUA_INSTALL_CMDS
|
2014-02-26 11:03:15 +01:00
|
|
|
$(MAKE) INSTALL_TOP="$(HOST_DIR)/usr" -C $(@D) install
|
2012-01-26 18:42:17 +01:00
|
|
|
$(INSTALL) -m 0644 -D $(@D)/etc/lua.pc \
|
|
|
|
$(HOST_DIR)/usr/lib/pkgconfig/lua.pc
|
|
|
|
endef
|
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(generic-package))
|
2012-07-03 00:06:54 +02:00
|
|
|
$(eval $(host-generic-package))
|