From: Ulf Samuelsson Date: Fri, 30 Nov 2007 01:08:36 +0000 (-0000) Subject: Add lua package X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c3719df5b4705419f0b5b3fa5a491d67556309d7;p=buildroot.git Add lua package --- diff --git a/package/Config.in b/package/Config.in index 1542592372..8095158a48 100644 --- a/package/Config.in +++ b/package/Config.in @@ -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" diff --git a/package/lua/Config.in b/package/lua/Config.in new file mode 100644 index 0000000000..ecec055458 --- /dev/null +++ b/package/lua/Config.in @@ -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 diff --git a/package/lua/lua.mk b/package/lua/lua.mk new file mode 100644 index 0000000000..ee8ffac129 --- /dev/null +++ b/package/lua/lua.mk @@ -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