4 LUA_URL
:= http
://www.lua.org
/ftp
/lua-
$(LUA_VERSION
).
tar.gz
6 # Reverse priority order
27 # Feel free to add autodetection if you need to...
30 ifeq ($(call need_pkg
,"lua5.2"),)
31 PKGS_FOUND
+= lua luac
33 ifeq ($(call need_pkg
,"lua5.1"),)
34 PKGS_FOUND
+= lua luac
37 $(TARBALLS
)/lua-
$(LUA_VERSION
).
tar.gz
:
38 $(call download_pkg
,$(LUA_URL
),lua
)
40 .sum-lua
: lua-
$(LUA_VERSION
).
tar.gz
42 lua
: lua-
$(LUA_VERSION
).
tar.gz .sum-lua
44 $(APPLY
) $(SRC
)/lua
/lua-noreadline.patch
45 $(APPLY
) $(SRC
)/lua
/no-dylibs.patch
46 $(APPLY
) $(SRC
)/lua
/luac-32bits.patch
47 $(APPLY
) $(SRC
)/lua
/no-localeconv.patch
48 $(APPLY
) $(SRC
)/lua
/lua-ios-support.patch
49 $(APPLY
) $(SRC
)/lua
/implib.patch
51 $(APPLY
) $(SRC
)/lua
/lua-winrt.patch
54 (cd
$(UNPACK_DIR
) && \
55 sed
-e
's%gcc%$(CC)%' \
56 -e
's%LDFLAGS=%LDFLAGS=$(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)%' \
60 (cd
$(UNPACK_DIR
) && \
61 sed
-e
's%LIBS="-ldl"$$%LIBS="-ldl" MYLDFLAGS="$(EXTRA_LDFLAGS)"%' \
65 cd
$(UNPACK_DIR
) && sed
-i.orig
-e
's/lua luac/lua.exe luac.exe/' Makefile
67 cd
$(UNPACK_DIR
)/src
&& sed
-i.orig \
69 -e
's%= *strip%=$(STRIP)%' \
70 -e
's%= *ranlib%= $(RANLIB)%' \
75 cd
$< && $(HOSTVARS_PIC
) $(MAKE
) $(LUA_TARGET
)
77 cd
$</src
&& $(HOSTVARS
) $(MAKE
) liblua.a
79 cd
$< && $(HOSTVARS
) $(MAKE
) install INSTALL_TOP
="$(PREFIX)"
81 cd
$< && $(RANLIB
) "$(PREFIX)/lib/liblua.a"
82 mkdir
-p
-- "$(PREFIX)/lib/pkgconfig"
83 cp
$</etc
/lua.
pc "$(PREFIX)/lib/pkgconfig/"
91 ifndef HAVE_CROSS_COMPILE
92 LUACVARS
=CPPFLAGS
="-DLUA_DL_DLL"
96 luac
: lua-
$(LUA_VERSION
).
tar.gz .sum-luac
97 # DO NOT use the same intermediate directory as the lua target
98 rm -Rf
-- $@
-$(LUA_VERSION
) $@
99 mkdir
-- $@
-$(LUA_VERSION
)
100 tar -x
-v
-z
-C
$@
-$(LUA_VERSION
) --strip-components
=1 -f
$<
101 (cd luac-
$(LUA_VERSION
) && patch
-p1
) < $(SRC
)/lua
/luac-32bits.patch
102 mv luac-
$(LUA_VERSION
) luac
105 cd
$< && $(LUACVARS
) $(MAKE
) generic
106 mkdir
-p
-- $(BUILDBINDIR
)
107 install -m
0755 -s
-- $</src
/luac
$(BUILDBINDIR
)/$(HOST
)-luac