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
)
89 ifneq ($(CONFIG_USE_EGLIBC
),)
90 ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP
),)
91 TARGET_CFLAGS
+= -DNO_GETLOGIN
96 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
97 CC
="$(TARGET_CROSS)gcc" \
98 AR
="$(TARGET_CROSS)ar rcu" \
99 RANLIB
="$(TARGET_CROSS)ranlib" \
101 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
102 MYLDFLAGS
="$(TARGET_LDFLAGS)" \
103 PKG_VERSION
=$(PKG_VERSION
) \
105 rm -rf
$(PKG_INSTALL_DIR
)
106 mkdir
-p
$(PKG_INSTALL_DIR
)
107 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
108 INSTALL_TOP
="$(PKG_INSTALL_DIR)/usr" \
112 define Build
/InstallDev
113 mkdir
-p
$(1)/usr
/include
114 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua
{,lib
,conf
}.h
$(1)/usr
/include/
115 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lauxlib.h
$(1)/usr
/include/
116 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lnum_config.h
$(1)/usr
/include/
117 mkdir
-p
$(1)/usr
/lib
118 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.
{a
,so
*} $(1)/usr
/lib
/
119 ln
-sf liblua.so.
$(PKG_VERSION
) $(1)/usr
/lib
/liblualib.so
122 define Package
/liblua
/install
123 $(INSTALL_DIR
) $(1)/usr
/lib
124 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.so.
* $(1)/usr
/lib
/
127 define Package
/lua
/install
128 $(INSTALL_DIR
) $(1)/usr
/bin
129 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/lua
$(1)/usr
/bin
/
132 define Package
/luac
/install
133 $(INSTALL_DIR
) $(1)/usr
/bin
134 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/luac
$(1)/usr
/bin
/
137 define Package
/lua-examples
/install
138 $(INSTALL_DIR
) $(1)/usr
/share
/lua
/examples
139 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/test/*.lua \
140 $(1)/usr
/share
/lua
/examples
/
143 $(eval
$(call BuildPackage
,liblua
))
144 $(eval
$(call BuildPackage
,lua
))
145 $(eval
$(call BuildPackage
,luac
))
146 $(eval
$(call BuildPackage
,lua-examples
))