From 5885e973db55eeea5829168f520d5a5ba82189af Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Tue, 5 Jan 2010 22:01:10 +0000 Subject: [PATCH] Makefile changes: - Changed INLINE to map to "static inline" - (Windows only) Made -static-libgcc standard for both 32-bit and 64-bit - (Windows only) Some fixes for MSVC builds --- makefile | 2 +- src/osd/windows/windows.mak | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/makefile b/makefile index 71bfff923af..c6645657291 100644 --- a/makefile +++ b/makefile @@ -255,7 +255,7 @@ DEFS = -DCRLF=3 endif # map the INLINE to something digestible by GCC -DEFS += -DINLINE=inline +DEFS += -DINLINE="static inline" # define LSB_FIRST if we are a little-endian target ifndef BIGENDIAN diff --git a/src/osd/windows/windows.mak b/src/osd/windows/windows.mak index c6b73e454fb..aab0830bc09 100644 --- a/src/osd/windows/windows.mak +++ b/src/osd/windows/windows.mak @@ -108,6 +108,7 @@ endif ifdef MSVC_BUILD VCONV = $(WINOBJ)/vconv$(EXE) +VCONVPREFIX = $(subst /,\,$(VCONV)) # append a 'v' prefix if nothing specified ifndef PREFIX @@ -115,10 +116,10 @@ PREFIX = v endif # replace the various compilers with vconv.exe prefixes -CC = @$(VCONV) gcc -I. -LD = @$(VCONV) ld /profile -AR = @$(VCONV) ar -RC = @$(VCONV) windres +CC = @$(VCONVPREFIX) gcc -I. +LD = @$(VCONVPREFIX) ld /profile +AR = @$(VCONVPREFIX) ar +RC = @$(VCONVPREFIX) windres # make sure we use the multithreaded runtime ifdef DEBUG @@ -140,6 +141,9 @@ CCOMFLAGS += /wd4267 LIBS += -lbufferoverflowu endif +# enable exception handling for C++ +CPPONLYFLAGS += /EHsc + # disable function pointer warnings in C++ which are evil to work around CPPONLYFLAGS += /wd4191 /wd4060 /wd4065 /wd4640 @@ -147,7 +151,7 @@ CPPONLYFLAGS += /wd4191 /wd4060 /wd4065 /wd4640 LDFLAGS += /ENTRY:wmainCRTStartup # add some VC++-specific defines -DEFS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DXML_STATIC -D__inline__=__inline -Dsnprintf=_snprintf +DEFS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DXML_STATIC -Dsnprintf=_snprintf # make msvcprep into a pre-build step OSPREBUILD = $(VCONV) @@ -217,9 +221,11 @@ CCOMFLAGS += -include $(WINSRC)/winprefix.h # for 32-bit apps, add unicows for Unicode support on Win9x ifndef PTR64 LIBS += -lunicows -LDFLAGS += -static-libgcc endif +# ensure we statically link the gcc runtime lib +LDFLAGS += -static-libgcc + # add the windows libraries LIBS += -luser32 -lgdi32 -lddraw -ldsound -ldxguid -lwinmm -ladvapi32 -lcomctl32 -lshlwapi -ldinput8