Ticket #995: MinGWBuildFix.patch
File MinGWBuildFix.patch, 7.2 KB (added by , 13 years ago) |
---|
-
api/Makefile.mingw
1 BOINCDIR = ..2 DEBUG = -D__DEBUG__ -g33 OBJ = boinc_api.o util.o win_util.o app_ipc.o diagnostics.o diagnostics_win.o filesys.o hostinfo.o md5.o md5_file.o mem_usage.o mfile.o miofile.o parse.o prefs.o proxy_info.o str_util.o shmem.o stackwalker_win.o base64.o url.o coproc.o4 LINKOBJ = $(OBJ)5 LDFLAGS = -lwinmm -march=i3866 INCS = -I"$(BOINCDIR)" -I"$(BOINCDIR)/db" -I"$(BOINCDIR)" -I"$(BOINCDIR)/lib" -I"$(BOINCDIR)/api"7 CXXINCS = $(INCS)8 BIN = libboinc.a9 #10 CXXFLAGS = $(CXXINCS) $(DEBUG) --include $(BOINCDIR)/version.h -DWIN32 -D_WIN32 -D_WIN32_WINDOWS=0x0501 -D_MT -DNDEBUG -D_WINDOWS -DBOINC -DCLIENT -DNODB -D_CONSOLE -Wall -mtune=pentium-m -fexceptions -march=i386 -O111 CFLAGS = $(INCS) $(DEBUG) --include $(BOINCDIR)/version.h -DWIN32 -D_WIN32 -D_WIN32_WINDOWS=0x0501 -D_MT -DNDEBUG -D_WINDOWS -DBOINC -DCLIENT -DNODB -D_CONSOLE -Wall -mtune=pentium-m -fexceptions -march=i386 -O112 13 14 .PHONY: all all-before all-after clean clean-custom15 16 all: all-before $(BIN) all-after17 18 19 clean: clean-custom20 ${RM} $(OBJ) $(BIN)21 22 $(BIN): $(LINKOBJ)23 $(AR) rc $@ $(LINKOBJ)24 ranlib $@25 26 %.o: $(BOINCDIR)/api/%.cpp27 $(CXX) -c $< -o $@ $(CXXFLAGS)28 29 %.o: $(BOINCDIR)/lib/%.cpp30 $(CXX) -c $< -o $@ $(CXXFLAGS)31 32 md5.o: $(BOINCDIR)/lib/md5.c33 $(CXX) -c $(BOINCDIR)/lib/md5.c -o md5.o $(CXXFLAGS)34 35 stackwalker_win.o: $(BOINCDIR)/lib/stackwalker_win.cpp36 $(CXX) -c $(BOINCDIR)/lib/stackwalker_win.cpp -o stackwalker_win.o $(CXXFLAGS) -
lib/boinc_win.h
243 243 #define __attribute__(x) 244 244 #endif 245 245 246 #ifdef __MINGW32__ 247 #ifdef __cplusplus 248 extern "C" { 249 #endif 250 void __cdecl _fpreset (void); 251 void __cdecl fpreset (void); 252 #if (__GNUC__ < 4) // breaks build on MinGW gcc-4 246 #if defined(__MINGW32__) && (__GNUC__ < 4) 247 // breaks build on MinGW gcc-4 253 248 #define SetClassLongPtr SetClassLong 254 249 #define GCLP_HICON GCL_HICON 255 250 #define GCLP_HICONSM GCL_HICONSM 256 #endif //GNUC 257 #ifdef __cplusplus 258 } 259 #endif //cplusplus 260 #endif //MINGW 251 #endif //MINGW32 && GNUC < 4 261 252 262 253 // On the Win32 platform include file and line number information for each 263 254 // memory allocation/deallocation -
lib/Makefile.mingw
1 1 # Makefile for building BOINC with MinGW (gcc and gnumake) 2 2 3 3 # if you want to use install/uninstall targets, set this to the prefix 4 BOINC_PREFIX ?= /usr/local /boinc4 BOINC_PREFIX ?= /usr/local 5 5 6 6 # set this for the BOINC sourc directory. This default should work for calling from within lib/ or api/ 7 7 BOINC_SRC ?= .. 8 8 9 9 10 10 # headers to install 11 HEADERS = $(BOINC_SRC)/version.h $(BOINC_SRC)/api/boinc_api.h $(BOINC_SRC)/api/graphics2.h $(BOINC_SRC)/lib/app_ipc.h \ 12 $(BOINC_SRC)/lib/boinc_win.h $(BOINC_SRC)/lib/url.h $(BOINC_SRC)/lib/common_defs.h $(BOINC_SRC)/lib/diagnostics.h \ 13 $(BOINC_SRC)/lib/diagnostics_win.h $(BOINC_SRC)/lib/filesys.h $(BOINC_SRC)/lib/hostinfo.h $(BOINC_SRC)/lib/proxy_info.h \ 14 $(BOINC_SRC)/lib/prefs.h $(BOINC_SRC)/lib/miofile.h $(BOINC_SRC)/lib/mfile.h $(BOINC_SRC)/lib/parse.h \ 15 $(BOINC_SRC)/lib/util.h $(BOINC_SRC)/lib/coproc.h $(BOINC_SRC)/lib/cal_boinc.h $(BOINC_SRC)/lib/svn_version.h \ 16 $(BOINC_SRC)/win_build/config.h 11 HEADERS = $(BOINC_SRC)/version.h \ 12 $(BOINC_SRC)/api/boinc_api.h \ 13 $(BOINC_SRC)/api/graphics2.h \ 14 $(BOINC_SRC)/lib/app_ipc.h \ 15 $(BOINC_SRC)/lib/boinc_win.h \ 16 $(BOINC_SRC)/lib/url.h \ 17 $(BOINC_SRC)/lib/common_defs.h \ 18 $(BOINC_SRC)/lib/diagnostics.h \ 19 $(BOINC_SRC)/lib/diagnostics_win.h \ 20 $(BOINC_SRC)/lib/filesys.h \ 21 $(BOINC_SRC)/lib/hostinfo.h \ 22 $(BOINC_SRC)/lib/proxy_info.h \ 23 $(BOINC_SRC)/lib/prefs.h \ 24 $(BOINC_SRC)/lib/miofile.h \ 25 $(BOINC_SRC)/lib/mfile.h \ 26 $(BOINC_SRC)/lib/parse.h \ 27 $(BOINC_SRC)/lib/util.h \ 28 $(BOINC_SRC)/lib/coproc.h \ 29 $(BOINC_SRC)/lib/cal_boinc.h \ 30 $(BOINC_SRC)/lib/cl.h \ 31 $(BOINC_SRC)/lib/cl_platform.h \ 32 $(BOINC_SRC)/lib/svn_version.h \ 33 $(BOINC_SRC)/win_build/config.h \ 34 $(BOINC_SRC)/lib/str_util.h 17 35 18 36 ZIP_HEADERS = zip/boinc_zip.h 19 37 … … 46 64 BIN = $(API_BIN) $(LIB_BIN) $(GPH_BIN) 47 65 48 66 # -gstabs is necessary for MinGWs backtrace to work 49 DEBUG = -D__DEBUG__ -gstabs -g3 67 #DEBUG = -D__DEBUG__ -gstabs -g3 68 DEBUG = -DNDEBUG 50 69 51 70 # where to find headers 52 71 INCS = -I"$(BOINC_SRC)" -I"$(BOINC_SRC)/db" -I"$(BOINC_SRC)/lib" -I"$(BOINC_SRC)/api" -I"$(BOINC_SRC)/zip" -I"$(BOINC_SRC)/win_build" 53 72 54 73 74 OPTFLAGS = -O3 55 75 # various cpp & gcc flags (for both C and C++ mode) 56 76 # set NOCYGWIN=-mno-cygwin to build non-Cywin Windows libs under Cygwin 57 77 # -D_WIN32_WINDOWS=0x0410 sets to use Win98 API 78 WINVERFLAGS = -D_WINDOWS -D_WIN32 -DWIN32 -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_MT 79 HAVEFLAGS = -DHAVE_STRCASECMP 58 80 CCXXFLAGS = $(INCS) $(DEBUG) --include $(BOINC_SRC)/version.h -DEINSTEINATHOME_CROSS_BUILD -DMINGW_WIN32 \ 59 -DHAVE_STRCASECMP -DWIN32 -D_WIN32 -D_WIN32_WINDOWS=0x0410 -D_MT -DNDEBUG -D_WINDOWS-DBOINC \60 -DNODB -D_CONSOLE - mtune=pentium-m -fexceptions -march=i386 -O2$(NOCYGWIN)81 $(HAVEFLAGS) $(WINVERFLAGS) -DBOINC \ 82 -DNODB -D_CONSOLE -fexceptions $(OPTFLAGS) $(NOCYGWIN) 61 83 62 84 # flags for compiling boinc_zip 63 ZIP_FLAGS = -DWIN32 -D NDEBUG -D_LIB -D_MBCS -DNO_MKTEMP $(INCS) -O2 -DDLL $(NOCYGWIN)85 ZIP_FLAGS = -DWIN32 -D_LIB -D_MBCS -DNO_MKTEMP $(INCS) -O2 -DDLL $(NOCYGWIN) 64 86 65 LDFLAGS = -lwinmm -march=i386 87 # LDFLAGS = -lwinmm 66 88 67 89 CFLAGS = $(CCXXFLAGS) 68 90 CXXFLAGS = $(CCXXFLAGS) … … 120 142 # additional targets 121 143 122 144 install: $(BIN) $(HEADERS) 123 mkdir -p $(BOINC_PREFIX)/include/BOINC $(BOINC_PREFIX)/include/boinc $(BOINC_PREFIX)/lib 124 cp $(HEADERS) $(BOINC_PREFIX)/include/BOINC 145 mkdir -p $(BOINC_PREFIX)/include/boinc $(BOINC_PREFIX)/lib 125 146 cp $(HEADERS) $(BOINC_PREFIX)/include/boinc 126 147 $(RANLIB) $(BIN) 127 148 cp $(BIN) $(BOINC_PREFIX)/lib 128 149 129 150 install-zip: $(ZIP_BIN) $(ZIP_HEADERS) 130 mkdir -p $(BOINC_PREFIX)/include/ BOINC$(BOINC_PREFIX)/lib131 cp $(ZIP_HEADERS) $(BOINC_PREFIX)/include/ BOINC151 mkdir -p $(BOINC_PREFIX)/include/ $(BOINC_PREFIX)/lib 152 cp $(ZIP_HEADERS) $(BOINC_PREFIX)/include/ 132 153 $(RANLIB) $(ZIP_BIN) 133 154 cp $(ZIP_BIN) $(BOINC_PREFIX)/lib 134 155 135 uninstall: 136 rm -f $(BOINC_PREFIX)/include/BOINC/*.h 137 rmdir -p $(BOINC_PREFIX)/include/BOINC 138 rm -f $(BOINC_PREFIX)/include/boinc/*.h 139 rmdir -p $(BOINC_PREFIX)/include/boinc 156 uninstall: 157 ${RM} -rf $(BOINC_PREFIX)/include/boinc 158 ${RM} $(BOINC_PREFIX)/lib/libboinc.a $(BOINC_PREFIX)/lib/libboinc_api.a $(BOINC_PREFIX)/lib/libboinc_graphics2.a 140 159 ( cd $(BOINC_PREFIX)/lib && rm -f $(BIN) || exit 0 ) 141 160 142 161 clean: -
lib/stackwalker_imports.h
21 21 #define gle (GetLastError()) 22 22 #define TTBUFLEN 8096 // for a temp buffer (2^13) 23 23 24 #if defined(__MINGW32__) || defined(__CYGWIN32__)24 #if (defined(__CYGWIN32__) || defined(__MINGW32__)) && !defined(__MINGW64__) 25 25 26 26 #define MAX_SYM_NAME 2000 27 27