78f00549607f98421ca89d9cba9595ef27285949
[openwrt/staging/jow.git] / package / utils / lua5.3 / patches-host / 001-include-version-number.patch
1 From 96576b44a1b368bd6590eb0778ae45cc9ccede3f Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Fri, 21 Jun 2019 14:08:38 +0200
4 Subject: [PATCH] include version number
5
6 Including it allows multiple lua versions to coexist.
7
8 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
9 ---
10
11 diff --git a/Makefile b/Makefile
12 --- a/Makefile
13 +++ b/Makefile
14 @@ -12,7 +12,7 @@ PLAT= none
15 # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
16 INSTALL_TOP= /usr/local
17 INSTALL_BIN= $(INSTALL_TOP)/bin
18 -INSTALL_INC= $(INSTALL_TOP)/include
19 +INSTALL_INC= $(INSTALL_TOP)/include/lua$V
20 INSTALL_LIB= $(INSTALL_TOP)/lib
21 INSTALL_MAN= $(INSTALL_TOP)/man/man1
22 INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
23 @@ -39,10 +39,10 @@ RM= rm -f
24 PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
25
26 # What to install.
27 -TO_BIN= lua luac
28 +TO_BIN= lua$V luac$V
29 TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
30 -TO_LIB= liblua.a
31 -TO_MAN= lua.1 luac.1
32 +TO_LIB= liblua$V.a
33 +TO_MAN= lua$V.1 luac$V.1
34
35 # Lua version and release.
36 V= 5.3
37 @@ -52,7 +52,7 @@ R= $V.4
38 all: $(PLAT)
39
40 $(PLATS) clean:
41 - cd src && $(MAKE) $@
42 + cd src && $(MAKE) $@ V=$V
43
44 test: dummy
45 src/lua -v
46 diff --git a/doc/lua.1 b/doc/lua5.3.1
47 rename from doc/lua.1
48 rename to doc/lua5.3.1
49 diff --git a/doc/luac.1 b/doc/luac5.3.1
50 rename from doc/luac.1
51 rename to doc/luac5.3.1
52 diff --git a/src/Makefile b/src/Makefile
53 --- a/src/Makefile
54 +++ b/src/Makefile
55 @@ -28,7 +28,7 @@ MYOBJS=
56
57 PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
58
59 -LUA_A= liblua.a
60 +LUA_A= liblua$V.a
61 CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
62 lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
63 ltm.o lundump.o lvm.o lzio.o
64 @@ -36,10 +36,10 @@ LIB_O= lauxlib.o lbaselib.o lbitlib.o lc
65 lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o
66 BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
67
68 -LUA_T= lua
69 +LUA_T= lua$V
70 LUA_O= lua.o
71
72 -LUAC_T= luac
73 +LUAC_T= luac$V
74 LUAC_O= luac.o
75
76 ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)