Browse Source

Merge pull request #31 from elementc/dev/linux-x64

Support 64-bit linux builds
Peter Robinson 4 years ago
parent
commit
4ed8811e47

+ 7 - 2
.gitignore

@@ -26,8 +26,11 @@ Torque2D.exe
 Torque2D_DEBUG.exe
 Torque2DGame.app
 Torque2DGame_Debug.app
+Torque2D
+Torque2D_DEBUG
 linkmap.txt
 **/.vs/**
+.vscode/
 
 # Compiled source #
 ###################
@@ -80,5 +83,7 @@ engine/compilers/android-studio/app/.externalNativeBuild/
 
 # Linux build files #
 #####################
-engine/compilers/Make/Debug/
-engine/compilers/Make/Release/
+engine/compilers/Make-32bit/Debug/
+engine/compilers/Make-32bit/Release/
+engine/compilers/Make-64bit/Debug/
+engine/compilers/Make-64bit/Release/

+ 0 - 0
engine/compilers/Make/Dockerfile → engine/compilers/Make-32bit/Dockerfile


+ 2 - 1
engine/compilers/Make/Makefile → engine/compilers/Make-32bit/Makefile

@@ -9,8 +9,9 @@ APP_TARGETS_DEBUG :=
 build-in-docker: docker-buildenv
 	docker run  \
 		--rm \
+		--user $(shell id -u):$(shell id -g) \
 		-v $(shell readlink -e ../../../ ):/torque2d-engine-build/ \
-		-w /torque2d-engine-build/engine/compilers/Make/ \
+		-w /torque2d-engine-build/engine/compilers/Make-32bit/ \
 		torque2d-linux32-build-env \
 			make -j all
 

+ 0 - 0
engine/compilers/Make/Torque2D → engine/compilers/Make-32bit/Torque2D


+ 0 - 0
engine/compilers/Make/ljpeg → engine/compilers/Make-32bit/ljpeg


+ 0 - 0
engine/compilers/Make/lpng → engine/compilers/Make-32bit/lpng


+ 0 - 0
engine/compilers/Make/ogg → engine/compilers/Make-32bit/ogg


+ 0 - 0
engine/compilers/Make/vorbis → engine/compilers/Make-32bit/vorbis


+ 0 - 0
engine/compilers/Make/zlib → engine/compilers/Make-32bit/zlib


+ 13 - 0
engine/compilers/Make-64bit/Dockerfile

@@ -0,0 +1,13 @@
+FROM ubuntu:20.04
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt-get update && \
+    apt-get -y install \
+        build-essential \
+        gcc-multilib \
+        g++-multilib \
+        nasm \
+        libsdl-dev \
+        libxft-dev \
+        libopenal-dev && \
+    rm -rf /var/lib/{apt,dpkg,cache,log}/
+RUN mkdir /torque2d-engine-build/

+ 45 - 0
engine/compilers/Make-64bit/Makefile

@@ -0,0 +1,45 @@
+DEPS :=
+LIB_TARGETS :=
+LIB_TARGETS_DEBUG :=
+SHARED_LIB_TARGETS :=
+SHARED_LIB_TARGETS_DEBUG :=
+APP_TARGETS :=
+APP_TARGETS_DEBUG :=
+
+build-in-docker: docker-buildenv
+	docker run  \
+		--rm \
+		--user $(shell id -u):$(shell id -g) \
+		-v $(shell readlink -e ../../../ ):/torque2d-engine-build/ \
+		-w /torque2d-engine-build/engine/compilers/Make-64bit/ \
+		torque2d-linux64-build-env \
+			make -j all
+
+all: debug release
+
+docker-buildenv: Dockerfile
+	docker build -t torque2d-linux64-build-env .
+
+clean:
+	rm -rf Debug
+	rm -rf Release
+	rm -rf lib
+
+.PHONY: all debug release clean
+
+-include x Torque2D
+-include x zlib
+-include x lpng
+-include x ljpeg
+-include x vorbis
+-include x ogg
+
+release: $(LIB_TARGETS) $(SHARED_LIB_TARGETS) $(APP_TARGETS)
+	@echo Built libraries: $(LIB_TARGETS)
+	@echo Built shared libraries: $(SHARED_LIB_TARGETS)
+	@echo Built apps: $(APP_TARGETS)
+
+debug: $(LIB_TARGETS_DEBUG) $(SHARED_LIB_TARGETS_DEBUG) $(APP_TARGETS_DEBUG)
+	@echo Built libraries: $(LIB_TARGETS_DEBUG)
+	@echo Built shared libraries: $(SHARED_LIB_TARGETS_DEBUG)
+	@echo Built apps: $(APP_TARGETS_DEBUG)

+ 143 - 0
engine/compilers/Make-64bit/Torque2D

@@ -0,0 +1,143 @@
+APPNAME := ../../../Torque2D
+
+2D_SOURCES :=            $(shell find ../../source/2d/ -name "*.cc") + \
+						 $(shell find ../../source/2d/ -name "*.cpp")
+ALGORITHM_SOURCES :=     $(shell find ../../source/algorithm/ -name "*.cc")
+ASSETS_SOURCES :=        $(shell find ../../source/assets/ -name "*.cc")
+AUDIO_SOURCES :=         $(shell find ../../source/audio/ -name "*.cc")
+BITMAPFONT_SOURCES :=    $(shell find ../../source/bitmapFont/ -name "*.cc")
+BOX2D_SOURCES :=         $(shell find ../../source/Box2D/ -name "*.cpp")
+COLLECTION_SOURCES :=    $(shell find ../../source/collection/ -name "*.cc")
+COMPONENT_SOURCES :=     $(shell find ../../source/component/ -name "*.cpp")
+CONSOLE_SOURCES :=       $(shell find ../../source/console/ -name "*.cc")
+DEBUG_SOURCES :=         $(shell find ../../source/debug/ -name "*.cc")
+DELEGATES_SOURCES :=     $(shell find ../../source/delegates/ -name "*.cc")
+GAME_SOURCES :=          $(shell find ../../source/game/ -name "*.cc")
+GRAPHICS_SOURCES :=      $(shell find ../../source/graphics/ -name "*.cc")
+GUI_SOURCES :=           $(shell find ../../source/gui/ -name "*.cc")
+INPUT_SOURCES :=         $(shell find ../../source/input/ -name "*.cc")
+IO_SOURCES :=            $(shell find ../../source/io/ -name "*.cc") 
+MATH_SOURCES :=          $(shell find ../../source/math/ -name "*.cc") + \
+                         $(shell find ../../source/math/ -name "*.cpp") 
+MEMORY_SOURCES :=        $(shell find ../../source/memory/ -name "*.cc")
+MESSAGING_SOURCES :=     $(shell find ../../source/messaging/ -name "*.cc")
+MODULE_SOURCES :=        $(shell find ../../source/module/ -name "*.cc")
+NETWORK_SOURCES :=       $(shell find ../../source/network/ -name "*.cc")
+PERSISTENCE_SOURCES :=   $(shell find ../../source/persistence/ -name "*.cc") + \
+                         $(shell find ../../source/persistence/ -name "*.cpp")
+PLATFORM_SOURCES :=      $(shell find ../../source/platform/ -name "*.cc") + \
+                         $(shell find ../../source/platform/ -name "*.cpp")
+PLATFORM_UNIX_SOURCES := $(shell find ../../source/platformX86UNIX/ -name "*.cc")
+SIM_SOURCES :=           $(shell find ../../source/sim/ -name "*.cc") + \
+                         $(shell find ../../source/sim/ -name "*.cpp")
+STRING_SOURCES :=        $(shell find ../../source/string/ -name "*.cc") + \
+                         $(shell find ../../source/string/ -name "*.cpp") 
+
+SOURCES := $(2D_SOURCES) + \
+	$(ALGORITHM_SOURCES) + \
+	$(ASSETS_SOURCES) + \
+	$(AUDIO_SOURCES) + \
+	$(BITMAPFONT_SOURCES) + \
+	$(BOX2D_SOURCES) + \
+	$(COLLECTION_SOURCES) + \
+	$(COMPONENT_SOURCES) + \
+	$(CONSOLE_SOURCES) + \
+	$(DEBUG_SOURCES) + \
+	$(DELEGATES_SOURCES) + \
+	$(GAME_SOURCES) + \
+	$(GRAPHICS_SOURCES) + \
+	$(GUI_SOURCES) + \
+	$(INPUT_SOURCES) + \
+	$(IO_SOURCES) + \
+	$(MATH_SOURCES) + \
+	$(MEMORY_SOURCES) + \
+	$(MESSAGING_SOURCES) + \
+	$(MODULE_SOURCES) + \
+	$(NETWORK_SOURCES) + \
+	$(PERSISTENCE_SOURCES) + \
+	$(PLATFORM_SOURCES) + \
+	$(PLATFORM_UNIX_SOURCES) + \
+	$(SIM_SOURCES) + \
+	$(STRING_SOURCES)
+
+LDFLAGS := -g -m64
+LDLIBS := -lstdc++ -lm -ldl -lpthread -lrt -lX11 -lXft -lSDL -lopenal
+
+CFLAGS := -std=gnu++11 -MMD -I. -Wfatal-errors -Wunused -m64 -msse -march=x86-64 -pipe
+
+CFLAGS += -I/usr/include
+CFLAGS += -I/usr/include/freetype2
+CFLAGS += -I../../source
+CFLAGS += -I../../source/persistence/rapidjson/include
+CFLAGS += -I../../lib/ljpeg
+CFLAGS += -I../../lib/zlib
+CFLAGS += -I../../lib/lpng
+CFLAGS += -I../../lib/freetype
+CFLAGS += -I../../lib/libvorbis/include
+CFLAGS += -I../../lib/libogg/include
+CFLAGS += -I../../lib/openal/LINUX/
+
+CFLAGS += -DLINUX
+CFLAGS += -D__amd64__
+CFLAGS += -DTORQUE_64
+
+
+CFLAGS_DEBUG := $(CFLAGS) -ggdb
+CFLAGS_DEBUG += -DTORQUE_DEBUG
+CFLAGS_DEBUG += -DTORQUE_DEBUG_GUARD
+CFLAGS_DEBUG += -DTORQUE_NET_STATS
+
+CFLAGS += -O0
+
+NASMFLAGS := -f elf64 -D LINUX
+
+CC := gcc
+LD := gcc
+
+APP_TARGETS += $(APPNAME)
+APP_TARGETS_DEBUG += $(APPNAME)_DEBUG
+
+OBJS := $(patsubst ../../source/%,Release/%.o,$(SOURCES))
+OBJS := $(filter %.o, $(OBJS))
+
+OBJS_DEBUG := $(patsubst ../../source/%,Debug/%.o,$(SOURCES))
+OBJS_DEBUG := $(filter %.o,$(OBJS_DEBUG))
+
+$(APP_TARGETS): $(OBJS) $(LIB_TARGETS)
+	@echo Linking release
+	$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIB_TARGETS) $(LDLIBS)
+
+$(APP_TARGETS_DEBUG): $(OBJS_DEBUG) $(LIB_TARGETS_DEBUG)
+	@echo Linking debug
+	$(LD) $(LDFLAGS) -o $@ $(OBJS_DEBUG) $(LIB_TARGETS_DEBUG) $(LDLIBS)
+
+Release/%.asm.o:	../../source/%.asm
+	@echo Building release asm $@
+	@mkdir -p $(dir $@)
+	nasm $(NASMFLAGS) $< -o $@
+
+Release/%.o:	../../source/%
+	@echo Building release object $@
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS) $< -o $@
+
+Debug/%.asm.o:	../../source/%.asm
+	@echo Building debug asm $@
+	@mkdir -p $(dir $@)
+	nasm $(NASMFLAGS) $< -o $@
+
+Debug/%.o:	../../source/%
+	@echo Building debug object $@
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_DEBUG) $< -o $@
+
+release: $(APP_TARGETS)
+debug: $(APP_TARGETS_DEBUG)
+
+.PHONY: $(APP_TARGETS) $(APP_TARGETS_DEBUG)
+
+DEPS += $(patsubst %.o,%.d,$(OBJS))
+DEPS += $(patsubst %.o,%.d,$(OBJS_DEBUG))
+
+APPNAME :=
+SOURCES :=

+ 109 - 0
engine/compilers/Make-64bit/ljpeg

@@ -0,0 +1,109 @@
+# I release this sample under the MIT license: free for any use, provided 
+# you hold me harmless from any such use you make, and you retain my
+# copyright on the actual sources.
+# Copyright 2005 Jon Watte.
+
+LIBNAME := ljpeg
+SOURCES := ../../lib/ljpeg/jidctint.c \
+../../lib/ljpeg/jcmainct.c \
+../../lib/ljpeg/jfdctfst.c \
+../../lib/ljpeg/jdatadst.c \
+../../lib/ljpeg/jdsample.c \
+../../lib/ljpeg/jmemmgr.c \
+../../lib/ljpeg/jidctred.c \
+../../lib/ljpeg/jcphuff.c \
+../../lib/ljpeg/jchuff.c \
+../../lib/ljpeg/jdapistd.c \
+../../lib/ljpeg/jdpostct.c \
+../../lib/ljpeg/jquant2.c \
+../../lib/ljpeg/jdmerge.c \
+../../lib/ljpeg/jfdctflt.c \
+../../lib/ljpeg/jcprepct.c \
+../../lib/ljpeg/jccolor.c \
+../../lib/ljpeg/jfdctint.c \
+../../lib/ljpeg/jdhuff.c \
+../../lib/ljpeg/jcomapi.c \
+../../lib/ljpeg/jcinit.c \
+../../lib/ljpeg/jccoefct.c \
+../../lib/ljpeg/jdinput.c \
+../../lib/ljpeg/jutils.c \
+../../lib/ljpeg/jcapimin.c \
+../../lib/ljpeg/jdcoefct.c \
+../../lib/ljpeg/jidctflt.c \
+../../lib/ljpeg/jcmaster.c \
+../../lib/ljpeg/jddctmgr.c \
+../../lib/ljpeg/jidctfst.c \
+../../lib/ljpeg/jcparam.c \
+../../lib/ljpeg/jcapistd.c \
+../../lib/ljpeg/jdmaster.c \
+../../lib/ljpeg/jcdctmgr.c \
+../../lib/ljpeg/jctrans.c \
+../../lib/ljpeg/jdmainct.c \
+../../lib/ljpeg/jdtrans.c \
+../../lib/ljpeg/jcsample.c \
+../../lib/ljpeg/jdmarker.c \
+../../lib/ljpeg/jdatasrc.c \
+../../lib/ljpeg/jerror.c \
+../../lib/ljpeg/jquant1.c \
+../../lib/ljpeg/jdphuff.c \
+../../lib/ljpeg/jcmarker.c \
+../../lib/ljpeg/jdapimin.c \
+../../lib/ljpeg/jdcolor.c \
+../../lib/ljpeg/jmemnobs.c \
+
+LDFLAGS_ljpeg := -g -m64
+
+CFLAGS_ljpeg := -MMD -I. -m64 -msse -mmmx -march=x86-64
+
+CFLAGS_ljpeg += -I../../lib/ljpeg
+
+CFLAGS_ljpeg += -DUNICODE
+CFLAGS_ljpeg += -DLINUX
+
+CFLAGS_DEBUG_ljpeg := $(CFLAGS_ljpeg) -ggdb
+CFLAGS_DEBUG_ljpeg += -DTORQUE_DEBUG
+CFLAGS_DEBUG_ljpeg += -DTORQUE_DEBUG_GUARD
+CFLAGS_DEBUG_ljpeg += -DTORQUE_NET_STATS
+
+CFLAGS_ljpeg += -O3
+
+CC := gcc
+LD := gcc
+
+TARGET_ljpeg := lib/ljpeg.a
+TARGET_ljpeg_DEBUG := lib/ljpeg_DEBUG.a
+
+LIB_TARGETS += $(TARGET_ljpeg)
+LIB_TARGETS_DEBUG += $(TARGET_ljpeg_DEBUG)
+
+OBJS_ljpeg := $(patsubst ../../lib/ljpeg/%,Release/ljpeg/%.o,$(SOURCES))
+OBJS_ljpeg_DEBUG := $(patsubst ../../lib/ljpeg/%,Debug/ljpeg/%.o,$(SOURCES))
+
+# Deriving the variable name from the target name is the secret sauce
+# of the build system.
+#
+$(TARGET_ljpeg):	$(OBJS_ljpeg)
+	@echo Linking library ljpng
+	@mkdir -p $(dir $@)
+	ar cr $@ $(OBJS_ljpeg)
+
+$(TARGET_ljpeg_DEBUG):	$(OBJS_ljpeg_DEBUG)
+	@echo Linking debug library ljpng
+	@mkdir -p $(dir $@)
+	ar cr $@ $(OBJS_ljpeg_DEBUG)
+
+Release/ljpeg/%.o:	../../lib/ljpeg/%
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_ljpeg) $< -o $@
+
+Debug/ljpeg/%.o:	../../lib/ljpeg/%
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_DEBUG_ljpeg) $< -o $@
+
+release_ljpeg: $(TARGET_ljpeg)
+debug_ljpeg: $(TARGET_ljpeg_DEBUG)
+
+.PHONY: debug_ljpeg release_ljpeg
+
+DEPS += $(patsubst %.o,%.d,$(OBJS_ljpeg))
+DEPS += $(patsubst %.o,%.d,$(OBJS_ljpeg_DEBUG))

+ 78 - 0
engine/compilers/Make-64bit/lpng

@@ -0,0 +1,78 @@
+# I release this sample under the MIT license: free for any use, provided 
+# you hold me harmless from any such use you make, and you retain my 
+# copyright on the actual sources.
+# Copyright 2005 Jon Watte.
+
+LIBNAME := lpng
+SOURCES := ../../lib/lpng/pngerror.c \
+../../lib/lpng/pngwrite.c \
+../../lib/lpng/pngread.c \
+../../lib/lpng/pngmem.c \
+../../lib/lpng/pngset.c \
+../../lib/lpng/pngwio.c \
+../../lib/lpng/pngrtran.c \
+../../lib/lpng/pngtrans.c \
+../../lib/lpng/pngrutil.c \
+../../lib/lpng/pngwtran.c \
+../../lib/lpng/png.c \
+../../lib/lpng/pngrio.c \
+../../lib/lpng/pngwutil.c \
+../../lib/lpng/pngget.c \
+../../lib/lpng/pngpread.c \
+
+LDFLAGS_lpng := -g -m64
+#LDLIBS_lpng := -lstdc++
+CFLAGS_lpng := -MMD -I. -m64 -msse -mmmx -march=x86-64
+
+CFLAGS_lpng += -I../../lib/zlib
+CFLAGS_lpng += -I../../lib/lpng
+
+CFLAGS_lpng += -DUNICODE
+CFLAGS_lpng += -DLINUX
+
+
+CFLAGS_DEBUG_lpng := $(CFLAGS_lpng) -ggdb
+CFLAGS_DEBUG_lpng += -DTORQUE_DEBUG
+CFLAGS_DEBUG_lpng += -DTORQUE_DEBUG_GUARD
+CFLAGS_DEBUG_lpng += -DTORQUE_NET_STATS
+
+CFLAGS_lpng += -O3
+
+CC := gcc
+LD := gcc
+
+TARGET_lpng := lib/lpng.a
+TARGET_lpng_DEBUG := lib/lpng_DEBUG.a
+
+LIB_TARGETS += $(TARGET_lpng)
+LIB_TARGETS_DEBUG += $(TARGET_lpng_DEBUG)
+
+OBJS_lpng := $(patsubst ../../lib/lpng/%,Release/lpng/%.o,$(SOURCES))
+OBJS_lpng_DEBUG := $(patsubst ../../lib/lpng/%,Debug/lpng/%.o,$(SOURCES))
+
+# Deriving the variable name from the target name is the secret sauce 
+# of the build system.
+#
+$(TARGET_lpng):	$(OBJS_lpng)
+	@mkdir -p $(dir $@)
+	ar cr $@ $(OBJS_lpng)
+   
+$(TARGET_lpng_DEBUG):	$(OBJS_lpng_DEBUG)
+	@mkdir -p $(dir $@)
+	ar cr $@ $(OBJS_lpng_DEBUG)
+
+Release/lpng/%.o:	../../lib/lpng/%
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_lpng) $< -o $@
+   
+Debug/lpng/%.o:	../../lib/lpng/%
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_DEBUG_lpng) $< -o $@
+   
+release_lpng: $(TARGET_lpng)
+debug_lpng: $(TARGET_lpng_DEBUG)
+
+.PHONY: debug_lpng release_lpng
+
+DEPS += $(patsubst %.o,%.d,$(OBJS_lpng))
+DEPS += $(patsubst %.o,%.d,$(OBJS_lpng_DEBUG))

+ 64 - 0
engine/compilers/Make-64bit/ogg

@@ -0,0 +1,64 @@
+# I release this sample under the MIT license: free for any use, provided
+# you hold me harmless from any such use you make, and you retain my
+# copyright on the actual sources.
+# Copyright 2005 Jon Watte.
+
+LIBNAME := ogg
+SOURCES := \
+../../lib/libogg/src/bitwise.c \
+../../lib/libogg/src/framing.c \
+
+LDFLAGS_ogg := -g -m64
+
+CFLAGS_ogg := -MMD -I. -m64 -msse -mmmx -march=x86-64
+
+CFLAGS_ogg += -I../../lib/libogg/include
+
+CFLAGS_ogg += -DUNICODE
+CFLAGS_ogg += -DLINUX
+
+CFLAGS_DEBUG_ogg := $(CFLAGS_ogg) -ggdb
+CFLAGS_DEBUG_ogg += -DTORQUE_DEBUG
+CFLAGS_DEBUG_ogg += -DTORQUE_DEBUG_GUARD
+CFLAGS_DEBUG_ogg += -DTORQUE_NET_STATS
+
+CFLAGS_ogg += -O3
+
+CC := gcc
+LD := gcc
+
+TARGET_ogg := lib/libogg.a
+TARGET_ogg_DEBUG := lib/libogg_DEBUG.a
+
+LIB_TARGETS += $(TARGET_ogg)
+LIB_TARGETS_DEBUG += $(TARGET_ogg_DEBUG)
+
+OBJS_ogg := $(patsubst ../../lib/libogg/%,Release/ogg/%.o,$(SOURCES))
+OBJS_ogg_DEBUG := $(patsubst ../../lib/libogg/%,Debug/ogg/%.o,$(SOURCES))
+
+# Deriving the variable name from the target name is the secret sauce
+# of the build system.
+#
+$(TARGET_ogg):	$(OBJS_ogg)
+	@mkdir -p $(dir $@)
+	ar cr $@ $(OBJS_ogg)
+
+$(TARGET_ogg_DEBUG):	$(OBJS_ogg_DEBUG)
+	@mkdir -p $(dir $@)
+	ar cr $@ $(OBJS_ogg_DEBUG)
+
+Release/ogg/%.o:	../../lib/libogg/%
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_ogg) $< -o $@
+
+Debug/ogg/%.o:	../../lib/libogg/%
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_DEBUG_ogg) $< -o $@
+
+release_ogg: $(TARGET_ogg)
+debug_ogg: $(TARGET_ogg_DEBUG)
+
+.PHONY: debug_ogg release_ogg
+
+DEPS += $(patsubst %.o,%.d,$(OBJS_ogg))
+DEPS += $(patsubst %.o,%.d,$(OBJS_ogg_DEBUG))

+ 89 - 0
engine/compilers/Make-64bit/vorbis

@@ -0,0 +1,89 @@
+# I release this sample under the MIT license: free for any use, provided
+# you hold me harmless from any such use you make, and you retain my
+# copyright on the actual sources.
+# Copyright 2005 Jon Watte.
+
+LIBNAME := vorbis
+SOURCES := \
+../../lib/libvorbis/analysis.c \
+../../lib/libvorbis/barkmel.c \
+../../lib/libvorbis/bitrate.c \
+../../lib/libvorbis/block.c \
+../../lib/libvorbis/codebook.c \
+../../lib/libvorbis/envelope.c \
+../../lib/libvorbis/floor0.c \
+../../lib/libvorbis/floor1.c \
+../../lib/libvorbis/info.c \
+../../lib/libvorbis/lookup.c \
+../../lib/libvorbis/lpc.c \
+../../lib/libvorbis/lsp.c \
+../../lib/libvorbis/mapping0.c \
+../../lib/libvorbis/mdct.c \
+../../lib/libvorbis/psy.c \
+../../lib/libvorbis/registry.c \
+../../lib/libvorbis/res0.c \
+../../lib/libvorbis/sharedbook.c \
+../../lib/libvorbis/smallft.c \
+../../lib/libvorbis/synthesis.c \
+../../lib/libvorbis/tone.c \
+../../lib/libvorbis/vorbisenc.c \
+../../lib/libvorbis/vorbisfile.c \
+../../lib/libvorbis/window.c \
+
+LDFLAGS_vorbis := -g -m64
+
+CFLAGS_vorbis := -MMD -I. -m64 -msse -mmmx -march=x86-64
+
+CFLAGS_vorbis += -I../../lib/libvorbis
+CFLAGS_vorbis += -I../../lib/libvorbis/lib
+CFLAGS_vorbis += -I../../lib/libvorbis/include
+CFLAGS_vorbis += -I../../lib/libogg/include
+
+CFLAGS_vorbis += -DUNICODE
+CFLAGS_vorbis += -DLINUX
+
+CFLAGS_DEBUG_vorbis := $(CFLAGS_vorbis) -ggdb
+CFLAGS_DEBUG_vorbis += -DTORQUE_DEBUG
+CFLAGS_DEBUG_vorbis += -DTORQUE_DEBUG_GUARD
+CFLAGS_DEBUG_vorbis += -DTORQUE_NET_STATS
+
+CFLAGS_vorbis += -O3
+
+CC := gcc
+LD := gcc
+
+TARGET_vorbis := lib/libvorbis.a
+TARGET_vorbis_DEBUG := lib/libvorbis_DEBUG.a
+
+LIB_TARGETS += $(TARGET_vorbis)
+LIB_TARGETS_DEBUG += $(TARGET_vorbis_DEBUG)
+
+OBJS_vorbis := $(patsubst ../../lib/libvorbis/%,Release/vorbis/%.o,$(SOURCES))
+OBJS_vorbis_DEBUG := $(patsubst ../../lib/libvorbis/%,Debug/vorbis/%.o,$(SOURCES))
+
+# Deriving the variable name from the target name is the secret sauce
+# of the build system.
+#
+$(TARGET_vorbis):	$(OBJS_vorbis)
+	@mkdir -p $(dir $@)
+	ar cr $@ $(OBJS_vorbis)
+
+$(TARGET_vorbis_DEBUG):	$(OBJS_vorbis_DEBUG)
+	@mkdir -p $(dir $@)
+	ar cr $@ $(OBJS_vorbis_DEBUG)
+
+Release/vorbis/%.o:	../../lib/libvorbis/%
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_vorbis) $< -o $@
+
+Debug/vorbis/%.o:	../../lib/libvorbis/%
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_DEBUG_vorbis) $< -o $@
+
+release_vorbis: $(TARGET_vorbis)
+debug_vorbis: $(TARGET_vorbis_DEBUG)
+
+.PHONY: debug_vorbis release_vorbis
+
+DEPS += $(patsubst %.o,%.d,$(OBJS_vorbis))
+DEPS += $(patsubst %.o,%.d,$(OBJS_vorbis_DEBUG))

+ 76 - 0
engine/compilers/Make-64bit/zlib

@@ -0,0 +1,76 @@
+# I release this sample under the MIT license: free for any use, provided 
+# you hold me harmless from any such use you make, and you retain my 
+# copyright on the actual sources.
+# Copyright 2005 Jon Watte.
+
+LIBNAME := zlib
+SOURCES := ../../lib/zlib/adler32.c \
+../../lib/zlib/zutil.c \
+../../lib/zlib/crc32.c \
+../../lib/zlib/trees.c \
+../../lib/zlib/inflate.c \
+../../lib/zlib/inftrees.c \
+../../lib/zlib/gzclose.c \
+../../lib/zlib/gzread.c \
+../../lib/zlib/infback.c \
+../../lib/zlib/uncompr.c \
+../../lib/zlib/deflate.c \
+../../lib/zlib/inffast.c \
+../../lib/zlib/gzwrite.c \
+../../lib/zlib/compress.c \
+../../lib/zlib/gzlib.c \
+
+LDFLAGS_zlib := -g -m
+
+CFLAGS_zlib := -MMD -I. -m64 -msse -mmmx -march=x86-64
+
+CFLAGS_zlib += -I../../lib/zlib
+
+CFLAGS_zlib += -DUNICODE
+CFLAGS_zlib += -DLINUX
+
+CFLAGS_DEBUG_zlib := $(CFLAGS_zlib) -ggdb
+CFLAGS_DEBUG_zlib += -DTORQUE_DEBUG
+CFLAGS_DEBUG_zlib += -DTORQUE_DEBUG_GUARD
+CFLAGS_DEBUG_zlib += -DTORQUE_NET_STATS
+
+CFLAGS_zlib += -O3
+
+CC := gcc
+LD := gcc
+
+TARGET_zlib := lib/zlib.a
+TARGET_zlib_DEBUG := lib/zlib_DEBUG.a
+
+LIB_TARGETS += $(TARGET_zlib)
+LIB_TARGETS_DEBUG += $(TARGET_zlib_DEBUG)
+
+OBJS_zlib := $(patsubst ../../lib/zlib/%,Release/zlib/%.o,$(SOURCES))
+OBJS_zlib_DEBUG := $(patsubst ../../lib/zlib/%,Debug/zlib/%.o,$(SOURCES))
+
+# Deriving the variable name from the target name is the secret sauce 
+# of the build system.
+#
+$(TARGET_zlib):	$(OBJS_zlib)
+	@mkdir -p $(dir $@)
+	ar cr $@ $(OBJS_zlib)
+   
+$(TARGET_zlib_DEBUG):	$(OBJS_zlib_DEBUG)
+	@mkdir -p $(dir $@)
+	ar cr $@ $(OBJS_zlib_DEBUG)
+
+Release/zlib/%.o:	../../lib/zlib/%
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_zlib) $< -o $@
+   
+Debug/zlib/%.o:	../../lib/zlib/%
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_DEBUG_zlib) $< -o $@
+   
+release_zlib: $(TARGET_zlib)
+debug_zlib: $(TARGET_zlib_DEBUG)
+
+.PHONY: debug_zlib release_zlib
+
+DEPS += $(patsubst %.o,%.d,$(OBJS_zlib))
+DEPS += $(patsubst %.o,%.d,$(OBJS_zlib_DEBUG))

+ 8 - 5
engine/source/platform/types.posix.h

@@ -20,19 +20,22 @@
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
 
+#include <stddef.h>
+
 #ifndef _TYPESPOSIX_H_
 #define _TYPESPOSIX_H_
 
 
 #define FN_CDECL     ///< Calling convention
 
-// size_t is needed to overload new
-// size_t tends to be OS and compiler specific and may need to 
-// be if/def'ed in the future
-typedef unsigned int  dsize_t;      
+/**
+ * Platform-dependent type representing a size for pointers and arrays.
+ */
+
+typedef size_t dsize_t;      
 
 
-/** Platform dependent file date-time structure.  The defination of this structure
+/** Platform dependent file date-time structure.  The definition of this structure
   * will likely be different for each OS platform.
   */
 typedef S32 FileTime;

+ 11 - 0
engine/source/platformX86UNIX/x86UNIXCPUInfo.cc

@@ -62,9 +62,17 @@ void Processor::init()
    clockticks = properties = processor = Ttime[0] = 0;
    dStrcpy(vendor, "");
 
+   #ifndef TORQUE_64
    detectX86CPUInfo(vendor, &processor, &properties);
    SetProcessorInfo(PlatformSystemInfo.processor, 
       vendor, processor, properties);
+   # else
+   // 32 bit code to detect processor name and extensions is around, but feels kinda dinky in 2021.
+   // Porting it to 64 bit? Hardcode the bare minimum instead.
+   PlatformSystemInfo.processor.mhz = 1337;
+   PlatformSystemInfo.processor.name = StringTable->insert("AMD64 Compatible");
+   #endif
+
 
    U32 mhz = 0;
 
@@ -140,6 +148,8 @@ void Processor::init()
    } else {
       Con::printf("   %s, %d Mhz", PlatformSystemInfo.processor.name, PlatformSystemInfo.processor.mhz);
    }
+   
+   #ifndef TORQUE_64
    if (PlatformSystemInfo.processor.mhz != mhz) {
       if (mhz >= 1000) {
          Con::printf("     (timed at roughly %.2f Ghz)", ((float)mhz)/1000.0f);
@@ -156,6 +166,7 @@ void Processor::init()
    if (PlatformSystemInfo.processor.properties & CPU_PROP_SSE)
       Con::printf("   SSE detected");
    Con::printf(" ");
+   #endif
 
    PlatformBlitInit();
 }

+ 1 - 1
engine/source/platformX86UNIX/x86UNIXFont.h

@@ -55,7 +55,7 @@ class x86UNIXFont : public PlatformFont
 		virtual PlatformFont::CharInfo &getCharInfo(const UTF16 ch) const;
 		virtual PlatformFont::CharInfo &getCharInfo(const UTF8 *str) const;
 
-		virtual bool create(const char *name, dsize_t size, U32 charset = TGE_ANSI_CHARSET);
+		virtual bool create(const char *name, U32 size, U32 charset = TGE_ANSI_CHARSET);
 };
 
 #endif

+ 5 - 5
engine/source/platformX86UNIX/x86UNIXMemory.cc

@@ -25,26 +25,26 @@
 #include "platformX86UNIX/platformX86UNIX.h"
 #include <stdlib.h>
 
-void* dMemcpy(void *dst, const void *src, unsigned size)
+void* dMemcpy(void *dst, const void *src, size_t size)
 {
    return memcpy(dst,src,size);
 }   
 
 
 //--------------------------------------
-void* dMemmove(void *dst, const void *src, unsigned size)
+void* dMemmove(void *dst, const void *src, size_t size)
 {
    return memmove(dst,src,size);
 }  
  
 //--------------------------------------
-void* dMemset(void *dst, S32 c, unsigned size)
+void* dMemset(void *dst, S32 c, size_t size)
 {
    return memset(dst,c,size);   
 }   
 
 //--------------------------------------
-S32 dMemcmp(const void *ptr1, const void *ptr2, unsigned len)
+S32 dMemcmp(const void *ptr1, const void *ptr2, size_t len)
 {
    return memcmp(ptr1, ptr2, len);
 }
@@ -59,7 +59,7 @@ S32 dMemcmp(const void *ptr1, const void *ptr2, unsigned len)
 //   return (ptr);
 //}   
 
-void* dRealMalloc(dsize_t s)
+void* dRealMalloc(size_t s)
 {
    return malloc(s);
 }

+ 9 - 9
engine/source/platformX86UNIX/x86UNIXStrings.cc

@@ -105,7 +105,7 @@ char *stristr(char *szStringToBeSearched, const char *szSubstringToSearchFor)
    return pPos;
 } // stristr(...)
 
-char *dStrdup_r(const char *src, const char *fileName, U32 lineNumber)
+char *dStrdup_r(const char *src, const char *fileName, size_t lineNumber)
 {
    char *buffer = (char *) dMalloc_r(dStrlen(src) + 1, fileName, lineNumber);
    dStrcpy(buffer, src);
@@ -117,7 +117,7 @@ char* dStrcat(char *dst, const char *src)
    return strcat(dst,src);
 }   
 
-char* dStrncat(char *dst, const char *src, U32 len)
+char* dStrncat(char *dst, const char *src, size_t len)
 {
    return strncat(dst,src,len);
 }
@@ -125,7 +125,7 @@ char* dStrncat(char *dst, const char *src, U32 len)
 // concatenates a list of src's onto the end of dst
 // the list of src's MUST be terminated by a NULL parameter
 // dStrcatl(dst, sizeof(dst), src1, src2, NULL);
-char* dStrcatl(char *dst, U32 dstSize, ...)
+char* dStrcatl(char *dst, size_t dstSize, ...)
 {
    const char* src;
    char *p = dst;
@@ -160,7 +160,7 @@ char* dStrcatl(char *dst, U32 dstSize, ...)
 // copy a list of src's into dst
 // the list of src's MUST be terminated by a NULL parameter
 // dStrccpyl(dst, sizeof(dst), src1, src2, NULL);
-char* dStrcpyl(char *dst, U32 dstSize, ...)
+char* dStrcpyl(char *dst, size_t dstSize, ...)
 {
    const char* src;
    char *p = dst;
@@ -219,12 +219,12 @@ S32 dStricmp(const char *str1, const char *str2)
    return strcasecmp(str1, str2);   
 }  
 
-S32 dStrncmp(const char *str1, const char *str2, U32 len)
+S32 dStrncmp(const char *str1, const char *str2, size_t len)
 {
    return strncmp(str1, str2, len);   
 }  
  
-S32 dStrnicmp(const char *str1, const char *str2, U32 len)
+S32 dStrnicmp(const char *str1, const char *str2, size_t len)
 {
    return strncasecmp(str1, str2, len);   
 }   
@@ -234,7 +234,7 @@ char* dStrcpy(char *dst, const char *src)
    return strcpy(dst,src);
 }   
 
-char* dStrncpy(char *dst, const char *src, U32 len)
+char* dStrncpy(char *dst, const char *src, size_t len)
 {
    return strncpy(dst,src,len);
 }   
@@ -361,7 +361,7 @@ S32 dVprintf(const char *format, va_list arglist)
    return (len);
 }   
 
-S32 dSprintf(char *buffer, U32 bufferSize, const char *format, ...)
+S32 dSprintf(char *buffer, size_t bufferSize, const char *format, ...)
 {
    va_list args;
    va_start(args, format);
@@ -374,7 +374,7 @@ S32 dSprintf(char *buffer, U32 bufferSize, const char *format, ...)
 }   
 
 
-S32 dVsprintf(char *buffer, U32 bufferSize, const char *format, va_list arglist)
+S32 dVsprintf(char *buffer, size_t bufferSize, const char *format, va_list arglist)
 {
    S32 len = vsnprintf(buffer, bufferSize, format, arglist);
 

+ 3 - 3
engine/source/platformX86UNIX/x86UNIXThread.cc

@@ -129,9 +129,9 @@ bool Thread::isAlive()
   return ( !mData->mDead );
 }
 
-U32 Thread::getId()
+ThreadIdent Thread::getId()
 {
-   return (U32)mData->mThreadID;
+   return (ThreadIdent)mData->mThreadID;
 }
 
 ThreadIdent ThreadManager::getCurrentThreadId()
@@ -139,7 +139,7 @@ ThreadIdent ThreadManager::getCurrentThreadId()
    return pthread_self();
 }
 
-bool ThreadManager::compare(U32 threadId_1, U32 threadId_2)
+bool ThreadManager::compare(ThreadIdent threadId_1, ThreadIdent threadId_2)
 {
    return pthread_equal((pthread_t)threadId_1, (pthread_t)threadId_2);
 }