2 # Copyright (C) 2006-2011 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 ifeq ($(HOST_OS
),Darwin
)
121 ifeq ($(HOST_OS
),FreeBSD
)
129 $(MAKE
) -C
$(HOST_BUILD_DIR
) \
130 CC
="$(HOSTCC) -std=gnu99" \
135 $(MAKE
) -C
$(HOST_BUILD_DIR
) \
136 INSTALL_TOP
="$(STAGING_DIR_HOST)" \
140 define Build
/InstallDev
141 $(INSTALL_DIR
) $(1)/usr
/include
142 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua
{,lib
,conf
}.h
$(1)/usr
/include/
143 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lauxlib.h
$(1)/usr
/include/
144 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lnum_config.h
$(1)/usr
/include/
145 $(INSTALL_DIR
) $(1)/usr
/lib
146 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.
{a
,so
*} $(1)/usr
/lib
/
147 ln
-sf liblua.so.
$(PKG_VERSION
) $(1)/usr
/lib
/liblualib.so
148 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
149 $(CP
) $(PKG_BUILD_DIR
)/etc
/lua.
pc $(1)/usr
/lib
/pkgconfig
/
152 define Package
/liblua
/install
153 $(INSTALL_DIR
) $(1)/usr
/lib
154 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.so.
* $(1)/usr
/lib
/
157 define Package
/lua
/install
158 $(INSTALL_DIR
) $(1)/usr
/bin
159 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/lua
$(1)/usr
/bin
/
162 define Package
/luac
/install
163 $(INSTALL_DIR
) $(1)/usr
/bin
164 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/luac
$(1)/usr
/bin
/
167 define Package
/lua-examples
/install
168 $(INSTALL_DIR
) $(1)/usr
/share
/lua
/examples
169 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/test/*.lua \
170 $(1)/usr
/share
/lua
/examples
/
173 $(eval
$(call BuildPackage
,liblua
))
174 $(eval
$(call BuildPackage
,lua
))
175 $(eval
$(call BuildPackage
,luac
))
176 $(eval
$(call BuildPackage
,lua-examples
))
177 $(eval
$(call HostBuild
))