source: trunk/package/lua/Makefile @ 15245

Last change on this file since 15245 was 15245, checked in by nico, 8 years ago

remove 'svn:keywords' property, not needed anymore after [15242]

  • Property copyright set to Copyright (C) 2006 OpenWrt.org
  • Property licence set to GPLv2
  • Property svn:eol-style set to native
File size: 3.9 KB
Line 
1#
2# Copyright (C) 2006-2009 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=lua
11PKG_VERSION:=5.1.4
12PKG_RELEASE:=4
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15PKG_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/
19PKG_MD5SUM:=d0870f2de55d59c1c8419f36e8fac150
20
21HOST_PATCH_DIR=./patches-host
22PKG_BUILD_DEPENDS:=lua/host zlib
23
24include $(INCLUDE_DIR)/host-build.mk
25include $(INCLUDE_DIR)/package.mk
26
27define Package/lua/Default
28  SUBMENU:=LUA
29  SECTION:=lang
30  CATEGORY:=Languages
31  TITLE:=LUA programming language
32  URL:=http://www.lua.org/
33endef
34
35define Package/lua/Default/description
36 Lua is a powerful light-weight programming language designed for extending
37 applications. Lua is also frequently used as a general-purpose, stand-alone
38 language. Lua is free software.
39endef
40
41define Package/liblua
42$(call Package/lua/Default)
43  SUBMENU:=
44  SECTION:=libs
45  CATEGORY:=Libraries
46  TITLE+= (libraries)
47endef
48
49define Package/liblua/description
50$(call Package/lua/Default/description)
51 This package contains the LUA shared libraries, needed by other programs.
52endef
53
54define Package/lua
55$(call Package/lua/Default)
56  DEPENDS:=+liblua
57  TITLE+= (interpreter)
58endef
59
60define Package/lua/description
61$(call Package/lua/Default/description)
62 This package contains the LUA language interpreter.
63endef
64
65define Package/luac
66$(call Package/lua/Default)
67  DEPENDS:=+liblua
68  TITLE+= (compiler)
69endef
70
71define Package/luac/description
72$(call Package/lua/Default/description)
73 This package contains the LUA language compiler.
74endef
75
76define Package/lua-examples
77$(call Package/lua/Default)
78  DEPENDS:=lua
79  TITLE+= (examples)
80endef
81
82define Package/lua-examples/description
83$(call Package/lua/Default/description)
84 This package contains LUA language examples.
85endef
86
87# Host build
88define Host/Configure
89
90endef
91
92define Host/Compile
93        $(MAKE) -C $(HOST_BUILD_DIR)/src luac-host
94endef
95
96define Host/Install
97        $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/luac-host $(STAGING_DIR_HOST)/bin/luac
98endef
99
100# Target build
101
102TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC)
103
104ifneq ($(CONFIG_USE_EGLIBC),)
105  ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),)
106    TARGET_CFLAGS += -DNO_GETLOGIN
107  endif
108endif
109
110Build/Configure=$(Host/Configure)
111
112define Build/Compile
113        $(MAKE) -C $(PKG_BUILD_DIR) \
114                CC="$(TARGET_CROSS)gcc" \
115                AR="$(TARGET_CROSS)ar rcu" \
116                RANLIB="$(TARGET_CROSS)ranlib" \
117                INSTALL_ROOT=/usr \
118                CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
119                MYLDFLAGS="$(TARGET_LDFLAGS)" \
120                PKG_VERSION=$(PKG_VERSION) \
121                linux
122        rm -rf $(PKG_INSTALL_DIR)
123        mkdir -p $(PKG_INSTALL_DIR)
124        $(MAKE) -C $(PKG_BUILD_DIR) \
125                INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
126                install
127endef
128
129define Build/InstallDev
130        mkdir -p $(1)/usr/include
131        $(CP) $(PKG_INSTALL_DIR)/usr/include/lua{,lib,conf}.h $(1)/usr/include/
132        $(CP) $(PKG_INSTALL_DIR)/usr/include/lauxlib.h $(1)/usr/include/
133        $(CP) $(PKG_INSTALL_DIR)/usr/include/lnum_config.h $(1)/usr/include/
134        mkdir -p $(1)/usr/lib
135        $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.{a,so*} $(1)/usr/lib/
136        ln -sf liblua.so.$(PKG_VERSION) $(1)/usr/lib/liblualib.so
137endef
138
139define Package/liblua/install
140        $(INSTALL_DIR) $(1)/usr/lib
141        $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.so.* $(1)/usr/lib/
142endef
143
144define Package/lua/install
145        $(INSTALL_DIR) $(1)/usr/bin
146        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua $(1)/usr/bin/
147endef
148
149define Package/luac/install
150        $(INSTALL_DIR) $(1)/usr/bin
151        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac $(1)/usr/bin/
152endef
153
154define Package/lua-examples/install
155        $(INSTALL_DIR) $(1)/usr/share/lua/examples
156        $(INSTALL_DATA) $(PKG_BUILD_DIR)/test/*.lua \
157                $(1)/usr/share/lua/examples/
158endef
159
160$(eval $(call HostBuild))
161$(eval $(call BuildPackage,liblua))
162$(eval $(call BuildPackage,lua))
163$(eval $(call BuildPackage,luac))
164$(eval $(call BuildPackage,lua-examples))
Note: See TracBrowser for help on using the repository browser.