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 HOST_PATCH_DIR
=.
/patches-host
23 include $(INCLUDE_DIR
)/host-build.mk
24 include $(INCLUDE_DIR
)/package.mk
26 define Package
/lua
/Default
30 TITLE
:=LUA programming language
31 URL
:=http
://www.lua.org
/
34 define Package
/lua
/Default
/description
35 Lua is a powerful light-weight programming language designed for extending
36 applications. Lua is also frequently used
as a general-purpose
, stand-alone
37 language. Lua is free software.
41 $(call Package
/lua
/Default
)
48 define Package
/liblua
/description
49 $(call Package
/lua
/Default
/description
)
50 This package contains the LUA shared libraries
, needed by other programs.
54 $(call Package
/lua
/Default
)
59 define Package
/lua
/description
60 $(call Package
/lua
/Default
/description
)
61 This package contains the LUA language interpreter.
65 $(call Package
/lua
/Default
)
70 define Package
/luac
/description
71 $(call Package
/lua
/Default
/description
)
72 This package contains the LUA language compiler.
75 define Package
/lua-examples
76 $(call Package
/lua
/Default
)
81 define Package
/lua-examples
/description
82 $(call Package
/lua
/Default
/description
)
83 This package contains LUA language examples.
92 $(MAKE
) -C
$(HOST_BUILD_DIR
)/src luac-host
96 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/luac-host
$(STAGING_DIR_HOST
)/bin
/luac
101 TARGET_CFLAGS
+= -DLUA_USE_LINUX
$(FPIC
)
103 ifneq ($(CONFIG_USE_EGLIBC
),)
104 ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP
),)
105 TARGET_CFLAGS
+= -DNO_GETLOGIN
109 Build
/Configure
=$(Host
/Configure
)
112 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
113 CC
="$(TARGET_CROSS)gcc" \
114 AR
="$(TARGET_CROSS)ar rcu" \
115 RANLIB
="$(TARGET_CROSS)ranlib" \
117 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
118 MYLDFLAGS
="$(TARGET_LDFLAGS)" \
119 PKG_VERSION
=$(PKG_VERSION
) \
121 rm -rf
$(PKG_INSTALL_DIR
)
122 mkdir
-p
$(PKG_INSTALL_DIR
)
123 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
124 INSTALL_TOP
="$(PKG_INSTALL_DIR)/usr" \
128 define Build
/InstallDev
129 mkdir
-p
$(1)/usr
/include
130 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua
{,lib
,conf
}.h
$(1)/usr
/include/
131 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lauxlib.h
$(1)/usr
/include/
132 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lnum_config.h
$(1)/usr
/include/
133 mkdir
-p
$(1)/usr
/lib
134 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.
{a
,so
*} $(1)/usr
/lib
/
135 ln
-sf liblua.so.
$(PKG_VERSION
) $(1)/usr
/lib
/liblualib.so
138 define Package
/liblua
/install
139 $(INSTALL_DIR
) $(1)/usr
/lib
140 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.so.
* $(1)/usr
/lib
/
143 define Package
/lua
/install
144 $(INSTALL_DIR
) $(1)/usr
/bin
145 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/lua
$(1)/usr
/bin
/
148 define Package
/luac
/install
149 $(INSTALL_DIR
) $(1)/usr
/bin
150 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/luac
$(1)/usr
/bin
/
153 define Package
/lua-examples
/install
154 $(INSTALL_DIR
) $(1)/usr
/share
/lua
/examples
155 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/test/*.lua \
156 $(1)/usr
/share
/lua
/examples
/
159 $(eval
$(call HostBuild
))
160 $(eval
$(call BuildPackage
,liblua
))
161 $(eval
$(call BuildPackage
,lua
))
162 $(eval
$(call BuildPackage
,luac
))
163 $(eval
$(call BuildPackage
,lua-examples
))