From 49de6d79b3c28ab188fae6b94f49245da279df41 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Tue, 31 Dec 2013 11:52:01 +0000 Subject: [PATCH] Lunatic/m32: include the Lua bytecode into the binary, exit if setup failed. git-svn-id: https://svn.eduke32.com/eduke32@4237 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile | 27 ++++++++++++------- polymer/eduke32/source/astub.c | 3 ++- polymer/eduke32/source/lunatic/dynsymlist_m32 | 8 ++++++ 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 62fde7b43..17728a493 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -144,10 +144,26 @@ MISCEDITORDEPS= ## Lunatic devel ifneq (0,$(LUNATIC)) - LUNATIC_COMMON_OBJS = $(OBJ)/luaJIT_BC_defs_common.$o $(OBJ)/luaJIT_BC_engine_maptext.$o $(OBJ)/luaJIT_BC_engine.$o + LUNATIC_COMMON_OBJS = \ + $(OBJ)/luaJIT_BC_defs_common.$o \ + $(OBJ)/luaJIT_BC_engine_maptext.$o \ + $(OBJ)/luaJIT_BC_engine.$o \ + $(OBJ)/luaJIT_BC_bcarray.$o \ + $(OBJ)/luaJIT_BC_bcheck.$o \ + $(OBJ)/luaJIT_BC_bitar.$o \ + $(OBJ)/luaJIT_BC_xmath.$o \ + $(OBJ)/luaJIT_BC_v.$o \ + $(OBJ)/luaJIT_BC_dump.$o \ + $(OBJ)/luaJIT_BC_dis_x86.$o \ + $(OBJ)/luaJIT_BC_dis_x64.$o \ + + # TODO: remove debugging modules from release build + EDITOROBJS+= $(OBJ)/lunatic_m32.$o $(LUNATIC_COMMON_OBJS) GAMEOBJS+= $(OBJ)/lunatic_game.$o $(LUNATIC_COMMON_OBJS) + EDITOROBJS+= $(OBJ)/luaJIT_BC_defs_m32.$o + ifneq ($(PLATFORM),WINDOWS) # On non-Windows, we expect to have liblpeg.a (or a symlink to it) in source/. # On Windows, it will reside in platform/Windows/lib32 or lib64. @@ -162,19 +178,10 @@ ifneq (0,$(LUNATIC)) $(OBJ)/luaJIT_BC_lunacon.$o \ $(OBJ)/luaJIT_BC_randgen.$o \ $(OBJ)/luaJIT_BC_stat.$o \ - $(OBJ)/luaJIT_BC_bitar.$o \ $(OBJ)/luaJIT_BC_control.$o \ - $(OBJ)/luaJIT_BC_bcarray.$o \ - $(OBJ)/luaJIT_BC_bcheck.$o \ - $(OBJ)/luaJIT_BC_xmath.$o \ $(OBJ)/luaJIT_BC_defs.$o \ - $(OBJ)/luaJIT_BC_v.$o \ - $(OBJ)/luaJIT_BC_dump.$o \ - $(OBJ)/luaJIT_BC_dis_x86.$o \ - $(OBJ)/luaJIT_BC_dis_x64.$o \ $(OBJ)/luaJIT_BC_savegame.$o \ $(OBJ)/luaJIT_BC_fs.$o \ - # TODO: remove debugging modules from release build # now, take care of having the necessary symbols (sector, wall, etc.) in the # executable no matter what the debugging level diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index b3a128419..10c45387e 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -10510,8 +10510,9 @@ int32_t ExtInit(void) i = L_RunOnce(&g_EmState, "defs_m32.ilua"); if (i != 0) { - initprintf("Lunatic: Error preparing global Lua state (code %d)\n", i); Em_DestroyState(&g_EmState); + initprintf("Lunatic: Error preparing global Lua state (code %d)\n", i); + return -1; } } #endif diff --git a/polymer/eduke32/source/lunatic/dynsymlist_m32 b/polymer/eduke32/source/lunatic/dynsymlist_m32 index 98a65d98d..1a16f8235 100644 --- a/polymer/eduke32/source/lunatic/dynsymlist_m32 +++ b/polymer/eduke32/source/lunatic/dynsymlist_m32 @@ -93,6 +93,14 @@ crc32once; luaJIT_BC_defs_common; luaJIT_BC_engine_maptext; luaJIT_BC_engine; +luaJIT_BC_bcarray; +luaJIT_BC_bcheck; +luaJIT_BC_bitar; +luaJIT_BC_xmath; +luaJIT_BC_v; +luaJIT_BC_dump; +luaJIT_BC_dis_x86; +luaJIT_BC_dis_x64; g_argv;