2 # Copyright (C) 2006-2008 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
:=d0870f2de55d59c1c8419f36e8fac150
22 include $(INCLUDE_DIR
)/package.mk
24 define Package
/lua
/Default
28 TITLE
:=LUA programming language
29 URL
:=http
://www.lua.org
/
32 define Package
/lua
/Default
/description
33 Lua is a powerful light-weight programming language designed for extending
34 applications. Lua is also frequently used
as a general-purpose
, stand-alone
35 language. Lua is free software.
39 $(call Package
/lua
/Default
)
46 define Package
/liblua
/description
47 $(call Package
/lua
/Default
/description
)
48 This package contains the LUA shared libraries
, needed by other programs.
52 $(call Package
/lua
/Default
)
57 define Package
/lua
/description
58 $(call Package
/lua
/Default
/description
)
59 This package contains the LUA language interpreter.
63 $(call Package
/lua
/Default
)
68 define Package
/luac
/description
69 $(call Package
/lua
/Default
/description
)
70 This package contains the LUA language compiler.
73 define Package
/lua-examples
74 $(call Package
/lua
/Default
)
79 define Package
/lua-examples
/description
80 $(call Package
/lua
/Default
/description
)
81 This package contains LUA language examples.
84 define Build
/Configure
87 TARGET_CFLAGS
+= -DLUA_USE_LINUX
$(FPIC
)
90 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
91 CC
="$(TARGET_CROSS)gcc" \
92 AR
="$(TARGET_CROSS)ar rcu" \
93 RANLIB
="$(TARGET_CROSS)ranlib" \
95 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
96 MYLDFLAGS
="$(TARGET_LDFLAGS)" \
97 PKG_VERSION
=$(PKG_VERSION
) \
99 rm -rf
$(PKG_INSTALL_DIR
)
100 mkdir
-p
$(PKG_INSTALL_DIR
)
101 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
102 INSTALL_TOP
="$(PKG_INSTALL_DIR)/usr" \
106 define Build
/InstallDev
107 mkdir
-p
$(1)/usr
/include
108 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua
{,lib
,conf
}.h
$(1)/usr
/include/
109 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lauxlib.h
$(1)/usr
/include/
110 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lnum_config.h
$(1)/usr
/include/
111 mkdir
-p
$(1)/usr
/lib
112 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.
{a
,so
*} $(1)/usr
/lib
/
113 ln
-sf liblua.so.
$(PKG_VERSION
) $(1)/usr
/lib
/liblualib.so
116 define Package
/liblua
/install
117 $(INSTALL_DIR
) $(1)/usr
/lib
118 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.so.
* $(1)/usr
/lib
/
121 define Package
/lua
/install
122 $(INSTALL_DIR
) $(1)/usr
/bin
123 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/lua
$(1)/usr
/bin
/
126 define Package
/luac
/install
127 $(INSTALL_DIR
) $(1)/usr
/bin
128 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/luac
$(1)/usr
/bin
/
131 define Package
/lua-examples
/install
132 $(INSTALL_DIR
) $(1)/usr
/share
/lua
/examples
133 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/test/*.lua \
134 $(1)/usr
/share
/lua
/examples
/
137 $(eval
$(call BuildPackage
,liblua
))
138 $(eval
$(call BuildPackage
,lua
))
139 $(eval
$(call BuildPackage
,luac
))
140 $(eval
$(call BuildPackage
,lua-examples
))