Switch build system to rolling releases.
This commit is contained in:
2
src/.gitignore
vendored
2
src/.gitignore
vendored
@@ -1,4 +1,6 @@
|
||||
luajit
|
||||
luajit.h
|
||||
luajit_relver.txt
|
||||
lj_bcdef.h
|
||||
lj_ffdef.h
|
||||
lj_libdef.h
|
||||
|
||||
23
src/Makefile
23
src/Makefile
@@ -12,7 +12,6 @@
|
||||
|
||||
MAJVER= 2
|
||||
MINVER= 0
|
||||
RELVER= 5
|
||||
ABIVER= 5.1
|
||||
NODOTABIVER= 51
|
||||
|
||||
@@ -308,7 +307,7 @@ ifeq (Darwin,$(TARGET_SYS))
|
||||
TARGET_STRIP+= -x
|
||||
TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC
|
||||
TARGET_DYNXLDOPTS=
|
||||
TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER)
|
||||
TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).255
|
||||
ifeq (x64,$(TARGET_LJARCH))
|
||||
TARGET_XLDFLAGS+= -pagezero_size 10000 -image_base 100000000
|
||||
TARGET_XSHLDFLAGS+= -image_base 7fff04c4a000
|
||||
@@ -318,7 +317,7 @@ ifeq (iOS,$(TARGET_SYS))
|
||||
TARGET_STRIP+= -x
|
||||
TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC
|
||||
TARGET_DYNXLDOPTS=
|
||||
TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER)
|
||||
TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).255
|
||||
else
|
||||
ifneq (SunOS,$(TARGET_SYS))
|
||||
ifneq (PS3,$(TARGET_SYS))
|
||||
@@ -367,10 +366,11 @@ MINILUA_O= host/minilua.o
|
||||
MINILUA_LIBS= -lm
|
||||
MINILUA_T= host/minilua
|
||||
MINILUA_X= $(MINILUA_T)
|
||||
MINILUA_DEP=
|
||||
|
||||
ifeq (,$(HOST_LUA))
|
||||
HOST_LUA= $(MINILUA_X)
|
||||
DASM_DEP= $(MINILUA_T)
|
||||
MINILUA_DEP= $(MINILUA_T)
|
||||
endif
|
||||
|
||||
DASM_DIR= ../dynasm
|
||||
@@ -445,6 +445,10 @@ endif
|
||||
DASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS)
|
||||
DASM_DASC= vm_$(DASM_ARCH).dasc
|
||||
|
||||
GIT= git
|
||||
GIT_RELVER= [ -d ../.git ] && $(GIT) show -s --format=%ct >luajit_relver.txt 2>/dev/null || cat ../.relver >luajit_relver.txt 2>/dev/null || :
|
||||
GIT_DEP= $(wildcard ../.git/HEAD ../.git/refs/heads/*)
|
||||
|
||||
BUILDVM_O= host/buildvm.o host/buildvm_asm.o host/buildvm_peobj.o \
|
||||
host/buildvm_lib.o host/buildvm_fold.o
|
||||
BUILDVM_T= host/buildvm
|
||||
@@ -488,8 +492,8 @@ LUAJIT_T= luajit
|
||||
|
||||
ALL_T= $(LUAJIT_T) $(LUAJIT_A) $(LUAJIT_SO) $(HOST_T)
|
||||
ALL_HDRGEN= lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h \
|
||||
host/buildvm_arch.h
|
||||
ALL_GEN= $(LJVM_S) $(ALL_HDRGEN) $(LIB_VMDEFP)
|
||||
host/buildvm_arch.h luajit.h
|
||||
ALL_GEN= $(LJVM_S) $(ALL_HDRGEN) luajit_relver.txt $(LIB_VMDEFP)
|
||||
WIN_RM= *.obj *.lib *.exp *.dll *.exe *.manifest *.pdb *.ilk
|
||||
ALL_RM= $(ALL_T) $(ALL_GEN) *.o host/*.o $(WIN_RM)
|
||||
|
||||
@@ -610,7 +614,12 @@ $(MINILUA_T): $(MINILUA_O)
|
||||
$(E) "HOSTLINK $@"
|
||||
$(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(MINILUA_O) $(MINILUA_LIBS) $(HOST_ALIBS)
|
||||
|
||||
host/buildvm_arch.h: $(DASM_DASC) $(DASM_DEP) lj_arch.h lua.h luaconf.h
|
||||
luajit.h: $(MINILUA_DEP) $(GIT_DEP) luajit_rolling.h
|
||||
$(E) "VERSION $@"
|
||||
$(Q)$(GIT_RELVER)
|
||||
$(Q)$(HOST_LUA) host/genversion.lua
|
||||
|
||||
host/buildvm_arch.h: $(DASM_DASC) $(MINILUA_DEP) lj_arch.h lua.h luaconf.h
|
||||
$(E) "DYNASM $@"
|
||||
$(Q)$(DASM) $(DASM_FLAGS) -o $@ $(DASM_DASC)
|
||||
|
||||
|
||||
@@ -320,6 +320,7 @@ static void emit_vmdef(BuildCtx *ctx)
|
||||
char buf[80];
|
||||
int i;
|
||||
fprintf(ctx->fp, "-- This is a generated file. DO NOT EDIT!\n\n");
|
||||
fprintf(ctx->fp, "assert(require(\"jit\").version == \"%s\", \"LuaJIT core/library version mismatch\")\n\n", LUAJIT_VERSION);
|
||||
fprintf(ctx->fp, "module(...)\n\n");
|
||||
|
||||
fprintf(ctx->fp, "bcnames = \"");
|
||||
|
||||
43
src/host/genversion.lua
Normal file
43
src/host/genversion.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
----------------------------------------------------------------------------
|
||||
-- Lua script to embed the rolling release version in luajit.h.
|
||||
----------------------------------------------------------------------------
|
||||
-- Copyright (C) 2005-2023 Mike Pall. All rights reserved.
|
||||
-- Released under the MIT license. See Copyright Notice in luajit.h
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
local FILE_INPUT_H = "luajit_rolling.h"
|
||||
local FILE_INPUT_R = "luajit_relver.txt"
|
||||
local FILE_OUTPUT_H = "luajit.h"
|
||||
|
||||
local function file_read(file)
|
||||
local fp = assert(io.open(file, "rb"), "run from the wrong directory")
|
||||
local data = assert(fp:read("*a"))
|
||||
fp:close()
|
||||
return data
|
||||
end
|
||||
|
||||
local function file_write_mod(file, data)
|
||||
local fp = io.open(file, "rb")
|
||||
if fp then
|
||||
local odata = assert(fp:read("*a"))
|
||||
fp:close()
|
||||
if odata == data then return end
|
||||
end
|
||||
fp = assert(io.open(file, "wb"))
|
||||
assert(fp:write(data))
|
||||
assert(fp:close())
|
||||
end
|
||||
|
||||
local text = file_read(FILE_INPUT_H)
|
||||
local relver = file_read(FILE_INPUT_R):match("(%d+)")
|
||||
|
||||
if relver then
|
||||
text = text:gsub("ROLLING", relver)
|
||||
else
|
||||
io.stderr:write([[
|
||||
**** WARNING Cannot determine rolling release version from git log.
|
||||
**** WARNING The 'git' command must be available during the build.
|
||||
]])
|
||||
end
|
||||
|
||||
file_write_mod(FILE_OUTPUT_H, text)
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
-- Cache some library functions and objects.
|
||||
local jit = require("jit")
|
||||
assert(jit.version_num == 20005, "LuaJIT core/library version mismatch")
|
||||
local jutil = require("jit.util")
|
||||
local vmdef = require("jit.vmdef")
|
||||
local bit = require("bit")
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
local jit = require("jit")
|
||||
assert(jit.version_num == 20005, "LuaJIT core/library version mismatch")
|
||||
assert(jit.version_num == 20099, "LuaJIT core/library version mismatch")
|
||||
local bit = require("bit")
|
||||
|
||||
-- Symbol name prefix for LuaJIT bytecode.
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
|
||||
-- Cache some library functions and objects.
|
||||
local jit = require("jit")
|
||||
assert(jit.version_num == 20005, "LuaJIT core/library version mismatch")
|
||||
local jutil = require("jit.util")
|
||||
local vmdef = require("jit.vmdef")
|
||||
local funcinfo, funcbc = jutil.funcinfo, jutil.funcbc
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
|
||||
-- Cache some library functions and objects.
|
||||
local jit = require("jit")
|
||||
assert(jit.version_num == 20005, "LuaJIT core/library version mismatch")
|
||||
local jutil = require("jit.util")
|
||||
local vmdef = require("jit.vmdef")
|
||||
local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo
|
||||
|
||||
@@ -648,7 +648,7 @@ LUALIB_API int luaopen_jit(lua_State *L)
|
||||
{
|
||||
lua_pushliteral(L, LJ_OS_NAME);
|
||||
lua_pushliteral(L, LJ_ARCH_NAME);
|
||||
lua_pushinteger(L, LUAJIT_VERSION_NUM);
|
||||
lua_pushinteger(L, LUAJIT_VERSION_NUM); /* Deprecated. */
|
||||
lua_pushliteral(L, LUAJIT_VERSION);
|
||||
LJ_LIB_REG(L, LUA_JITLIBNAME, jit);
|
||||
#ifndef LUAJIT_DISABLE_JITUTIL
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#endif
|
||||
#define LUA_LROOT "/usr/local"
|
||||
#define LUA_LUADIR "/lua/5.1/"
|
||||
#define LUA_LJDIR "/luajit-2.0.5/"
|
||||
#define LUA_LJDIR "/luajit-2.0/"
|
||||
|
||||
#ifdef LUA_ROOT
|
||||
#define LUA_JROOT LUA_ROOT
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
|
||||
#include "lua.h"
|
||||
|
||||
#define LUAJIT_VERSION "LuaJIT 2.0.5"
|
||||
#define LUAJIT_VERSION_NUM 20005 /* Version 2.0.5 = 02.00.05. */
|
||||
#define LUAJIT_VERSION_SYM luaJIT_version_2_0_5
|
||||
#define LUAJIT_VERSION "LuaJIT 2.0.ROLLING"
|
||||
#define LUAJIT_VERSION_NUM 20099 /* Deprecated. */
|
||||
#define LUAJIT_VERSION_SYM luaJIT_version_2_0_ROLLING
|
||||
#define LUAJIT_COPYRIGHT "Copyright (C) 2005-2023 Mike Pall"
|
||||
#define LUAJIT_URL "https://luajit.org/"
|
||||
|
||||
Reference in New Issue
Block a user