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
)
35 define Package
/lua
/Default
39 TITLE
:=LUA programming language
40 URL
:=http
://www.lua.org
/
43 define Package
/lua
/Default
/description
44 Lua is a powerful light-weight programming language designed for extending
45 applications. Lua is also frequently used
as a general-purpose
, stand-alone
46 language. Lua is free software.
50 $(call Package
/lua
/Default
)
57 define Package
/liblua
/description
58 $(call Package
/lua
/Default
/description
)
59 This package contains the LUA shared libraries
, needed by other programs.
63 $(call Package
/lua
/Default
)
68 define Package
/lua
/description
69 $(call Package
/lua
/Default
/description
)
70 This package contains the LUA language interpreter.
74 $(call Package
/lua
/Default
)
79 define Package
/luac
/description
80 $(call Package
/lua
/Default
/description
)
81 This package contains the LUA language compiler.
84 define Package
/lua-examples
85 $(call Package
/lua
/Default
)
90 define Package
/lua-examples
/description
91 $(call Package
/lua
/Default
/description
)
92 This package contains LUA language examples.
95 define Build
/Configure
98 TARGET_CFLAGS
+= -DLUA_USE_LINUX
101 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
102 CC
="$(TARGET_CROSS)gcc" \
103 LD
="$(TARGET_CROSS)ld" \
104 AR
="$(TARGET_CROSS)ar rcu" \
105 RANLIB
="$(TARGET_CROSS)ranlib" \
107 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(FPIC)" \
108 MYLDFLAGS
="$(TARGET_LDFLAGS)" \
109 PKG_VERSION
=$(PKG_VERSION
) \
111 rm -rf
$(PKG_INSTALL_DIR
)
112 mkdir
-p
$(PKG_INSTALL_DIR
)
113 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
114 INSTALL_TOP
="$(PKG_INSTALL_DIR)/usr" \
118 define Build
/InstallDev
119 mkdir
-p
$(1)/usr
/include
120 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua
{,lib
,conf
}.h
$(1)/usr
/include/
121 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lauxlib.h
$(1)/usr
/include/
122 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lnum_config.h
$(1)/usr
/include/
123 mkdir
-p
$(1)/usr
/lib
124 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.
* $(1)/usr
/lib
/
125 ln
-sf liblua.so.
$(PKG_VERSION
) $(1)/usr
/lib
/liblualib.so
128 define Package
/liblua
/install
129 $(INSTALL_DIR
) $(1)/usr
/lib
130 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.so
* $(1)/usr
/lib
/
133 define Package
/lua
/install
134 $(INSTALL_DIR
) $(1)/usr
/bin
135 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/lua
$(1)/usr
/bin
/
138 define Package
/luac
/install
139 $(INSTALL_DIR
) $(1)/usr
/bin
140 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/luac
$(1)/usr
/bin
/
143 define Package
/lua-examples
/install
144 $(INSTALL_DIR
) $(1)/usr
/share
/lua
/examples
145 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/test/*.lua \
146 $(1)/usr
/share
/lua
/examples
/
149 $(eval
$(call BuildPackage
,liblua
))
150 $(eval
$(call BuildPackage
,lua
))
151 $(eval
$(call BuildPackage
,luac
))
152 $(eval
$(call BuildPackage
,lua-examples
))