Commit 72b25e0c authored by NY00123's avatar NY00123 Committed by Richard Gobeille

Remove LuaJIT/LUNATIC definitions from GNUmakefile and Common.mak

parent 5f1e4f57
......@@ -208,9 +208,6 @@ STRIP := $(CROSS)strip$(CROSS_SUFFIX)
AS := nasm
# LuaJIT standalone interpreter executable:
LUAJIT := luajit$(HOSTEXESUFFIX)
PKG_CONFIG := pkg-config
ELF2DOL := elf2dol
......@@ -344,8 +341,6 @@ STARTUP_WINDOW ?= 1
RETAIL_MENU ?= 0
POLYMER ?= 1
USE_OPENGL := 1
LUNATIC := 0
USE_LUAJIT_2_1 := 0
# Library toggles
HAVE_GTK2 := 1
......@@ -453,11 +448,6 @@ ifneq (0,$(CLANG))
LTO := 0
endif
endif
ifneq ($(LUNATIC),0)
# FIXME: Lunatic builds with LTO don't start up properly as the required
# symbol names are apparently not exported.
override LTO := 0
endif
ifeq (0,$(CLANG))
ifeq (0,$(GCC_PREREQ_4))
override LTO := 0
......@@ -495,8 +485,6 @@ CXXONLYFLAGS := $(CXXSTD) -fno-exceptions -fno-rtti
ASFLAGS := -s #-g
LUAJIT_BCOPTS :=
LINKERFLAGS :=
L_CXXONLYFLAGS :=
......@@ -508,8 +496,6 @@ LIBDIRS :=
##### Mandatory platform parameters
ASFORMAT := elf$(BITS)
# Options to "luajit -b" for synthesis. Since it runs on Linux, we need to tell
# the native LuaJIT to emit PE object files.
ifeq ($(PLATFORM),WINDOWS)
LINKERFLAGS += -static-libgcc -static
ifeq (0,$(CLANG))
......@@ -536,14 +522,6 @@ ifeq ($(PLATFORM),WINDOWS)
ifneq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
LINKERFLAGS += -Wl,--large-address-aware
endif
LUAJIT_BCOPTS := -o windows
ifeq (32,$(BITS))
LUAJIT_BCOPTS += -a x86
endif
ifeq (64,$(BITS))
LUAJIT_BCOPTS += -a x64
endif
else ifeq ($(PLATFORM),DARWIN)
ifneq ($(ARCH),)
ifneq ($(findstring -arch,$(ARCH)),-arch)
......@@ -897,18 +875,6 @@ endif
##### External libraries
ifneq ($(LUNATIC),0)
ifneq ($(USE_LUAJIT_2_1),0)
COMPILERFLAGS += -DUSE_LUAJIT_2_1
endif
ifeq ($(PLATFORM),WINDOWS)
LIBS += -lluajit
else
LIBS += -lluajit-5.1
endif
endif
ifneq (0,$(USE_LIBVPX))
COMPILERFLAGS += -DUSE_LIBVPX
LIBS += -lvpx
......
......@@ -299,9 +299,6 @@ ifeq (1,$(USE_OPENGL))
engine_objs += glbuild.cpp polymer.cpp
endif
endif
ifneq (0,$(LUNATIC))
engine_objs += lunatic.cpp
endif
ifeq ($(PLATFORM),DARWIN)
engine_objs += osxbits.mm
engine_tools_objs += osxbits.mm
......@@ -538,11 +535,6 @@ common_editor_deps := duke3d_common_editor engine_editor
duke3d_game_deps := audiolib mact
duke3d_editor_deps := audiolib
ifneq (0,$(LUNATIC))
duke3d_game_deps += lunatic lunatic_game lpeg
duke3d_editor_deps += lunatic lunatic_editor lpeg
endif
duke3d_game := eduke32
duke3d_editor := mapster32
......@@ -607,83 +599,6 @@ duke3d_editor_miscdeps :=
duke3d_game_orderonlydeps :=
duke3d_editor_orderonlydeps :=
## Lunatic devel
lunatic := lunatic
lunatic_src := $(duke3d_src)/$(lunatic)
lunatic_obj := $(duke3d_obj)
ifneq (0,$(LUNATIC))
COMPILERFLAGS += -I$(lunatic_src) -DLUNATIC
# Determine size of _defs*.lua bytecode once.
ifndef DEFS_BC_SIZE
DEFS_BC_SIZE := $(shell $(LUAJIT) -bg -t h $(lunatic_src)/_defs_game.lua -)
DEFS_BC_SIZE := $(word 3, $(DEFS_BC_SIZE))
endif
ifndef DEFS_M32_BC_SIZE
DEFS_M32_BC_SIZE := $(shell $(LUAJIT) -bg -t h $(lunatic_src)/_defs_editor.lua -)
DEFS_M32_BC_SIZE := $(word 3, $(DEFS_M32_BC_SIZE))
endif
duke3d_cflags += -DLUNATIC_DEFS_BC_SIZE=$(DEFS_BC_SIZE) -DLUNATIC_DEFS_M32_BC_SIZE=$(DEFS_M32_BC_SIZE)
# Lunatic object base names. These are not used in targets directly.
lunatic_objs := \
defs_common.lua \
engine_maptext.lua \
engine.lua \
bcarray.lua \
bcheck.lua \
bitar.lua \
xmath.lua \
v.lua \
dump.lua \
dis_x86.lua \
dis_x64.lua \
lunatic_game_objs := \
lunatic_game.cpp \
_defs_game.lua \
con_lang.lua \
lunacon.lua \
randgen.lua \
stat.lua \
control.lua \
lunasave.lua \
fs.lua \
lunatic_editor_objs := \
lunatic_editor.cpp \
_defs_editor.lua \
# 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
ifeq ($(PLATFORM),DARWIN)
# strip on OSX says: removing global symbols from a final linked no longer supported.
# Use -exported_symbols_list at link time when building
# But, following _their_ directions does not give us the symbols! wtf?
# Instead of using -alias_list and -exported_symbols_list, prevent stripping them.
duke3d_game_stripflags += -s $(duke3d_obj)/lunatic_dynsymlist_game_osx
duke3d_editor_stripflags += -s $(duke3d_obj)/lunatic_dynsymlist_editor_osx
duke3d_game_orderonlydeps += $(duke3d_obj)/lunatic_dynsymlist_game_osx
duke3d_editor_orderonlydeps += $(duke3d_obj)/lunatic_dynsymlist_editor_osx
LINKERFLAGS += -pagezero_size 10000 -image_base 100000000
endif
ifeq ($(PLATFORM),WINDOWS)
override STRIP :=
duke3d_game_miscdeps += $(duke3d_obj)/lunatic_dynsymlist_game.def
duke3d_editor_miscdeps += $(duke3d_obj)/lunatic_dynsymlist_editor.def
endif
ifeq ($(SUBPLATFORM),LINUX)
override STRIP :=
duke3d_game_ldflags += -Wl,--dynamic-list=$(lunatic_src)/dynsymlist_game.lds
duke3d_editor_ldflags += -Wl,--dynamic-list=$(lunatic_src)/dynsymlist_editor.lds
endif
endif
ifeq ($(SUBPLATFORM),LINUX)
LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lasound
endif
......@@ -1001,27 +916,6 @@ $(voidwrap_lib): $(foreach i,$(voidwrap),$(call expandobjs,$i))
$(RECIPE_IF) $(LINKER) -shared -Wl,-soname,$@ -o $@ $^ $(LIBDIRS) $(voidwrap_root)/sdk/redistributable_bin/$(steamworks_lib) $(RECIPE_RESULT_LINK)
### Lunatic
# Create object files directly with luajit
$(duke3d_obj)/%.$o: $(lunatic_src)/%.lua | $(duke3d_obj)
$(COMPILE_STATUS)
$(RECIPE_IF) $(LUAJIT) -bg $(LUAJIT_BCOPTS) $< $@ $(RECIPE_RESULT_COMPILE)
$(duke3d_obj)/%.$o: $(lunatic_src)/%.cpp | $(duke3d_obj)
$(COMPILE_STATUS)
$(RECIPE_IF) $(COMPILER_CXX) $(duke3d_cflags) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
# List of exported symbols, OS X
$(duke3d_obj)/lunatic_%_osx: $(lunatic_src)/%.lds | $(duke3d_obj)
sed 's/[{};]//g;s/[A-Za-z_][A-Za-z_0-9]*/_&/g' $< > $@
# List of exported symbols, Windows
$(duke3d_obj)/lunatic_%.def: $(lunatic_src)/%.lds | $(duke3d_obj)
echo EXPORTS > $@
sed 's/[{};]//g' $< >> $@
### Main Rules
define OBJECTRULES
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment