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