Add lua package

This commit is contained in:
Ulf Samuelsson 2007-11-30 01:08:36 +00:00
parent b208aa6f33
commit c3719df5b4
3 changed files with 92 additions and 0 deletions

View File

@ -407,6 +407,7 @@ menuconfig BR2_SCRIPTING_SUPPORT
Support for scripting languages, interpreter languages.
if BR2_SCRIPTING_SUPPORT
source "package/lua/Config.in"
source "package/microperl/Config.in"
source "package/python/Config.in"
source "package/ruby/Config.in"

12
package/lua/Config.in Normal file
View File

@ -0,0 +1,12 @@
config BR2_PACKAGE_LUA
bool "lua"
default n
depends on BR2_READLINE
depends on BR2_PACKAGE_NCURSES
help
Lua is a powerful, fast, light-weight, embeddable scripting language.
http://www.lua.org/
comment "lua - disabled (requires readline and ncurses)"
depends on !BR2_READLINE && !BR2_PACKAGE_NCURSES

79
package/lua/lua.mk Normal file
View File

@ -0,0 +1,79 @@
#############################################################
#
# lua
#
#############################################################
LUA_VERSION=5.1.2
LUA_SOURCE=lua-$(LUA_VERSION).tar.gz
LUA_CAT:=$(ZCAT)
LUA_SITE=http://www.lua.org/ftp
LUA_DIR=$(BUILD_DIR)/lua-$(LUA_VERSION)
LUA_CFLAGS=-DLUA_USE_LINUX
LUA_MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
$(DL_DIR)/$(LUA_SOURCE):
$(WGET) -P $(DL_DIR) $(LUA_SITE)/$(LUA_SOURCE)
$(LUA_DIR)/.unpacked: $(DL_DIR)/$(LUA_SOURCE)
$(LUA_CAT) $(DL_DIR)/$(LUA_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
touch $(LUA_DIR)/.unpacked
$(LUA_DIR)/src/lua: $(LUA_DIR)/.unpacked
rm -f $@
$(MAKE) $(TARGET_CONFIGURE_OPTS) \
MYCFLAGS=$(LUA_CFLAGS) \
MYLIBS=$(LUA_MYLIBS) \
AR="$(TARGET_CROSS)ar rcu" \
-C $(LUA_DIR)/src all
$(LUA_DIR)/src/luac: $(LUA_DIR)/src/lua
$(LUA_DIR)/src/liblua.a: $(LUA_DIR)/src/lua
$(STAGING_DIR)/usr/lib/liblua.a: $(LUA_DIR)/src/liblua.a
cp -dpf $(LUA_DIR)/src/liblua.a $(STAGING_DIR)/usr/lib/liblua.a
$(STAGING_DIR)/usr/bin/lua: $(LUA_DIR)/src/lua
cp -dpf $(LUA_DIR)/src/lua $(STAGING_DIR)/usr/bin/lua
$(STAGING_DIR)/usr/bin/luac: $(LUA_DIR)/src/luac
cp -dpf $(LUA_DIR)/src/luac $(STAGING_DIR)/usr/bin/luac
$(TARGET_DIR)/usr/lib/liblua.a: $(STAGING_DIR)/usr/lib/liblua.a
cp -dpf $(STAGING_DIR)/usr/lib/liblua.a $(TARGET_DIR)/usr/lib/liblua.a
$(TARGET_DIR)/usr/bin/lua: $(STAGING_DIR)/usr/bin/lua
cp -dpf $(STAGING_DIR)/usr/bin/lua $(TARGET_DIR)/usr/bin/lua
$(TARGET_DIR)/usr/bin/luac: $(STAGING_DIR)/usr/bin/luac
cp -dpf $(STAGING_DIR)/usr/bin/luac $(TARGET_DIR)/usr/bin/luac
lua-bins: $(TARGET_DIR)/usr/bin/lua $(TARGET_DIR)/usr/bin/luac
lua-libs: $(TARGET_DIR)/usr/lib/liblua.a
lua: uclibc readline ncurses lua-bins lua-libs
lua-source: $(DL_DIR)/$(LUA_SOURCE)
lua-clean:
@if [ -d $(LUA_DIR)/Makefile ]; then \
$(MAKE) -C $(LUA_DIR) clean; \
fi
lua-dirclean:
rm -rf $(LUA_DIR)
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_LUA)),y)
TARGETS+=lua
endif