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
)/host-build.mk
23 include $(INCLUDE_DIR
)/package.mk
25 define Package
/lua
/Default
29 TITLE
:=LUA programming language
30 URL
:=http
://www.lua.org
/
33 define Package
/lua
/Default
/description
34 Lua is a powerful light-weight programming language designed for extending
35 applications. Lua is also frequently used
as a general-purpose
, stand-alone
36 language. Lua is free software.
40 $(call Package
/lua
/Default
)
47 define Package
/liblua
/description
48 $(call Package
/lua
/Default
/description
)
49 This package contains the LUA shared libraries
, needed by other programs.
53 $(call Package
/lua
/Default
)
58 define Package
/lua
/description
59 $(call Package
/lua
/Default
/description
)
60 This package contains the LUA language interpreter.
64 $(call Package
/lua
/Default
)
69 define Package
/luac
/description
70 $(call Package
/lua
/Default
/description
)
71 This package contains the LUA language compiler.
74 define Package
/lua-examples
75 $(call Package
/lua
/Default
)
80 define Package
/lua-examples
/description
81 $(call Package
/lua
/Default
/description
)
82 This package contains LUA language examples.
91 $(MAKE
) -C
$(HOST_BUILD_DIR
)/src luac-host
95 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/luac-host
$(STAGING_DIR_HOST
)/bin
/luac
100 TARGET_CFLAGS
+= -DLUA_USE_LINUX
$(FPIC
)
102 ifneq ($(CONFIG_USE_EGLIBC
),)
103 ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP
),)
104 TARGET_CFLAGS
+= -DNO_GETLOGIN
108 Build
/Configure
=$(Host
/Configure
)
111 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
112 CC
="$(TARGET_CROSS)gcc" \
113 AR
="$(TARGET_CROSS)ar rcu" \
114 RANLIB
="$(TARGET_CROSS)ranlib" \
116 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
117 MYLDFLAGS
="$(TARGET_LDFLAGS)" \
118 PKG_VERSION
=$(PKG_VERSION
) \
120 rm -rf
$(PKG_INSTALL_DIR
)
121 mkdir
-p
$(PKG_INSTALL_DIR
)
122 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
123 INSTALL_TOP
="$(PKG_INSTALL_DIR)/usr" \
127 define Build
/InstallDev
128 mkdir
-p
$(1)/usr
/include
129 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua
{,lib
,conf
}.h
$(1)/usr
/include/
130 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lauxlib.h
$(1)/usr
/include/
131 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lnum_config.h
$(1)/usr
/include/
132 mkdir
-p
$(1)/usr
/lib
133 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.
{a
,so
*} $(1)/usr
/lib
/
134 ln
-sf liblua.so.
$(PKG_VERSION
) $(1)/usr
/lib
/liblualib.so
137 define Package
/liblua
/install
138 $(INSTALL_DIR
) $(1)/usr
/lib
139 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.so.
* $(1)/usr
/lib
/
142 define Package
/lua
/install
143 $(INSTALL_DIR
) $(1)/usr
/bin
144 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/lua
$(1)/usr
/bin
/
147 define Package
/luac
/install
148 $(INSTALL_DIR
) $(1)/usr
/bin
149 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/luac
$(1)/usr
/bin
/
152 define Package
/lua-examples
/install
153 $(INSTALL_DIR
) $(1)/usr
/share
/lua
/examples
154 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/test/*.lua \
155 $(1)/usr
/share
/lua
/examples
/
158 $(eval
$(call HostBuild
))
159 $(eval
$(call BuildPackage
,liblua
))
160 $(eval
$(call BuildPackage
,lua
))
161 $(eval
$(call BuildPackage
,luac
))
162 $(eval
$(call BuildPackage
,lua-examples
))