2008-04-13 01:06:12 +00:00
|
|
|
#
|
2009-04-04 23:06:56 +00:00
|
|
|
# Copyright (C) 2006-2009 OpenWrt.org
|
2008-04-13 01:06:12 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=lua
|
2008-08-24 15:45:26 +00:00
|
|
|
PKG_VERSION:=5.1.4
|
2009-04-04 23:06:56 +00:00
|
|
|
PKG_RELEASE:=4
|
2008-04-13 01:06:12 +00:00
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=http://www.lua.org/ftp/ \
|
|
|
|
http://ftp.gwdg.de/pub/languages/lua/ \
|
|
|
|
http://mirrors.dotsrc.org/lua/ \
|
|
|
|
http://www.tecgraf.puc-rio.br/lua/ftp/
|
2008-08-24 15:45:26 +00:00
|
|
|
PKG_MD5SUM:=d0870f2de55d59c1c8419f36e8fac150
|
2008-04-13 01:06:12 +00:00
|
|
|
|
2009-02-22 23:54:26 +00:00
|
|
|
HOST_PATCH_DIR=./patches-host
|
2009-04-05 02:33:41 +00:00
|
|
|
PKG_BUILD_DEPENDS:=lua/host zlib
|
2009-03-17 02:20:34 +00:00
|
|
|
|
2009-02-22 18:10:23 +00:00
|
|
|
include $(INCLUDE_DIR)/host-build.mk
|
2008-04-13 01:06:12 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
|
|
|
define Package/lua/Default
|
|
|
|
SUBMENU:=LUA
|
|
|
|
SECTION:=lang
|
|
|
|
CATEGORY:=Languages
|
|
|
|
TITLE:=LUA programming language
|
|
|
|
URL:=http://www.lua.org/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua/Default/description
|
|
|
|
Lua is a powerful light-weight programming language designed for extending
|
|
|
|
applications. Lua is also frequently used as a general-purpose, stand-alone
|
|
|
|
language. Lua is free software.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/liblua
|
|
|
|
$(call Package/lua/Default)
|
|
|
|
SUBMENU:=
|
|
|
|
SECTION:=libs
|
|
|
|
CATEGORY:=Libraries
|
|
|
|
TITLE+= (libraries)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/liblua/description
|
|
|
|
$(call Package/lua/Default/description)
|
|
|
|
This package contains the LUA shared libraries, needed by other programs.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua
|
|
|
|
$(call Package/lua/Default)
|
2008-04-13 14:34:36 +00:00
|
|
|
DEPENDS:=+liblua
|
2008-04-13 01:06:12 +00:00
|
|
|
TITLE+= (interpreter)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua/description
|
|
|
|
$(call Package/lua/Default/description)
|
|
|
|
This package contains the LUA language interpreter.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/luac
|
|
|
|
$(call Package/lua/Default)
|
|
|
|
DEPENDS:=+liblua
|
|
|
|
TITLE+= (compiler)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/luac/description
|
|
|
|
$(call Package/lua/Default/description)
|
|
|
|
This package contains the LUA language compiler.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua-examples
|
|
|
|
$(call Package/lua/Default)
|
|
|
|
DEPENDS:=lua
|
|
|
|
TITLE+= (examples)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua-examples/description
|
|
|
|
$(call Package/lua/Default/description)
|
|
|
|
This package contains LUA language examples.
|
|
|
|
endef
|
|
|
|
|
2009-02-22 18:10:23 +00:00
|
|
|
# Host build
|
|
|
|
define Host/Configure
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Host/Compile
|
|
|
|
$(MAKE) -C $(HOST_BUILD_DIR)/src luac-host
|
2008-04-13 01:06:12 +00:00
|
|
|
endef
|
|
|
|
|
2009-02-22 18:10:23 +00:00
|
|
|
define Host/Install
|
|
|
|
$(INSTALL_BIN) $(HOST_BUILD_DIR)/src/luac-host $(STAGING_DIR_HOST)/bin/luac
|
|
|
|
endef
|
|
|
|
|
|
|
|
# Target build
|
|
|
|
|
2008-08-06 22:10:29 +00:00
|
|
|
TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC)
|
2008-05-04 17:48:26 +00:00
|
|
|
|
2009-01-31 07:18:13 +00:00
|
|
|
ifneq ($(CONFIG_USE_EGLIBC),)
|
|
|
|
ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),)
|
|
|
|
TARGET_CFLAGS += -DNO_GETLOGIN
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2009-02-22 18:10:23 +00:00
|
|
|
Build/Configure=$(Host/Configure)
|
|
|
|
|
2008-04-13 01:06:12 +00:00
|
|
|
define Build/Compile
|
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
|
|
|
CC="$(TARGET_CROSS)gcc" \
|
|
|
|
AR="$(TARGET_CROSS)ar rcu" \
|
|
|
|
RANLIB="$(TARGET_CROSS)ranlib" \
|
|
|
|
INSTALL_ROOT=/usr \
|
2008-08-06 22:10:29 +00:00
|
|
|
CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
|
2008-04-13 01:06:12 +00:00
|
|
|
MYLDFLAGS="$(TARGET_LDFLAGS)" \
|
|
|
|
PKG_VERSION=$(PKG_VERSION) \
|
2008-11-11 02:48:31 +00:00
|
|
|
linux
|
2008-04-13 01:06:12 +00:00
|
|
|
rm -rf $(PKG_INSTALL_DIR)
|
|
|
|
mkdir -p $(PKG_INSTALL_DIR)
|
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
|
|
|
INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
|
|
|
|
install
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/InstallDev
|
|
|
|
mkdir -p $(1)/usr/include
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/lua{,lib,conf}.h $(1)/usr/include/
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/lauxlib.h $(1)/usr/include/
|
2008-05-22 20:26:23 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/lnum_config.h $(1)/usr/include/
|
2008-04-13 01:06:12 +00:00
|
|
|
mkdir -p $(1)/usr/lib
|
2008-11-11 02:48:31 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.{a,so*} $(1)/usr/lib/
|
2008-04-13 01:06:12 +00:00
|
|
|
ln -sf liblua.so.$(PKG_VERSION) $(1)/usr/lib/liblualib.so
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/liblua/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
2008-11-11 02:48:31 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.so.* $(1)/usr/lib/
|
2008-04-13 01:06:12 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua $(1)/usr/bin/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/luac/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac $(1)/usr/bin/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua-examples/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/share/lua/examples
|
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/test/*.lua \
|
|
|
|
$(1)/usr/share/lua/examples/
|
|
|
|
endef
|
|
|
|
|
2009-02-22 18:10:23 +00:00
|
|
|
$(eval $(call HostBuild))
|
2008-04-13 01:06:12 +00:00
|
|
|
$(eval $(call BuildPackage,liblua))
|
|
|
|
$(eval $(call BuildPackage,lua))
|
|
|
|
$(eval $(call BuildPackage,luac))
|
|
|
|
$(eval $(call BuildPackage,lua-examples))
|