diff --git a/src/Makefile b/src/Makefile index de8bc91ca..9f0643232 100644 --- a/src/Makefile +++ b/src/Makefile @@ -64,6 +64,10 @@ # DEBUGMODE=1 - Enable various debugging capabilities. # Also disables optimizations. # +# Potentially Unsafe +# ------------------ +# HAVE_BLUAJIT=1 - Enable compiling with BluaJIT instead of blua, can have potential bugs +# # Development flags: # # VALGRIND=1 - Enable Valgrind memory debugging support. @@ -184,7 +188,7 @@ sources+=\ $(call List,Sourcefile)\ $(call List,core/Sourcefile) -ifdef NOBLUAJIT +ifndef HAVE_BLUAJIT lualib:= sources+=\ $(call List,blua/Sourcefile) @@ -367,7 +371,7 @@ $(dbg) : $(objects) $(lualib) | $$(@D)/ $(call Echo,Linking $(@F)...) $(.)$(LD) -o $@ $^ $(libs) -ifndef NOBLUAJIT +ifdef HAVE_BLUAJIT $(lualib) :: @$(MAKE) -C ../libs/bluajit $(MAKECMDGOALS) CCOPT="$(opts)" endif @@ -434,7 +438,7 @@ clean : distclean : $(call _rm,../bin ../objs ../dep ../make comptime.h) -ifndef NOBLUAJIT +ifdef HAVE_BLUAJIT $(call _rm,$(objdir)/buildvm* $(objdir)/minilua* $(objdir)/lj_vm*) cleanjit: diff --git a/src/Makefile.d/features.mk b/src/Makefile.d/features.mk index b5ef8b53c..ab37c6a6c 100644 --- a/src/Makefile.d/features.mk +++ b/src/Makefile.d/features.mk @@ -7,7 +7,7 @@ passthru_opts+=\ MOBJCONSISTANCY PACKETDROP ZDEBUG\ HAVE_MINIUPNPC\ HAVE_DISCORDRPC DEVELOP\ - NOBLUAJIT + HAVE_BLUAJIT # build with debugging information ifdef DEBUGMODE diff --git a/src/Makefile.d/nix.mk b/src/Makefile.d/nix.mk index f545eaf8a..5fc0873d9 100644 --- a/src/Makefile.d/nix.mk +++ b/src/Makefile.d/nix.mk @@ -26,7 +26,7 @@ ifeq (${DEDICATED},1) EXENAME?=lsrb2kartd endif -ifndef NOBLUAJIT +ifdef HAVE_BLUAJIT libs+=-L../libs/bluajit/src/ -l:libbluajit.a opts+=-I../libs/bluajit/src/ endif diff --git a/src/d_netcmd.c b/src/d_netcmd.c index ad1cec57c..fe056369a 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -778,7 +778,7 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_maxdemosize); CV_RegisterVar(&cv_demochangemap); -#ifndef NOBLUAJIT +#ifdef HAVE_BLUAJIT CV_RegisterVar(&cv_luajit); #endif } diff --git a/src/lua_hudlib_drawlist.c b/src/lua_hudlib_drawlist.c index a9c9d93b7..31cf6d237 100644 --- a/src/lua_hudlib_drawlist.c +++ b/src/lua_hudlib_drawlist.c @@ -12,7 +12,7 @@ #include "lua_hudlib_drawlist.h" #include "lua_hud.h" -#ifdef NOBLUAJIT +#ifndef HAVE_BLUAJIT #include "blua/lstate.h" // shhhhhh #else #include "lua_script.h" @@ -332,7 +332,7 @@ static UINT64 GetItemId(void) if (!hud_interpolate) return 0; -#ifdef NOBLUAJIT +#ifndef HAVE_BLUAJIT UINT64 id = (uintptr_t)gL->savedpc; #else // he who controls the JIT controls the API diff --git a/src/lua_libs.h b/src/lua_libs.h index 36f776674..b43772a59 100644 --- a/src/lua_libs.h +++ b/src/lua_libs.h @@ -12,7 +12,7 @@ #include "doomtype.h" -#ifdef NOBLUAJIT +#ifndef HAVE_BLUAJIT #include "blua/lua.h" #else #include diff --git a/src/lua_script.c b/src/lua_script.c index 3cc2ee113..2131b18c2 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -35,7 +35,7 @@ #include "doomstat.h" -#ifndef NOBLUAJIT +#ifdef HAVE_BLUAJIT #include "d_main.h" #include "i_system.h" static void LuaJit_OnChange(void); @@ -69,7 +69,7 @@ static lua_CFunction liblist[] = { NULL }; -#ifndef NOBLUAJIT +#ifdef HAVE_BLUAJIT static void LuaJit_OnChange(void) { if (!gL) @@ -208,7 +208,7 @@ static int noglobals(lua_State *L) return luaL_error(L, "Implicit global " LUA_QS " prevented. Create a local variable instead.", csname); } -#ifndef NOBLUAJIT +#ifdef HAVE_BLUAJIT // print all the ISA extensions because it looks cool! // absolutely not stolen from luajit.c static void print_jit_status(boolean verbose) @@ -274,7 +274,7 @@ void LUA_ClearState(void) // lua state is ready! gL = L; -#ifndef NOBLUAJIT +#ifdef HAVE_BLUAJIT print_jit_status(true); #endif } diff --git a/src/lua_script.h b/src/lua_script.h index f32294f4a..c0eaa192a 100644 --- a/src/lua_script.h +++ b/src/lua_script.h @@ -18,7 +18,7 @@ #include "d_player.h" #include "p_saveg.h" -#ifdef NOBLUAJIT +#ifndef HAVE_BLUAJIT #include "blua/lua.h" #include "blua/lualib.h" #include "blua/lauxlib.h"