-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathluapp.patch
137 lines (121 loc) · 4.55 KB
/
luapp.patch
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
diff -Naur lua-5.3.5/Makefile luapp-5.3.5/Makefile
--- lua-5.3.5/Makefile 2016-12-20 14:26:08.000000000 -0200
+++ luapp-5.3.5/Makefile 2018-11-20 00:14:22.000000000 -0200
@@ -12,11 +12,11 @@
# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
INSTALL_TOP= /usr/local
INSTALL_BIN= $(INSTALL_TOP)/bin
-INSTALL_INC= $(INSTALL_TOP)/include
+INSTALL_INC= $(INSTALL_TOP)/include/luapp/$V
INSTALL_LIB= $(INSTALL_TOP)/lib
INSTALL_MAN= $(INSTALL_TOP)/man/man1
-INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
-INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
+INSTALL_LMOD= $(INSTALL_TOP)/share/luapp/$V
+INSTALL_CMOD= $(INSTALL_TOP)/lib/luapp/$V
# How to install. If your install program does not support "-p", then
# you may have to run ranlib on the installed liblua.a.
@@ -38,16 +38,16 @@
# Convenience platforms targets.
PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
-# What to install.
-TO_BIN= lua luac
-TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua.a
-TO_MAN= lua.1 luac.1
-
# Lua version and release.
V= 5.3
R= $V.4
+# What to install.
+TO_BIN= luapp$V luacpp$V
+TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
+TO_LIB= libluapp$V.a
+TO_MAN= lua.1 luac.1
+
# Targets start here.
all: $(PLAT)
diff -Naur lua-5.3.5/src/Makefile luapp-5.3.5/src/Makefile
--- lua-5.3.5/src/Makefile 2018-06-25 14:46:36.000000000 -0300
+++ luapp-5.3.5/src/Makefile 2018-11-20 00:15:34.000000000 -0200
@@ -6,7 +6,11 @@
# Your platform. See PLATS for possible values.
PLAT= none
-CC= gcc -std=gnu99
+# Lua version and release.
+V= 5.3
+R= $V.4
+
+CC= g++ -std=c++17 -fopenmp
CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)
@@ -28,7 +32,7 @@
PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
-LUA_A= liblua.a
+LUA_A= libluapp$V.a
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,10 +40,10 @@
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= luapp$V
LUA_O= lua.o
-LUAC_T= luac
+LUAC_T= luacpp$V
LUAC_O= luac.o
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
@@ -107,10 +111,10 @@
generic: $(ALL)
linux:
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -x c++" SYSLIBS="-Wl,-E -ldl -lgomp -lreadline"
macosx:
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline"
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -x c++" SYSLIBS="-lreadline"
mingw:
$(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \
diff -Naur lua-5.3.5/src/lua.h luapp-5.3.5/src/lua.h
--- lua-5.3.5/src/lua.h 2018-06-13 13:58:17.000000000 -0300
+++ luapp-5.3.5/src/lua.h 2018-11-19 23:16:10.000000000 -0200
@@ -21,7 +21,7 @@
#define LUA_VERSION_NUM 503
#define LUA_VERSION_RELEASE "5"
-#define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
+#define LUA_VERSION "Lua for C++ " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
#define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE
#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2018 Lua.org, PUC-Rio"
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"
diff -Naur lua-5.3.5/src/luaconf.h luapp-5.3.5/src/luaconf.h
--- lua-5.3.5/src/luaconf.h 2017-04-19 14:29:57.000000000 -0300
+++ luapp-5.3.5/src/luaconf.h 2018-11-20 00:08:40.000000000 -0200
@@ -185,9 +185,9 @@
** In Windows, any exclamation mark ('!') in the path is replaced by the
** path of the directory of the executable file of the current process.
*/
-#define LUA_LDIR "!\\lua\\"
+#define LUA_LDIR "!\\luapp\\"
#define LUA_CDIR "!\\"
-#define LUA_SHRDIR "!\\..\\share\\lua\\" LUA_VDIR "\\"
+#define LUA_SHRDIR "!\\..\\share\\luapp\\" LUA_VDIR "\\"
#define LUA_PATH_DEFAULT \
LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" \
@@ -195,14 +195,14 @@
".\\?.lua;" ".\\?\\init.lua"
#define LUA_CPATH_DEFAULT \
LUA_CDIR"?.dll;" \
- LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \
+ LUA_CDIR"..\\lib\\luapp\\" LUA_VDIR "\\?.dll;" \
LUA_CDIR"loadall.dll;" ".\\?.dll"
#else /* }{ */
#define LUA_ROOT "/usr/local/"
-#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/"
-#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/"
+#define LUA_LDIR LUA_ROOT "share/luapp/" LUA_VDIR "/"
+#define LUA_CDIR LUA_ROOT "lib/luapp/" LUA_VDIR "/"
#define LUA_PATH_DEFAULT \
LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \