2 # Copyright (C) 2006 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
:= dea74646b7e5c621fef7174df83c34b1
23 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
24 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
26 include $(INCLUDE_DIR
)/package.mk
28 define Package
/lua
/Default
31 TITLE
:=LUA programming language
33 Lua is a powerful light-weight programming language designed for extending
\\\
34 applications. Lua is also frequently used
as a general-purpose
, stand-alone
\\\
35 language. Lua is free software.
36 URL
:=http
://www.lua.org
/
40 $(call Package
/lua
/Default
)
46 This package contains the LUA shared libraries
, needed by other programs.
50 $(call Package
/lua
/Default
)
55 This package contains the LUA language interpreter.
59 $(call Package
/lua
/Default
)
64 This package contains the LUA language compiler.
67 define Package
/lua-examples
68 $(call Package
/lua
/Default
)
73 This package contains LUA language examples.
76 define Build
/Configure
80 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
81 CC
="$(TARGET_CROSS)gcc" \
82 LD
="$(TARGET_CROSS)ld" \
83 AR
="$(TARGET_CROSS)ar rcu" \
84 RANLIB
="$(TARGET_CROSS)ranlib" \
86 MYCFLAGS
="-I$(STAGING_DIR)/usr/include $(TARGET_CFLAGS)" \
87 MYLDFLAGS
="-L$(STAGING_DIR)/usr/lib" \
89 # remove statically linked binaries, so that they will get linked against shlib this time
90 rm -f
$(PKG_BUILD_DIR
)/bin
/lua
{,c
}
91 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
92 CC
="$(TARGET_CROSS)gcc" \
93 LD
="$(TARGET_CROSS)ld" \
94 AR
="$(TARGET_CROSS)ar rcu" \
95 RANLIB
="$(TARGET_CROSS)ranlib" \
97 MYCFLAGS
="-I$(STAGING_DIR)/usr/include $(TARGET_CFLAGS)" \
98 MYLDFLAGS
="-L$(STAGING_DIR)/usr/lib" \
100 rm -rf
$(PKG_INSTALL_DIR
)
101 mkdir
-p
$(PKG_INSTALL_DIR
)
102 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
103 INSTALL_ROOT
="$(PKG_INSTALL_DIR)/usr" \
107 define Build
/InstallDev
108 mkdir
-p
$(STAGING_DIR
)/usr
/include
109 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lua
{,lib
}.h
$(STAGING_DIR
)/usr
/include/
110 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/lauxlib.h
$(STAGING_DIR
)/usr
/include/
111 mkdir
-p
$(STAGING_DIR
)/usr
/lib
112 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua
{,lib
}.
{a
,so
*} $(STAGING_DIR
)/usr
/lib
/
115 define Build
/UninstallDev
117 $(STAGING_DIR
)/usr
/include/lua
{,lib
}.h \
118 $(STAGING_DIR
)/usr
/include/lauxlib.h \
119 $(STAGING_DIR
)/usr
/lib
/liblua
{,lib
}.
{a
,so
*}
122 define Package
/liblua
/install
123 install -d
-m0755
$(1)/usr
/lib
124 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/liblua
{,lib
}.so.
* $(1)/usr
/lib
/
127 define Package
/lua
/install
128 install -d
-m0755
$(1)/usr
/bin
129 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/lua
$(1)/usr
/bin
/
132 define Package
/luac
/install
133 install -d
-m0755
$(1)/usr
/bin
134 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/luac
$(1)/usr
/bin
/
137 define Package
/lua-examples
/install
138 install -d
-m0755
$(1)/usr
/share
/lua
/examples
139 install -m0644
$(PKG_BUILD_DIR
)/test/*.lua \
140 $(1)/usr
/share
/lua
/examples
/
143 $(eval
$(call BuildPackage
,liblua
))
144 $(eval
$(call BuildPackage
,lua
))
145 $(eval
$(call BuildPackage
,luac
))
146 $(eval
$(call BuildPackage
,lua-examples
))