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
|
|
|
|
2014-01-17 18:47:35 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_LUA_5_2),y)
|
|
|
|
LUA_VERSION = 5.2.3
|
|
|
|
else
|
2012-07-14 15:11:59 +02:00
|
|
|
LUA_VERSION = 5.1.5
|
2014-01-17 18:47:35 +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
|
|
|
|
LUA_LICENSE_FILES = COPYRIGHT
|
2007-11-30 02:08:36 +01:00
|
|
|
|
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)
|
|
|
|
LUA_CFLAGS += -DLUA_COMPAT_ALL
|
|
|
|
ifneq ($(BR2_LARGEFILE),y)
|
|
|
|
LUA_CFLAGS += -D_FILE_OFFSET_BITS=32
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2014-02-26 11:03:16 +01:00
|
|
|
ifeq ($(BR2_PREFER_STATIC_LIB),y)
|
|
|
|
LUA_BUILDMODE = static
|
|
|
|
else
|
|
|
|
LUA_BUILDMODE = dynamic
|
|
|
|
LUA_CFLAGS += -DLUA_USE_DLOPEN
|
|
|
|
LUA_MYLIBS += -ldl
|
|
|
|
endif
|
|
|
|
|
2010-04-29 23:03:45 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_LUA_INTERPRETER_READLINE),y)
|
|
|
|
LUA_DEPENDENCIES = readline ncurses
|
|
|
|
LUA_MYLIBS += -lreadline -lhistory -lncurses
|
2014-02-26 11:03:16 +01:00
|
|
|
LUA_CFLAGS += -DLUA_USE_READLINE
|
2012-12-03 07:12:14 +01:00
|
|
|
else
|
|
|
|
ifeq ($(BR2_PACKAGE_LUA_INTERPRETER_LINENOISE),y)
|
|
|
|
LUA_DEPENDENCIES = linenoise
|
|
|
|
LUA_MYLIBS += -llinenoise
|
2014-02-26 11:03:16 +01:00
|
|
|
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
|
|
|
|
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
|
|
|
|
|
2014-01-17 18:47:35 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_LUA_5_2),y)
|
|
|
|
HOST_LUA_CFLAGS += -DLUA_COMPAT_ALL
|
|
|
|
endif
|
|
|
|
|
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))
|