diff options
author | Mike Pall <mike> | 2023-08-21 03:06:26 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2023-08-21 03:06:26 +0200 |
commit | 50e0fa03c48cb9af03c3efdc3100f12687651a2e (patch) | |
tree | ad5e693de66cc012374445575b70379bc6047123 /src | |
parent | c34594681909cac98d44629863df2c7afd93eaf0 (diff) | |
download | luajit-2.0.ROLLING.tar.gz luajit-2.0.ROLLING.tar.bz2 luajit-2.0.ROLLING.zip |
Switch build system to rolling releases.v2.0.ROLLING
Diffstat (limited to '')
-rw-r--r-- | src/.gitignore | 2 | ||||
-rw-r--r-- | src/Makefile | 23 | ||||
-rw-r--r-- | src/host/buildvm.c | 1 | ||||
-rw-r--r-- | src/host/genversion.lua | 43 | ||||
-rw-r--r-- | src/jit/bc.lua | 1 | ||||
-rw-r--r-- | src/jit/bcsave.lua | 2 | ||||
-rw-r--r-- | src/jit/dump.lua | 1 | ||||
-rw-r--r-- | src/jit/v.lua | 1 | ||||
-rw-r--r-- | src/lib_jit.c | 2 | ||||
-rw-r--r-- | src/luaconf.h | 2 | ||||
-rw-r--r-- | src/luajit_rolling.h (renamed from src/luajit.h) | 6 |
11 files changed, 68 insertions, 16 deletions
diff --git a/src/.gitignore b/src/.gitignore index fc94e82c..19f2a00e 100644 --- a/src/.gitignore +++ b/src/.gitignore | |||
@@ -1,4 +1,6 @@ | |||
1 | luajit | 1 | luajit |
2 | luajit.h | ||
3 | luajit_relver.txt | ||
2 | lj_bcdef.h | 4 | lj_bcdef.h |
3 | lj_ffdef.h | 5 | lj_ffdef.h |
4 | lj_libdef.h | 6 | lj_libdef.h |
diff --git a/src/Makefile b/src/Makefile index aac78beb..e6954a95 100644 --- a/src/Makefile +++ b/src/Makefile | |||
@@ -12,7 +12,6 @@ | |||
12 | 12 | ||
13 | MAJVER= 2 | 13 | MAJVER= 2 |
14 | MINVER= 0 | 14 | MINVER= 0 |
15 | RELVER= 5 | ||
16 | ABIVER= 5.1 | 15 | ABIVER= 5.1 |
17 | NODOTABIVER= 51 | 16 | NODOTABIVER= 51 |
18 | 17 | ||
@@ -308,7 +307,7 @@ ifeq (Darwin,$(TARGET_SYS)) | |||
308 | TARGET_STRIP+= -x | 307 | TARGET_STRIP+= -x |
309 | TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC | 308 | TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC |
310 | TARGET_DYNXLDOPTS= | 309 | TARGET_DYNXLDOPTS= |
311 | TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) | 310 | TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).255 |
312 | ifeq (x64,$(TARGET_LJARCH)) | 311 | ifeq (x64,$(TARGET_LJARCH)) |
313 | TARGET_XLDFLAGS+= -pagezero_size 10000 -image_base 100000000 | 312 | TARGET_XLDFLAGS+= -pagezero_size 10000 -image_base 100000000 |
314 | TARGET_XSHLDFLAGS+= -image_base 7fff04c4a000 | 313 | TARGET_XSHLDFLAGS+= -image_base 7fff04c4a000 |
@@ -318,7 +317,7 @@ ifeq (iOS,$(TARGET_SYS)) | |||
318 | TARGET_STRIP+= -x | 317 | TARGET_STRIP+= -x |
319 | TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC | 318 | TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC |
320 | TARGET_DYNXLDOPTS= | 319 | TARGET_DYNXLDOPTS= |
321 | TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) | 320 | TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).255 |
322 | else | 321 | else |
323 | ifneq (SunOS,$(TARGET_SYS)) | 322 | ifneq (SunOS,$(TARGET_SYS)) |
324 | ifneq (PS3,$(TARGET_SYS)) | 323 | ifneq (PS3,$(TARGET_SYS)) |
@@ -367,10 +366,11 @@ MINILUA_O= host/minilua.o | |||
367 | MINILUA_LIBS= -lm | 366 | MINILUA_LIBS= -lm |
368 | MINILUA_T= host/minilua | 367 | MINILUA_T= host/minilua |
369 | MINILUA_X= $(MINILUA_T) | 368 | MINILUA_X= $(MINILUA_T) |
369 | MINILUA_DEP= | ||
370 | 370 | ||
371 | ifeq (,$(HOST_LUA)) | 371 | ifeq (,$(HOST_LUA)) |
372 | HOST_LUA= $(MINILUA_X) | 372 | HOST_LUA= $(MINILUA_X) |
373 | DASM_DEP= $(MINILUA_T) | 373 | MINILUA_DEP= $(MINILUA_T) |
374 | endif | 374 | endif |
375 | 375 | ||
376 | DASM_DIR= ../dynasm | 376 | DASM_DIR= ../dynasm |
@@ -445,6 +445,10 @@ endif | |||
445 | DASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS) | 445 | DASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS) |
446 | DASM_DASC= vm_$(DASM_ARCH).dasc | 446 | DASM_DASC= vm_$(DASM_ARCH).dasc |
447 | 447 | ||
448 | GIT= git | ||
449 | GIT_RELVER= [ -d ../.git ] && $(GIT) show -s --format=%ct >luajit_relver.txt 2>/dev/null || cat ../.relver >luajit_relver.txt 2>/dev/null || : | ||
450 | GIT_DEP= $(wildcard ../.git/HEAD ../.git/refs/heads/*) | ||
451 | |||
448 | BUILDVM_O= host/buildvm.o host/buildvm_asm.o host/buildvm_peobj.o \ | 452 | BUILDVM_O= host/buildvm.o host/buildvm_asm.o host/buildvm_peobj.o \ |
449 | host/buildvm_lib.o host/buildvm_fold.o | 453 | host/buildvm_lib.o host/buildvm_fold.o |
450 | BUILDVM_T= host/buildvm | 454 | BUILDVM_T= host/buildvm |
@@ -488,8 +492,8 @@ LUAJIT_T= luajit | |||
488 | 492 | ||
489 | ALL_T= $(LUAJIT_T) $(LUAJIT_A) $(LUAJIT_SO) $(HOST_T) | 493 | ALL_T= $(LUAJIT_T) $(LUAJIT_A) $(LUAJIT_SO) $(HOST_T) |
490 | ALL_HDRGEN= lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h \ | 494 | ALL_HDRGEN= lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h \ |
491 | host/buildvm_arch.h | 495 | host/buildvm_arch.h luajit.h |
492 | ALL_GEN= $(LJVM_S) $(ALL_HDRGEN) $(LIB_VMDEFP) | 496 | ALL_GEN= $(LJVM_S) $(ALL_HDRGEN) luajit_relver.txt $(LIB_VMDEFP) |
493 | WIN_RM= *.obj *.lib *.exp *.dll *.exe *.manifest *.pdb *.ilk | 497 | WIN_RM= *.obj *.lib *.exp *.dll *.exe *.manifest *.pdb *.ilk |
494 | ALL_RM= $(ALL_T) $(ALL_GEN) *.o host/*.o $(WIN_RM) | 498 | ALL_RM= $(ALL_T) $(ALL_GEN) *.o host/*.o $(WIN_RM) |
495 | 499 | ||
@@ -610,7 +614,12 @@ $(MINILUA_T): $(MINILUA_O) | |||
610 | $(E) "HOSTLINK $@" | 614 | $(E) "HOSTLINK $@" |
611 | $(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(MINILUA_O) $(MINILUA_LIBS) $(HOST_ALIBS) | 615 | $(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(MINILUA_O) $(MINILUA_LIBS) $(HOST_ALIBS) |
612 | 616 | ||
613 | host/buildvm_arch.h: $(DASM_DASC) $(DASM_DEP) lj_arch.h lua.h luaconf.h | 617 | luajit.h: $(MINILUA_DEP) $(GIT_DEP) luajit_rolling.h |
618 | $(E) "VERSION $@" | ||
619 | $(Q)$(GIT_RELVER) | ||
620 | $(Q)$(HOST_LUA) host/genversion.lua | ||
621 | |||
622 | host/buildvm_arch.h: $(DASM_DASC) $(MINILUA_DEP) lj_arch.h lua.h luaconf.h | ||
614 | $(E) "DYNASM $@" | 623 | $(E) "DYNASM $@" |
615 | $(Q)$(DASM) $(DASM_FLAGS) -o $@ $(DASM_DASC) | 624 | $(Q)$(DASM) $(DASM_FLAGS) -o $@ $(DASM_DASC) |
616 | 625 | ||
diff --git a/src/host/buildvm.c b/src/host/buildvm.c index ef393ff8..39c2bc24 100644 --- a/src/host/buildvm.c +++ b/src/host/buildvm.c | |||
@@ -320,6 +320,7 @@ static void emit_vmdef(BuildCtx *ctx) | |||
320 | char buf[80]; | 320 | char buf[80]; |
321 | int i; | 321 | int i; |
322 | fprintf(ctx->fp, "-- This is a generated file. DO NOT EDIT!\n\n"); | 322 | fprintf(ctx->fp, "-- This is a generated file. DO NOT EDIT!\n\n"); |
323 | fprintf(ctx->fp, "assert(require(\"jit\").version == \"%s\", \"LuaJIT core/library version mismatch\")\n\n", LUAJIT_VERSION); | ||
323 | fprintf(ctx->fp, "module(...)\n\n"); | 324 | fprintf(ctx->fp, "module(...)\n\n"); |
324 | 325 | ||
325 | fprintf(ctx->fp, "bcnames = \""); | 326 | fprintf(ctx->fp, "bcnames = \""); |
diff --git a/src/host/genversion.lua b/src/host/genversion.lua new file mode 100644 index 00000000..a38cec56 --- /dev/null +++ b/src/host/genversion.lua | |||
@@ -0,0 +1,43 @@ | |||
1 | ---------------------------------------------------------------------------- | ||
2 | -- Lua script to embed the rolling release version in luajit.h. | ||
3 | ---------------------------------------------------------------------------- | ||
4 | -- Copyright (C) 2005-2023 Mike Pall. All rights reserved. | ||
5 | -- Released under the MIT license. See Copyright Notice in luajit.h | ||
6 | ---------------------------------------------------------------------------- | ||
7 | |||
8 | local FILE_INPUT_H = "luajit_rolling.h" | ||
9 | local FILE_INPUT_R = "luajit_relver.txt" | ||
10 | local FILE_OUTPUT_H = "luajit.h" | ||
11 | |||
12 | local function file_read(file) | ||
13 | local fp = assert(io.open(file, "rb"), "run from the wrong directory") | ||
14 | local data = assert(fp:read("*a")) | ||
15 | fp:close() | ||
16 | return data | ||
17 | end | ||
18 | |||
19 | local function file_write_mod(file, data) | ||
20 | local fp = io.open(file, "rb") | ||
21 | if fp then | ||
22 | local odata = assert(fp:read("*a")) | ||
23 | fp:close() | ||
24 | if odata == data then return end | ||
25 | end | ||
26 | fp = assert(io.open(file, "wb")) | ||
27 | assert(fp:write(data)) | ||
28 | assert(fp:close()) | ||
29 | end | ||
30 | |||
31 | local text = file_read(FILE_INPUT_H) | ||
32 | local relver = file_read(FILE_INPUT_R):match("(%d+)") | ||
33 | |||
34 | if relver then | ||
35 | text = text:gsub("ROLLING", relver) | ||
36 | else | ||
37 | io.stderr:write([[ | ||
38 | **** WARNING Cannot determine rolling release version from git log. | ||
39 | **** WARNING The 'git' command must be available during the build. | ||
40 | ]]) | ||
41 | end | ||
42 | |||
43 | file_write_mod(FILE_OUTPUT_H, text) | ||
diff --git a/src/jit/bc.lua b/src/jit/bc.lua index b128d35a..4b384012 100644 --- a/src/jit/bc.lua +++ b/src/jit/bc.lua | |||
@@ -41,7 +41,6 @@ | |||
41 | 41 | ||
42 | -- Cache some library functions and objects. | 42 | -- Cache some library functions and objects. |
43 | local jit = require("jit") | 43 | local jit = require("jit") |
44 | assert(jit.version_num == 20005, "LuaJIT core/library version mismatch") | ||
45 | local jutil = require("jit.util") | 44 | local jutil = require("jit.util") |
46 | local vmdef = require("jit.vmdef") | 45 | local vmdef = require("jit.vmdef") |
47 | local bit = require("bit") | 46 | local bit = require("bit") |
diff --git a/src/jit/bcsave.lua b/src/jit/bcsave.lua index fcd80334..55fae993 100644 --- a/src/jit/bcsave.lua +++ b/src/jit/bcsave.lua | |||
@@ -11,7 +11,7 @@ | |||
11 | ------------------------------------------------------------------------------ | 11 | ------------------------------------------------------------------------------ |
12 | 12 | ||
13 | local jit = require("jit") | 13 | local jit = require("jit") |
14 | assert(jit.version_num == 20005, "LuaJIT core/library version mismatch") | 14 | assert(jit.version_num == 20099, "LuaJIT core/library version mismatch") |
15 | local bit = require("bit") | 15 | local bit = require("bit") |
16 | 16 | ||
17 | -- Symbol name prefix for LuaJIT bytecode. | 17 | -- Symbol name prefix for LuaJIT bytecode. |
diff --git a/src/jit/dump.lua b/src/jit/dump.lua index 87950cb2..86f11e26 100644 --- a/src/jit/dump.lua +++ b/src/jit/dump.lua | |||
@@ -55,7 +55,6 @@ | |||
55 | 55 | ||
56 | -- Cache some library functions and objects. | 56 | -- Cache some library functions and objects. |
57 | local jit = require("jit") | 57 | local jit = require("jit") |
58 | assert(jit.version_num == 20005, "LuaJIT core/library version mismatch") | ||
59 | local jutil = require("jit.util") | 58 | local jutil = require("jit.util") |
60 | local vmdef = require("jit.vmdef") | 59 | local vmdef = require("jit.vmdef") |
61 | local funcinfo, funcbc = jutil.funcinfo, jutil.funcbc | 60 | local funcinfo, funcbc = jutil.funcinfo, jutil.funcbc |
diff --git a/src/jit/v.lua b/src/jit/v.lua index 19b6949d..29edcf2b 100644 --- a/src/jit/v.lua +++ b/src/jit/v.lua | |||
@@ -59,7 +59,6 @@ | |||
59 | 59 | ||
60 | -- Cache some library functions and objects. | 60 | -- Cache some library functions and objects. |
61 | local jit = require("jit") | 61 | local jit = require("jit") |
62 | assert(jit.version_num == 20005, "LuaJIT core/library version mismatch") | ||
63 | local jutil = require("jit.util") | 62 | local jutil = require("jit.util") |
64 | local vmdef = require("jit.vmdef") | 63 | local vmdef = require("jit.vmdef") |
65 | local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo | 64 | local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo |
diff --git a/src/lib_jit.c b/src/lib_jit.c index c2f1ee7c..04a564c7 100644 --- a/src/lib_jit.c +++ b/src/lib_jit.c | |||
@@ -648,7 +648,7 @@ LUALIB_API int luaopen_jit(lua_State *L) | |||
648 | { | 648 | { |
649 | lua_pushliteral(L, LJ_OS_NAME); | 649 | lua_pushliteral(L, LJ_OS_NAME); |
650 | lua_pushliteral(L, LJ_ARCH_NAME); | 650 | lua_pushliteral(L, LJ_ARCH_NAME); |
651 | lua_pushinteger(L, LUAJIT_VERSION_NUM); | 651 | lua_pushinteger(L, LUAJIT_VERSION_NUM); /* Deprecated. */ |
652 | lua_pushliteral(L, LUAJIT_VERSION); | 652 | lua_pushliteral(L, LUAJIT_VERSION); |
653 | LJ_LIB_REG(L, LUA_JITLIBNAME, jit); | 653 | LJ_LIB_REG(L, LUA_JITLIBNAME, jit); |
654 | #ifndef LUAJIT_DISABLE_JITUTIL | 654 | #ifndef LUAJIT_DISABLE_JITUTIL |
diff --git a/src/luaconf.h b/src/luaconf.h index c1c9b4d3..8fc3eee5 100644 --- a/src/luaconf.h +++ b/src/luaconf.h | |||
@@ -37,7 +37,7 @@ | |||
37 | #endif | 37 | #endif |
38 | #define LUA_LROOT "/usr/local" | 38 | #define LUA_LROOT "/usr/local" |
39 | #define LUA_LUADIR "/lua/5.1/" | 39 | #define LUA_LUADIR "/lua/5.1/" |
40 | #define LUA_LJDIR "/luajit-2.0.5/" | 40 | #define LUA_LJDIR "/luajit-2.0/" |
41 | 41 | ||
42 | #ifdef LUA_ROOT | 42 | #ifdef LUA_ROOT |
43 | #define LUA_JROOT LUA_ROOT | 43 | #define LUA_JROOT LUA_ROOT |
diff --git a/src/luajit.h b/src/luajit_rolling.h index 8b09f376..27368836 100644 --- a/src/luajit.h +++ b/src/luajit_rolling.h | |||
@@ -30,9 +30,9 @@ | |||
30 | 30 | ||
31 | #include "lua.h" | 31 | #include "lua.h" |
32 | 32 | ||
33 | #define LUAJIT_VERSION "LuaJIT 2.0.5" | 33 | #define LUAJIT_VERSION "LuaJIT 2.0.ROLLING" |
34 | #define LUAJIT_VERSION_NUM 20005 /* Version 2.0.5 = 02.00.05. */ | 34 | #define LUAJIT_VERSION_NUM 20099 /* Deprecated. */ |
35 | #define LUAJIT_VERSION_SYM luaJIT_version_2_0_5 | 35 | #define LUAJIT_VERSION_SYM luaJIT_version_2_0_ROLLING |
36 | #define LUAJIT_COPYRIGHT "Copyright (C) 2005-2023 Mike Pall" | 36 | #define LUAJIT_COPYRIGHT "Copyright (C) 2005-2023 Mike Pall" |
37 | #define LUAJIT_URL "https://luajit.org/" | 37 | #define LUAJIT_URL "https://luajit.org/" |
38 | 38 | ||