Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions external/sources/LuaJIT-2.1/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.relver export-subst
*.bat text eol=crlf
7 changes: 6 additions & 1 deletion external/sources/LuaJIT-2.1/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ src/*.lib
*.so
*.obj
*.exp
*.pdb
*.dll
*.exe
*.manifest
Expand All @@ -17,6 +18,7 @@ _Bin/libluajit*

#cmake
/build/
/build-*/
cmake_install.cmake
CmakeCache.txt
/CMakeFiles*
Expand All @@ -26,4 +28,7 @@ ALL_BUILD.vcxproj.filters
INSTALL.vcxproj
INSTALL.vcxproj.filters
ZERO_CHECK.vcxproj
ZERO_CHECK.vcxproj.filters
ZERO_CHECK.vcxproj.filters

#Mac OS junk
.DS_Store
1 change: 1 addition & 0 deletions external/sources/LuaJIT-2.1/.relver
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$Format:%ct$
17 changes: 17 additions & 0 deletions external/sources/LuaJIT-2.1/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 3.0...4.0)

list(APPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
)

set(LUAJIT_TOP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})

project(luajit)

set(can_use_assembler TRUE)
enable_language(ASM)

include (GNUInstallDirs)

add_subdirectory(src)
2 changes: 1 addition & 1 deletion external/sources/LuaJIT-2.1/COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
===============================================================================
LuaJIT -- a Just-In-Time Compiler for Lua. https://luajit.org/

Copyright (C) 2005-2022 Mike Pall. All rights reserved.
Copyright (C) 2005-2026 Mike Pall. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
55 changes: 30 additions & 25 deletions external/sources/LuaJIT-2.1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@
# For MSVC, please follow the instructions given in src/msvcbuild.bat.
# For MinGW and Cygwin, cd to src and run make with the Makefile there.
#
# Copyright (C) 2005-2022 Mike Pall. See Copyright Notice in luajit.h
# Copyright (C) 2005-2026 Mike Pall. See Copyright Notice in luajit.h
##############################################################################

MAJVER= 2
MINVER= 1
RELVER= 0
PREREL= -beta3
VERSION= $(MAJVER).$(MINVER).$(RELVER)$(PREREL)
ABIVER= 5.1

# LuaJIT uses rolling releases. The release version is based on the time of
# the latest git commit. The 'git' command must be available during the build.
RELVER= $(shell cat src/luajit_relver.txt 2>/dev/null || : )
# Note: setting it with := doesn't work, since it will change during the build.

MMVERSION= $(MAJVER).$(MINVER)
VERSION= $(MMVERSION).$(RELVER)

##############################################################################
#
# Change the installation path as needed. This automatically adjusts
Expand All @@ -32,12 +37,13 @@ export MULTILIB= lib
DPREFIX= $(DESTDIR)$(PREFIX)
INSTALL_BIN= $(DPREFIX)/bin
INSTALL_LIB= $(DPREFIX)/$(MULTILIB)
INSTALL_SHARE= $(DPREFIX)/share
INSTALL_DEFINC= $(DPREFIX)/include/luajit-$(MAJVER).$(MINVER)
INSTALL_SHARE_= $(PREFIX)/share
INSTALL_SHARE= $(DESTDIR)$(INSTALL_SHARE_)
INSTALL_DEFINC= $(DPREFIX)/include/luajit-$(MMVERSION)
INSTALL_INC= $(INSTALL_DEFINC)

INSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(VERSION)
INSTALL_JITLIB= $(INSTALL_LJLIBD)/jit
export INSTALL_LJLIBD= $(INSTALL_SHARE_)/luajit-$(MMVERSION)
INSTALL_JITLIB= $(DESTDIR)$(INSTALL_LJLIBD)/jit
INSTALL_LMODD= $(INSTALL_SHARE)/lua
INSTALL_LMOD= $(INSTALL_LMODD)/$(ABIVER)
INSTALL_CMODD= $(INSTALL_LIB)/lua
Expand All @@ -50,10 +56,10 @@ INSTALL_TSYMNAME= luajit
INSTALL_ANAME= libluajit-$(ABIVER).a
INSTALL_SOSHORT1= libluajit-$(ABIVER).so
INSTALL_SOSHORT2= libluajit-$(ABIVER).so.$(MAJVER)
INSTALL_SONAME= $(INSTALL_SOSHORT2).$(MINVER).$(RELVER)
INSTALL_SONAME= libluajit-$(ABIVER).so.$(VERSION)
INSTALL_DYLIBSHORT1= libluajit-$(ABIVER).dylib
INSTALL_DYLIBSHORT2= libluajit-$(ABIVER).$(MAJVER).dylib
INSTALL_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).$(MINVER).$(RELVER).dylib
INSTALL_DYLIBNAME= libluajit-$(ABIVER).$(VERSION).dylib
INSTALL_PCNAME= luajit.pc

INSTALL_STATIC= $(INSTALL_LIB)/$(INSTALL_ANAME)
Expand All @@ -66,7 +72,7 @@ INSTALL_PC= $(INSTALL_PKGCONFIG)/$(INSTALL_PCNAME)

INSTALL_DIRS= $(INSTALL_BIN) $(INSTALL_LIB) $(INSTALL_INC) $(INSTALL_MAN) \
$(INSTALL_PKGCONFIG) $(INSTALL_JITLIB) $(INSTALL_LMOD) $(INSTALL_CMOD)
UNINSTALL_DIRS= $(INSTALL_JITLIB) $(INSTALL_LJLIBD) $(INSTALL_INC) \
UNINSTALL_DIRS= $(INSTALL_JITLIB) $(DESTDIR)$(INSTALL_LJLIBD) $(INSTALL_INC) \
$(INSTALL_LMOD) $(INSTALL_LMODD) $(INSTALL_CMOD) $(INSTALL_CMODD)

RM= rm -f
Expand All @@ -78,7 +84,8 @@ INSTALL_F= install -m 0644
UNINSTALL= $(RM)
LDCONFIG= ldconfig -n 2>/dev/null
SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|" \
-e "s|^multilib=.*|multilib=$(MULTILIB)|"
-e "s|^multilib=.*|multilib=$(MULTILIB)|" \
-e "s|^relver=.*|relver=$(RELVER)|"
ifneq ($(INSTALL_DEFINC),$(INSTALL_INC))
SED_PC+= -e "s|^includedir=.*|includedir=$(INSTALL_INC)|"
endif
Expand All @@ -92,7 +99,9 @@ FILES_INC= lua.h lualib.h lauxlib.h luaconf.h lua.hpp luajit.h
FILES_JITLIB= bc.lua bcsave.lua dump.lua p.lua v.lua zone.lua \
dis_x86.lua dis_x64.lua dis_arm.lua dis_arm64.lua \
dis_arm64be.lua dis_ppc.lua dis_mips.lua dis_mipsel.lua \
dis_mips64.lua dis_mips64el.lua vmdef.lua
dis_mips64.lua dis_mips64el.lua \
dis_mips64r6.lua dis_mips64r6el.lua \
vmdef.lua

ifeq (,$(findstring Windows,$(OS)))
HOST_SYS:= $(shell uname -s)
Expand All @@ -101,21 +110,22 @@ else
endif
TARGET_SYS?= $(HOST_SYS)

ifeq (Darwin,$(TARGET_SYS))
ifneq (,$(filter $(TARGET_SYS),Darwin iOS))
INSTALL_SONAME= $(INSTALL_DYLIBNAME)
INSTALL_SOSHORT1= $(INSTALL_DYLIBSHORT1)
INSTALL_SOSHORT2= $(INSTALL_DYLIBSHORT2)
LDCONFIG= :
SED_PC+= -e "s| -Wl,-E||"
endif

##############################################################################

INSTALL_DEP= src/luajit

default all $(INSTALL_DEP):
@echo "==== Building LuaJIT $(VERSION) ===="
@echo "==== Building LuaJIT $(MMVERSION) ===="
$(MAKE) -C src
@echo "==== Successfully built LuaJIT $(VERSION) ===="
@echo "==== Successfully built LuaJIT $(MMVERSION) ===="

install: $(INSTALL_DEP)
@echo "==== Installing LuaJIT $(VERSION) to $(PREFIX) ===="
Expand All @@ -134,18 +144,12 @@ install: $(INSTALL_DEP)
$(RM) $(FILE_PC).tmp
cd src && $(INSTALL_F) $(FILES_INC) $(INSTALL_INC)
cd src/jit && $(INSTALL_F) $(FILES_JITLIB) $(INSTALL_JITLIB)
$(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM)
@echo "==== Successfully installed LuaJIT $(VERSION) to $(PREFIX) ===="
@echo ""
@echo "Note: the development releases deliberately do NOT install a symlink for luajit"
@echo "You can do this now by running this command (with sudo):"
@echo ""
@echo " $(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM)"
@echo ""


uninstall:
@echo "==== Uninstalling LuaJIT $(VERSION) from $(PREFIX) ===="
$(UNINSTALL) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC)
$(UNINSTALL) $(INSTALL_TSYM) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC)
for file in $(FILES_JITLIB); do \
$(UNINSTALL) $(INSTALL_JITLIB)/$$file; \
done
Expand All @@ -159,8 +163,9 @@ uninstall:
##############################################################################

amalg:
@echo "Building LuaJIT $(VERSION)"
@echo "==== Building LuaJIT $(MMVERSION) (amalgamation) ===="
$(MAKE) -C src amalg
@echo "==== Successfully built LuaJIT $(MMVERSION) (amalgamation) ===="

clean:
$(MAKE) -C src clean
Expand Down
16 changes: 16 additions & 0 deletions external/sources/LuaJIT-2.1/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
README for LuaJIT 2.1
---------------------

LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language.

Project Homepage: https://luajit.org/

LuaJIT is Copyright (C) 2005-2026 Mike Pall.
LuaJIT is free software, released under the MIT license.
See full Copyright Notice in the COPYRIGHT file or in luajit.h.

Documentation for LuaJIT is available in HTML format.
Please point your favorite browser to:

doc/luajit.html

17 changes: 13 additions & 4 deletions external/sources/LuaJIT-2.1/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
README for LuaJIT 2.1.0-beta3
-----------------------------
# LuaJIT + CMake & UTF8-paths-on-Windows
There is the modified version of LuaJIT that has the next difference from the original version:
* In addition to its default GNU Make-based build, there is a CMake-based build was added
* Enforces the UTF-8 charset for file system-related functions to ensure the equal result on all supported platforms (without this addition, locale-depending ANSI charsets used on Windows) (You should specify the `-DLUAJIT_FORCE_UTF8_FOPEN=ON` CMake option to enable this feature)

If you find a bug using CMake build, please **DON'T REPORT IT TO OFFICIAL LuaJIT developers**, as they refuse to take the CMake building system support. So, you MUST verify the [latest original version](https://github.com/LuaJIT/LuaJIT) using the GNU Make-based building system to ensure that the same bug gets reproduced too:
* If the bug gets reproduced at both CMake and GNU-Make-based builds, feel free to report the bug to [official LuaJIT developers](https://github.com/LuaJIT/LuaJIT/issues).
* If the bug gets reproduced at the CMake-based build only, however, doesn't reproduce at the official GNU-Make-based build, you [should report this bug to me](https://github.com/WohlSoft/LuaJIT/issues).

# Original readme
## README for LuaJIT 2.1
---------------------

LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language.

Project Homepage: https://luajit.org/

LuaJIT is Copyright (C) 2005-2022 Mike Pall.
LuaJIT is Copyright (C) 2005-2025 Mike Pall.
LuaJIT is free software, released under the MIT license.
See full Copyright Notice in the COPYRIGHT file or in luajit.h.

Documentation for LuaJIT is available in HTML format.
Please point your favorite browser to:

doc/luajit.html

Binary file modified external/sources/LuaJIT-2.1/_Bin/luajit-debug-release.lib
Binary file not shown.
Binary file modified external/sources/LuaJIT-2.1/_Bin/luajit-debug.lib
Binary file not shown.
Binary file modified external/sources/LuaJIT-2.1/_Bin/luajit-release.lib
Binary file not shown.
29 changes: 29 additions & 0 deletions external/sources/LuaJIT-2.1/cmake/modules/DetectArchitecture.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#if defined(__aarch64__) || defined(__arm64__)
const char *str = "ARCHITECTURE IS AArch64";
#elif defined(__arm__) || defined(__arm) || defined(__ARM__) || defined(__ARM)
const char *str = "ARCHITECTURE IS ARM";
#elif defined(__alpha__)
const char *str = "ARCHITECTURE IS Alpha";
#elif defined(__mips64__) || defined(__mips64) || defined(__MIPS64__) || defined(__MIPS64)
const char *str = "ARCHITECTURE IS Mips64";
#elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(__MIPS)
const char *str = "ARCHITECTURE IS Mips";
#elif defined(__ppc__) || defined(__ppc) || defined(__PPC__) || defined(__PPC) || defined(__powerpc__) || defined(__powerpc) || defined(__POWERPC__) || defined(__POWERPC) || defined(_M_PPC)
const char *str = "ARCHITECTURE IS PowerPC";
#elif defined(__s390__)
const char *str = "ARCHITECTURE IS SystemZ";
#elif defined(__sparc__)
const char *str = "ARCHITECTURE IS Sparc";
#elif defined(__xcore__)
const char *str = "ARCHITECTURE IS XCore";
#elif defined(__i386__) || defined(__i686__) || defined(_M_IX86)
const char *str = "ARCHITECTURE IS x86";
#elif defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)
const char *str = "ARCHITECTURE IS x86_64";
#endif

int main(int argc, char **argv) {
int require = str[argc];
(void)argv;
return require;
}
44 changes: 44 additions & 0 deletions external/sources/LuaJIT-2.1/cmake/modules/DetectArchitecture.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

##===- DetectArchitecture.cmake -------------------------------------------===##
#
# Performs a try_compile to determine the architecture of the target.
#
##===----------------------------------------------------------------------===##
get_filename_component(__check_architecture_size_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)

include(CMakePushCheckState)

macro(detect_architecture variable)
set(TMP_CMAKE_POSITION_INDEPENDENT_CODE ${CMAKE_POSITION_INDEPENDENT_CODE})
set(CMAKE_POSITION_INDEPENDENT_CODE OFF)
try_compile(HAVE_${variable}
${CMAKE_BINARY_DIR}
${__check_architecture_size_dir}/DetectArchitecture.c
OUTPUT_VARIABLE OUTPUT
COPY_FILE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/DetectArchitecture.bin)
set(CMAKE_POSITION_INDEPENDENT_CODE ${TMP_CMAKE_POSITION_INDEPENDENT_CODE})
unset(TMP_CMAKE_POSITION_INDEPENDENT_CODE)


if(HAVE_${variable})
file(STRINGS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/DetectArchitecture.bin
DETECT_ARCH_STRING LIMIT_COUNT 1 REGEX "ARCHITECTURE IS")
if(DETECT_ARCH_STRING)
string(REGEX MATCH "[^ ]*$" DETECT_ARCH_MATCH ${DETECT_ARCH_STRING})
if(DETECT_ARCH_MATCH)
message(STATUS "Check target system architecture: ${DETECT_ARCH_MATCH}")
set(${variable} ${DETECT_ARCH_MATCH})
else()
message(SEND_ERROR "Could not detect target system architecture!")
endif()
else()
message(SEND_ERROR "Could not detect target system architecture!")
endif()
else()
message(STATUS "Determine the system architecture - failed")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining the system architecture failed with the following output:\n${OUTPUT}")
set(${variable})
endif()

endmacro(detect_architecture)
Loading
Loading