source: trunk/package/lua/Makefile @ 14298

Last change on this file since 14298 was 14298, checked in by nbd, 7 years ago

fix lua compile with eglibc selected and utmp support disabled

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