2 # Copyright (C) 2006-2009 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=http
://www.lua.org
/ftp
/ \
16 http
://ftp.gwdg.de
/pub
/languages
/lua
/ \
17 http
://mirrors.dotsrc.org
/lua
/ \
18 http
://www.tecgraf.puc-rio.br
/lua
/ftp
/
19 PKG_MD5SUM
:=d0870f2de55d59c1c8419f36e8fac150
21 HOST_PATCH_DIR
:= .
/patches-host
23 include $(INCLUDE_DIR
)/package.mk
24 include $(INCLUDE_DIR
)/host-build.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.
86 define Build
/Configure
89 TARGET_CFLAGS
+= -DLUA_USE_LINUX
$(FPIC
) -std
=gnu99
91 ifneq ($(CONFIG_USE_EGLIBC
),)
92 ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP
),)
93 TARGET_CFLAGS
+= -DNO_GETLOGIN
98 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
99 CC
="$(TARGET_CROSS)gcc" \
100 AR
="$(TARGET_CROSS)ar rcu" \
101 RANLIB
="$(TARGET_CROSS)ranlib" \
103 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
104 MYLDFLAGS
="$(TARGET_LDFLAGS)" \
105 PKG_VERSION
=$(PKG_VERSION
) \
107 rm -rf
$(PKG_INSTALL_DIR
)
108 mkdir
-p
$(PKG_INSTALL_DIR
)
109 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
110 INSTALL_TOP
="$(PKG_INSTALL_DIR)/usr" \
114 define Host
/Configure
115 $(SED
) 's,"/usr/local/","$(STAGING_DIR_HOST)/",' $(HOST_BUILD_DIR
)/src
/luaconf.h
118 LUA_OS.Darwin
:=macosx
119 LUA_OS.FreeBSD
:=freebsd
120 LUA_OS
:=$(LUA_OS.
$(HOST_OS
))
124 $(MAKE
) -C
$(HOST_BUILD_DIR
) \
125 CC
="$(HOSTCC) -std=gnu99" \
130 $(MAKE
) -C
$(HOST_BUILD_DIR
) \
131 INSTALL_TOP
="$(STAGING_DIR_HOST)" \
135 define Build
/InstallDev
136 $(INSTALL_DIR
) $(1)/usr
/include
137 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua
{,lib
,conf
}.h
$(1)/usr
/include/
138 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lauxlib.h
$(1)/usr
/include/
139 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lnum_config.h
$(1)/usr
/include/
140 $(INSTALL_DIR
) $(1)/usr
/lib
141 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.
{a
,so
*} $(1)/usr
/lib
/
142 ln
-sf liblua.so.
$(PKG_VERSION
) $(1)/usr
/lib
/liblualib.so
143 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
144 $(CP
) $(PKG_BUILD_DIR
)/etc
/lua.
pc $(1)/usr
/lib
/pkgconfig
/
147 define Package
/liblua
/install
148 $(INSTALL_DIR
) $(1)/usr
/lib
149 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.so.
* $(1)/usr
/lib
/
152 define Package
/lua
/install
153 $(INSTALL_DIR
) $(1)/usr
/bin
154 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/lua
$(1)/usr
/bin
/
157 define Package
/luac
/install
158 $(INSTALL_DIR
) $(1)/usr
/bin
159 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/luac
$(1)/usr
/bin
/
162 define Package
/lua-examples
/install
163 $(INSTALL_DIR
) $(1)/usr
/share
/lua
/examples
164 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/test/*.lua \
165 $(1)/usr
/share
/lua
/examples
/
168 $(eval
$(call BuildPackage
,liblua
))
169 $(eval
$(call BuildPackage
,lua
))
170 $(eval
$(call BuildPackage
,luac
))
171 $(eval
$(call BuildPackage
,lua-examples
))
172 $(eval
$(call HostBuild
))