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)
|
2018-07-10 18:36:37 +02:00
|
|
|
LUA_VERSION = 5.3.5
|
2015-01-16 22:09:50 +01:00
|
|
|
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
|
2017-10-21 22:54:57 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_LUA_5_2)$(BR2_PACKAGE_LUA_5_3),y)
|
2014-09-13 01:22:36 +02:00
|
|
|
LUA_LICENSE_FILES = doc/readme.html
|
2017-10-21 22:54:57 +02:00
|
|
|
else
|
|
|
|
LUA_LICENSE_FILES = COPYRIGHT
|
2014-09-13 01:22:36 +02:00
|
|
|
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-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
|
2016-10-17 18:06:17 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) \
|
2010-08-22 08:01:55 +02:00
|
|
|
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" \
|
2017-05-08 16:28:26 +02:00
|
|
|
MYLDFLAGS="$(TARGET_LDFLAGS)" \
|
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
|
2017-08-21 18:37:23 +02:00
|
|
|
sed -e "s/@VERSION@/$(LUA_VERSION)/;s/@ABI@/$(LUAINTERPRETER_ABIVER)/;s/@MYLIBS@/$(LUA_MYLIBS)/" \
|
|
|
|
package/lua/lua.pc.in > $(@D)/lua.pc
|
2010-04-29 23:03:45 +02:00
|
|
|
endef
|
|
|
|
|
2012-01-26 18:42:17 +01:00
|
|
|
define HOST_LUA_BUILD_CMDS
|
2016-10-17 18:06:18 +02:00
|
|
|
$(HOST_MAKE_ENV) $(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
|
2017-08-21 18:37:23 +02:00
|
|
|
sed -e "s/@VERSION@/$(LUA_VERSION)/;s/@ABI@/$(LUAINTERPRETER_ABIVER)/;s/@MYLIBS@/$(HOST_LUA_MYLIBS)/" \
|
|
|
|
package/lua/lua.pc.in > $(@D)/lua.pc
|
2012-01-26 18:42:17 +01:00
|
|
|
endef
|
|
|
|
|
2010-04-29 23:03:45 +02:00
|
|
|
define LUA_INSTALL_STAGING_CMDS
|
2016-10-17 18:06:17 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) INSTALL_TOP="$(STAGING_DIR)/usr" -C $(@D) install
|
2017-08-21 18:37:23 +02:00
|
|
|
$(INSTALL) -m 0644 -D $(@D)/lua.pc \
|
|
|
|
$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc
|
2010-04-29 23:03:45 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define LUA_INSTALL_TARGET_CMDS
|
2016-10-17 18:06:17 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(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
|
2017-07-05 13:14:24 +02:00
|
|
|
$(HOST_MAKE_ENV) $(MAKE) INSTALL_TOP="$(HOST_DIR)" -C $(@D) install
|
2017-08-21 18:37:23 +02:00
|
|
|
$(INSTALL) -m 0644 -D $(@D)/lua.pc \
|
|
|
|
$(HOST_DIR)/lib/pkgconfig/lua.pc
|
2012-01-26 18:42:17 +01:00
|
|
|
endef
|
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(generic-package))
|
2012-07-03 00:06:54 +02:00
|
|
|
$(eval $(host-generic-package))
|