From 8243df99e545a1dee1f9742ece38d4c8d366bb62 Mon Sep 17 00:00:00 2001 From: Yvan Janssens Date: Tue, 3 Sep 2019 08:33:05 +0100 Subject: [PATCH 1/2] Fix incompatibility with latest mingw toolchain This patch fixes the incompatibility with the latest mingw toolchain (which uses GCC-9.2). --- src/win/Makefile.mingw | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index dcaba9b7d..5886eed0b 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -233,14 +233,14 @@ VPATH := $(EXPATH) . cpu \ sound/resid-fp \ scsi video network network/slirp win ifeq ($(X64), y) -CPP := g++ -m64 -CC := gcc -m64 +TOOL_PREFIX := x86_64-w64-mingw32- else -CPP := g++ -m32 -CC := gcc -m32 +TOOL_PREFIX := i686-w64-mingw32- endif +CPP := ${TOOL_PREFIX}g++ +CC := ${TOOL_PREFIX}gcc WINDRES := windres -STRIP := strip +STRIP := strip ifeq ($(ARM64), y) CPP := aarch64-w64-mingw32-g++ CC := aarch64-w64-mingw32-gcc @@ -467,6 +467,10 @@ endif CFLAGS := $(WX_FLAGS) $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \ $(AFLAGS) -fomit-frame-pointer -mstackrealign -Wall \ -fno-strict-aliasing + +# Add freetyp2 references through pkgconfig +CFLAGS := $(CFLAGS) `pkg-config.exe --cflags freetype2` + CXXFLAGS := $(CFLAGS) From 6b4d000993016a05e1581b4c00302e4da7b157d8 Mon Sep 17 00:00:00 2001 From: Yvan Janssens Date: Tue, 3 Sep 2019 08:58:35 +0100 Subject: [PATCH 2/2] Add static build support This commit allows for building statically linked 86Box binaries. Statically linked 86Box binaries do not need additional DLL files, which improves user-friendliness significantly. --- src/win/Makefile.mingw | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 5886eed0b..53251dce4 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -638,9 +638,15 @@ OBJ += $(EXOBJ) endif LIBS := -mwindows \ - -lopenal.dll \ -lddraw -ldxguid -ld3d9 \ -lcomctl32 -lwinmm + +ifeq ($(STATIC), y) +LIBS += -lopenal -lole32 +else +LIBS += -lopenal.dll +endif + ifeq ($(D2D), y) LIBS += $(D2DLIB) endif @@ -667,6 +673,10 @@ ifeq ($(D3DX), y) LIBS += -ld3dx9 endif +ifeq ($(STATIC), y) +LIBS += -static +endif + # Build module rules. ifeq ($(AUTODEP), y) %.o: %.c