From 6b4d000993016a05e1581b4c00302e4da7b157d8 Mon Sep 17 00:00:00 2001 From: Yvan Janssens Date: Tue, 3 Sep 2019 08:58:35 +0100 Subject: [PATCH] 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