1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
diff -ur lua-5.3.5/Makefile lua-5.3.5+iPhone/Makefile
--- lua-5.3.5/Makefile 2016-12-20 06:26:08.000000000 -1000
+++ lua-5.3.5+iPhone/Makefile 2019-04-08 22:32:10.000000000 -1000
@@ -10,7 +10,8 @@
# so take care if INSTALL_TOP is not an absolute path. See the local target.
# You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
-INSTALL_TOP= /usr/local
+PREFIX= /usr
+INSTALL_TOP?= $(DESTDIR)/$(PREFIX)
INSTALL_BIN= $(INSTALL_TOP)/bin
-INSTALL_INC= $(INSTALL_TOP)/include
+INSTALL_INC= $(INSTALL_TOP)/include/lua$(V)
INSTALL_LIB= $(INSTALL_TOP)/lib
@@ -36,17 +37,21 @@
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
# Convenience platforms targets.
-PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
+PLATS= aix bsd c89 freebsd generic linux macosx ios mingw posix solaris
# What to install.
-TO_BIN= lua luac
+TO_BIN= lua$(V) luac$(V)
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua.a
TO_MAN= lua.1 luac.1
+TO_LIB= liblua$(V).dylib
# Lua version and release.
-V= 5.3
-R= $V.4
+R= $V.5
+VERSION_MAJOR=$(word 1,$(subst ., ,$(PKG_VRSN)))
+VERSION_MINOR=$(word 2,$(subst ., ,$(PKG_VRSN)))
+V= $(VERSION_MAJOR).$(VERSION_MINOR)
+R=$(word 3,$(subst ., ,$(PKG_VRSN)))
+export VERSION_MAJOR VERSION_MINOR V R
# Targets start here.
all: $(PLAT)
diff -ur lua-5.3.5/src/Makefile lua-5.3.5+iPhone/src/Makefile
--- lua-5.3.5/src/Makefile 2018-06-25 07:46:36.000000000 -1000
+++ lua-5.3.5+iPhone/src/Makefile 2019-04-08 22:32:23.000000000 -1000
@@ -26,9 +26,10 @@
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
-PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
+PLATS= aix bsd c89 freebsd generic linux macosx ios mingw posix solaris
LUA_A= liblua.a
+LUA_DYLIB= liblua$(V).dylib
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
ltm.o lundump.o lvm.o lzio.o
@@ -36,15 +37,16 @@
lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o
BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
-LUA_T= lua
+LUA_T= lua$(V)
LUA_O= lua.o
-LUAC_T= luac
+LUAC_T= luac$(V)
LUAC_O= luac.o
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+ALL_T= $(LUA_DYLIB) $(LUA_T) $(LUAC_T)
ALL_A= $(LUA_A)
+ALL_DYLIB= $(LUA_DYLIB)
# Targets start here.
default: $(PLAT)
@@ -55,15 +57,20 @@
a: $(ALL_A)
+dylib: $(ALL_DYLIB)
+
$(LUA_A): $(BASE_O)
$(AR) $@ $(BASE_O)
$(RANLIB) $@
-$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+$(LUA_DYLIB): $(BASE_O)
+ $(CC) -dynamiclib -install_name $(PREFIX)/lib/$@ -compatibility_version $(V) -current_version $(V).$(R) -o $@ $^
+
+$(LUA_T): $(LUA_O) $(LUA_DYLIB)
+ $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_DYLIB) $(LIBS)
-$(LUAC_T): $(LUAC_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+$(LUAC_T): $(LUAC_O) $(LUA_DYLIB)
+ $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_DYLIB) $(LIBS)
clean:
$(RM) $(ALL_T) $(ALL_O)
@@ -112,6 +119,9 @@
macosx:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline"
+ios:
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline"
+
mingw:
$(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \
"AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
|