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 include $(INCLUDE_DIR
)/package.mk
23 define Package
/lua
/Default
27 TITLE
:=Lua programming language
28 URL
:=http
://www.lua.org
/
31 define Package
/lua
/Default
/description
32 Lua is a powerful light-weight programming language designed for extending
33 applications. Lua is also frequently used
as a general-purpose
, stand-alone
34 language. Lua is free software.
38 $(call Package
/lua
/Default
)
45 define Package
/liblua
/description
46 $(call Package
/lua
/Default
/description
)
47 This package contains the Lua shared libraries
, needed by other programs.
51 $(call Package
/lua
/Default
)
56 define Package
/lua
/description
57 $(call Package
/lua
/Default
/description
)
58 This package contains the Lua language interpreter.
62 $(call Package
/lua
/Default
)
67 define Package
/luac
/description
68 $(call Package
/lua
/Default
/description
)
69 This package contains the Lua language compiler.
72 define Package
/lua-examples
73 $(call Package
/lua
/Default
)
78 define Package
/lua-examples
/description
79 $(call Package
/lua
/Default
/description
)
80 This package contains Lua language examples.
83 define Build
/Configure
86 TARGET_CFLAGS
+= -DLUA_USE_LINUX
$(FPIC
)
88 ifneq ($(CONFIG_USE_EGLIBC
),)
89 ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP
),)
90 TARGET_CFLAGS
+= -DNO_GETLOGIN
95 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
96 CC
="$(TARGET_CROSS)gcc" \
97 AR
="$(TARGET_CROSS)ar rcu" \
98 RANLIB
="$(TARGET_CROSS)ranlib" \
100 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
101 MYLDFLAGS
="$(TARGET_LDFLAGS)" \
102 PKG_VERSION
=$(PKG_VERSION
) \
104 rm -rf
$(PKG_INSTALL_DIR
)
105 mkdir
-p
$(PKG_INSTALL_DIR
)
106 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
107 INSTALL_TOP
="$(PKG_INSTALL_DIR)/usr" \
111 define Build
/InstallDev
112 mkdir
-p
$(1)/usr
/include
113 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua
{,lib
,conf
}.h
$(1)/usr
/include/
114 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lauxlib.h
$(1)/usr
/include/
115 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lnum_config.h
$(1)/usr
/include/
116 mkdir
-p
$(1)/usr
/lib
117 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.
{a
,so
*} $(1)/usr
/lib
/
118 ln
-sf liblua.so.
$(PKG_VERSION
) $(1)/usr
/lib
/liblualib.so
121 define Package
/liblua
/install
122 $(INSTALL_DIR
) $(1)/usr
/lib
123 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua.so.
* $(1)/usr
/lib
/
126 define Package
/lua
/install
127 $(INSTALL_DIR
) $(1)/usr
/bin
128 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/lua
$(1)/usr
/bin
/
131 define Package
/luac
/install
132 $(INSTALL_DIR
) $(1)/usr
/bin
133 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/luac
$(1)/usr
/bin
/
136 define Package
/lua-examples
/install
137 $(INSTALL_DIR
) $(1)/usr
/share
/lua
/examples
138 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/test/*.lua \
139 $(1)/usr
/share
/lua
/examples
/
142 $(eval
$(call BuildPackage
,liblua
))
143 $(eval
$(call BuildPackage
,lua
))
144 $(eval
$(call BuildPackage
,luac
))
145 $(eval
$(call BuildPackage
,lua-examples
))