Skip to content

Commit 92fa4ae

Browse files
committed
add luajit
1 parent f0f88c9 commit 92fa4ae

File tree

254 files changed

+155538
-34
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+155538
-34
lines changed

3rd/LuaJIT/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.relver export-subst

3rd/LuaJIT/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.[oa]
2+
*.so
3+
*.obj
4+
*.lib
5+
*.exp
6+
*.dll
7+
*.exe
8+
*.manifest
9+
*.dmp
10+
*.swp
11+
.tags

3rd/LuaJIT/.relver

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$Format:%ct$

3rd/LuaJIT/COPYRIGHT

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
===============================================================================
2+
LuaJIT -- a Just-In-Time Compiler for Lua. https://luajit.org/
3+
4+
Copyright (C) 2005-2023 Mike Pall. All rights reserved.
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.
23+
24+
[ MIT license: https://www.opensource.org/licenses/mit-license.php ]
25+
26+
===============================================================================
27+
[ LuaJIT includes code from Lua 5.1/5.2, which has this license statement: ]
28+
29+
Copyright (C) 1994-2012 Lua.org, PUC-Rio.
30+
31+
Permission is hereby granted, free of charge, to any person obtaining a copy
32+
of this software and associated documentation files (the "Software"), to deal
33+
in the Software without restriction, including without limitation the rights
34+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35+
copies of the Software, and to permit persons to whom the Software is
36+
furnished to do so, subject to the following conditions:
37+
38+
The above copyright notice and this permission notice shall be included in
39+
all copies or substantial portions of the Software.
40+
41+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
47+
THE SOFTWARE.
48+
49+
===============================================================================
50+
[ LuaJIT includes code from dlmalloc, which has this license statement: ]
51+
52+
This is a version (aka dlmalloc) of malloc/free/realloc written by
53+
Doug Lea and released to the public domain, as explained at
54+
https://creativecommons.org/licenses/publicdomain
55+
56+
===============================================================================

3rd/LuaJIT/Makefile

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
##############################################################################
2+
# LuaJIT top level Makefile for installation. Requires GNU Make.
3+
#
4+
# Please read doc/install.html before changing any variables!
5+
#
6+
# Suitable for POSIX platforms (Linux, *BSD, OSX etc.).
7+
# Note: src/Makefile has many more configurable options.
8+
#
9+
# ##### This Makefile is NOT useful for Windows! #####
10+
# For MSVC, please follow the instructions given in src/msvcbuild.bat.
11+
# For MinGW and Cygwin, cd to src and run make with the Makefile there.
12+
#
13+
# Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h
14+
##############################################################################
15+
16+
MAJVER= 2
17+
MINVER= 1
18+
ABIVER= 5.1
19+
20+
# LuaJIT uses rolling releases. The release version is based on the time of
21+
# the latest git commit. The 'git' command must be available during the build.
22+
RELVER= $(shell cat src/luajit_relver.txt 2>/dev/null || : )
23+
# Note: setting it with := doesn't work, since it will change during the build.
24+
25+
MMVERSION= $(MAJVER).$(MINVER)
26+
VERSION= $(MMVERSION).$(RELVER)
27+
28+
##############################################################################
29+
#
30+
# Change the installation path as needed. This automatically adjusts
31+
# the paths in src/luaconf.h, too. Note: PREFIX must be an absolute path!
32+
#
33+
export PREFIX= /usr/local
34+
export MULTILIB= lib
35+
##############################################################################
36+
37+
DPREFIX= $(DESTDIR)$(PREFIX)
38+
INSTALL_BIN= $(DPREFIX)/bin
39+
INSTALL_LIB= $(DPREFIX)/$(MULTILIB)
40+
INSTALL_SHARE= $(DPREFIX)/share
41+
INSTALL_DEFINC= $(DPREFIX)/include/luajit-$(MMVERSION)
42+
INSTALL_INC= $(INSTALL_DEFINC)
43+
44+
export INSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(MMVERSION)
45+
INSTALL_JITLIB= $(INSTALL_LJLIBD)/jit
46+
INSTALL_LMODD= $(INSTALL_SHARE)/lua
47+
INSTALL_LMOD= $(INSTALL_LMODD)/$(ABIVER)
48+
INSTALL_CMODD= $(INSTALL_LIB)/lua
49+
INSTALL_CMOD= $(INSTALL_CMODD)/$(ABIVER)
50+
INSTALL_MAN= $(INSTALL_SHARE)/man/man1
51+
INSTALL_PKGCONFIG= $(INSTALL_LIB)/pkgconfig
52+
53+
INSTALL_TNAME= luajit-$(VERSION)
54+
INSTALL_TSYMNAME= luajit
55+
INSTALL_ANAME= libluajit-$(ABIVER).a
56+
INSTALL_SOSHORT1= libluajit-$(ABIVER).so
57+
INSTALL_SOSHORT2= libluajit-$(ABIVER).so.$(MAJVER)
58+
INSTALL_SONAME= libluajit-$(ABIVER).so.$(VERSION)
59+
INSTALL_DYLIBSHORT1= libluajit-$(ABIVER).dylib
60+
INSTALL_DYLIBSHORT2= libluajit-$(ABIVER).$(MAJVER).dylib
61+
INSTALL_DYLIBNAME= libluajit-$(ABIVER).$(VERSION).dylib
62+
INSTALL_PCNAME= luajit.pc
63+
64+
INSTALL_STATIC= $(INSTALL_LIB)/$(INSTALL_ANAME)
65+
INSTALL_DYN= $(INSTALL_LIB)/$(INSTALL_SONAME)
66+
INSTALL_SHORT1= $(INSTALL_LIB)/$(INSTALL_SOSHORT1)
67+
INSTALL_SHORT2= $(INSTALL_LIB)/$(INSTALL_SOSHORT2)
68+
INSTALL_T= $(INSTALL_BIN)/$(INSTALL_TNAME)
69+
INSTALL_TSYM= $(INSTALL_BIN)/$(INSTALL_TSYMNAME)
70+
INSTALL_PC= $(INSTALL_PKGCONFIG)/$(INSTALL_PCNAME)
71+
72+
INSTALL_DIRS= $(INSTALL_BIN) $(INSTALL_LIB) $(INSTALL_INC) $(INSTALL_MAN) \
73+
$(INSTALL_PKGCONFIG) $(INSTALL_JITLIB) $(INSTALL_LMOD) $(INSTALL_CMOD)
74+
UNINSTALL_DIRS= $(INSTALL_JITLIB) $(INSTALL_LJLIBD) $(INSTALL_INC) \
75+
$(INSTALL_LMOD) $(INSTALL_LMODD) $(INSTALL_CMOD) $(INSTALL_CMODD)
76+
77+
RM= rm -f
78+
MKDIR= mkdir -p
79+
RMDIR= rmdir 2>/dev/null
80+
SYMLINK= ln -sf
81+
INSTALL_X= install -m 0755
82+
INSTALL_F= install -m 0644
83+
UNINSTALL= $(RM)
84+
LDCONFIG= ldconfig -n 2>/dev/null
85+
SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|" \
86+
-e "s|^multilib=.*|multilib=$(MULTILIB)|" \
87+
-e "s|^relver=.*|relver=$(RELVER)|"
88+
ifneq ($(INSTALL_DEFINC),$(INSTALL_INC))
89+
SED_PC+= -e "s|^includedir=.*|includedir=$(INSTALL_INC)|"
90+
endif
91+
92+
FILE_T= luajit
93+
FILE_A= libluajit.a
94+
FILE_SO= libluajit.so
95+
FILE_MAN= luajit.1
96+
FILE_PC= luajit.pc
97+
FILES_INC= lua.h lualib.h lauxlib.h luaconf.h lua.hpp luajit.h
98+
FILES_JITLIB= bc.lua bcsave.lua dump.lua p.lua v.lua zone.lua \
99+
dis_x86.lua dis_x64.lua dis_arm.lua dis_arm64.lua \
100+
dis_arm64be.lua dis_ppc.lua dis_mips.lua dis_mipsel.lua \
101+
dis_mips64.lua dis_mips64el.lua \
102+
dis_mips64r6.lua dis_mips64r6el.lua \
103+
vmdef.lua
104+
105+
ifeq (,$(findstring Windows,$(OS)))
106+
HOST_SYS:= $(shell uname -s)
107+
else
108+
HOST_SYS= Windows
109+
endif
110+
TARGET_SYS?= $(HOST_SYS)
111+
112+
ifeq (Darwin,$(TARGET_SYS))
113+
INSTALL_SONAME= $(INSTALL_DYLIBNAME)
114+
INSTALL_SOSHORT1= $(INSTALL_DYLIBSHORT1)
115+
INSTALL_SOSHORT2= $(INSTALL_DYLIBSHORT2)
116+
LDCONFIG= :
117+
SED_PC+= -e "s| -Wl,-E||"
118+
endif
119+
120+
##############################################################################
121+
122+
INSTALL_DEP= src/luajit
123+
124+
default all $(INSTALL_DEP):
125+
@echo "==== Building LuaJIT $(MMVERSION) ===="
126+
$(MAKE) -C src
127+
@echo "==== Successfully built LuaJIT $(MMVERSION) ===="
128+
129+
install: $(INSTALL_DEP)
130+
@echo "==== Installing LuaJIT $(VERSION) to $(PREFIX) ===="
131+
$(MKDIR) $(INSTALL_DIRS)
132+
cd src && $(INSTALL_X) $(FILE_T) $(INSTALL_T)
133+
cd src && test -f $(FILE_A) && $(INSTALL_F) $(FILE_A) $(INSTALL_STATIC) || :
134+
$(RM) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2)
135+
cd src && test -f $(FILE_SO) && \
136+
$(INSTALL_X) $(FILE_SO) $(INSTALL_DYN) && \
137+
( $(LDCONFIG) $(INSTALL_LIB) || : ) && \
138+
$(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT1) && \
139+
$(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT2) || :
140+
cd etc && $(INSTALL_F) $(FILE_MAN) $(INSTALL_MAN)
141+
cd etc && $(SED_PC) $(FILE_PC) > $(FILE_PC).tmp && \
142+
$(INSTALL_F) $(FILE_PC).tmp $(INSTALL_PC) && \
143+
$(RM) $(FILE_PC).tmp
144+
cd src && $(INSTALL_F) $(FILES_INC) $(INSTALL_INC)
145+
cd src/jit && $(INSTALL_F) $(FILES_JITLIB) $(INSTALL_JITLIB)
146+
$(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM)
147+
@echo "==== Successfully installed LuaJIT $(VERSION) to $(PREFIX) ===="
148+
149+
uninstall:
150+
@echo "==== Uninstalling LuaJIT $(VERSION) from $(PREFIX) ===="
151+
$(UNINSTALL) $(INSTALL_TSYM) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC)
152+
for file in $(FILES_JITLIB); do \
153+
$(UNINSTALL) $(INSTALL_JITLIB)/$$file; \
154+
done
155+
for file in $(FILES_INC); do \
156+
$(UNINSTALL) $(INSTALL_INC)/$$file; \
157+
done
158+
$(LDCONFIG) $(INSTALL_LIB)
159+
$(RMDIR) $(UNINSTALL_DIRS) || :
160+
@echo "==== Successfully uninstalled LuaJIT $(VERSION) from $(PREFIX) ===="
161+
162+
##############################################################################
163+
164+
amalg:
165+
@echo "==== Building LuaJIT $(MMVERSION) (amalgamation) ===="
166+
$(MAKE) -C src amalg
167+
@echo "==== Successfully built LuaJIT $(MMVERSION) (amalgamation) ===="
168+
169+
clean:
170+
$(MAKE) -C src clean
171+
172+
.PHONY: all install amalg clean
173+
174+
##############################################################################

3rd/LuaJIT/README

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
README for LuaJIT 2.1
2+
---------------------
3+
4+
LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language.
5+
6+
Project Homepage: https://luajit.org/
7+
8+
LuaJIT is Copyright (C) 2005-2023 Mike Pall.
9+
LuaJIT is free software, released under the MIT license.
10+
See full Copyright Notice in the COPYRIGHT file or in luajit.h.
11+
12+
Documentation for LuaJIT is available in HTML format.
13+
Please point your favorite browser to:
14+
15+
doc/luajit.html
16+

0 commit comments

Comments
 (0)