2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=http
://www.lua.org
/ftp
/ \
17 http
://ftp.gwdg.de
/pub
/languages
/lua
/ \
18 http
://mirrors.dotsrc.org
/lua
/ \
19 http
://www.tecgraf.puc-rio.br
/lua
/ftp
/
20 PKG_MD5SUM
:=a70a8dfaa150e047866dc01a46272599
22 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
23 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
25 include $(INCLUDE_DIR
)/package.mk
27 ifeq ($(ARCH
),powerpc
)
32 define Package
/lua
/Default
36 TITLE
:=LUA programming language
37 URL
:=http
://www.lua.org
/
40 define Package
/lua
/Default
/description
41 Lua is a powerful light-weight programming language designed for extending
42 applications. Lua is also frequently used
as a general-purpose
, stand-alone
43 language. Lua is free software.
47 $(call Package
/lua
/Default
)
54 define Package
/liblua
/description
55 $(call Package
/lua
/Default
/description
)
56 This package contains the LUA shared libraries
, needed by other programs.
60 $(call Package
/lua
/Default
)
65 define Package
/lua
/description
66 $(call Package
/lua
/Default
/description
)
67 This package contains the LUA language interpreter.
71 $(call Package
/lua
/Default
)
76 define Package
/luac
/description
77 $(call Package
/lua
/Default
/description
)
78 This package contains the LUA language compiler.
81 define Package
/lua-examples
82 $(call Package
/lua
/Default
)
87 define Package
/lua-examples
/description
88 $(call Package
/lua
/Default
/description
)
89 This package contains LUA language examples.
92 define Build
/Configure
95 TARGET_CFLAGS
+= -DLUA_USE_LINUX
98 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
99 CC
="$(TARGET_CROSS)gcc" \
100 LD
="$(TARGET_CROSS)ld" \
101 AR
="$(TARGET_CROSS)ar rcu" \
102 RANLIB
="$(TARGET_CROSS)ranlib" \
104 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(FPIC)" \
105 MYLDFLAGS
="$(TARGET_LDFLAGS)" \
106 PKG_VERSION
=$(PKG_VERSION
) \
108 rm -rf
$(PKG_INSTALL_DIR
)
109 mkdir
-p
$(PKG_INSTALL_DIR
)
110 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
111 INSTALL_TOP
="$(PKG_INSTALL_DIR)/usr" \
115 define Build
/InstallDev
116 mkdir
-p
$(1)/usr
/include
117 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua
{,lib
,conf
}.h
$(1)/usr
/include/
118 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lauxlib.h
$(1)/usr
/include/
119 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lnum_config.h
$(1)/usr
/include/
120 mkdir
-p
$(1)/usr
/lib
121 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.
* $(1)/usr
/lib
/
122 ln
-sf liblua.so.
$(PKG_VERSION
) $(1)/usr
/lib
/liblualib.so
125 define Package
/liblua
/install
126 $(INSTALL_DIR
) $(1)/usr
/lib
127 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.so
* $(1)/usr
/lib
/
130 define Package
/lua
/install
131 $(INSTALL_DIR
) $(1)/usr
/bin
132 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/lua
$(1)/usr
/bin
/
135 define Package
/luac
/install
136 $(INSTALL_DIR
) $(1)/usr
/bin
137 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/luac
$(1)/usr
/bin
/
140 define Package
/lua-examples
/install
141 $(INSTALL_DIR
) $(1)/usr
/share
/lua
/examples
142 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/test/*.lua \
143 $(1)/usr
/share
/lua
/examples
/
146 $(eval
$(call BuildPackage
,liblua
))
147 $(eval
$(call BuildPackage
,lua
))
148 $(eval
$(call BuildPackage
,luac
))
149 $(eval
$(call BuildPackage
,lua-examples
))