Commit 90d3187d authored by Oliver Bock's avatar Oliver Bock

BOINC's own MinGW Makefile got fixed quite a while ago, let's finally use it.

parent b7815111
......@@ -650,53 +650,10 @@ build_boinc_mingw()
prepare_boinc $TAG_GFXAPPS || failure
echo "Patching BOINC..." | tee -a $LOGFILE
# patch: fix BOINC vs. MinGW issues
cd $ROOT/3rdparty/boinc/api || failure
patch boinc_api.h < $ROOT/patches/boinc.boinc_api.h.mingw.patch >> $LOGFILE 2>&1 || failure # patch sent upstream!
cd $ROOT/3rdparty/boinc/lib || failure
patch diagnostics.cpp < $ROOT/patches/boinc.diagnostics.cpp.mingw.patch >> $LOGFILE 2>&1 || failure # patch sent upstream!
patch diagnostics_win.cpp < $ROOT/patches/boinc.diagnostics_win.cpp.mingw.1.patch >> $LOGFILE 2>&1 || failure # patch sent upstream!
patch diagnostics_win.cpp < $ROOT/patches/boinc.diagnostics_win.cpp.mingw.2.patch >> $LOGFILE 2>&1 || failure # patch sent upstream!
patch filesys.cpp < $ROOT/patches/boinc.filesys.cpp.mingw.patch >> $LOGFILE 2>&1 || failure
echo "Building BOINC (this may take a while)..." | tee -a $LOGFILE
cd $ROOT/3rdparty/boinc || failure
chmod +x _autosetup >> $LOGFILE 2>&1 || failure
./_autosetup >> $LOGFILE 2>&1 || failure
chmod +x configure >> $LOGFILE 2>&1 || failure
cd $ROOT/build/boinc || failure
# note: configure is still required but we don't use the generated Makefile
$ROOT/3rdparty/boinc/configure --host=$TARGET_HOST --build=$BUILD_HOST --prefix=$ROOT/install --includedir=$ROOT/install/include --oldincludedir=$ROOT/install/include --enable-shared=no --enable-static=yes --disable-server --disable-client --enable-install-headers --enable-libraries --disable-manager --disable-fcgi >> $LOGFILE 2>&1 || failure
cd $ROOT/build/boinc/api || failure
cp $ROOT/3rdparty/boinc/api/Makefile.mingw . >> $LOGFILE 2>&1 || failure
# patch: add graphics2 and customize build path (see below)
patch Makefile.mingw < $ROOT/patches/boinc.Makefile.mingw.patch >> $LOGFILE 2>&1 || failure
export BOINC_SRC=$ROOT/3rdparty/boinc || failure
cd $ROOT/build/boinc || failure
# required for out-of-tree build
cp config.h $ROOT/3rdparty/boinc >> $LOGFILE 2>&1 || failure
make -f api/Makefile.mingw >> $LOGFILE 2>&1 || failure
cp $ROOT/build/boinc/libboinc.a $ROOT/install/lib >> $LOGFILE 2>&1 || failure
mkdir -p $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/build/boinc/config.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/build/boinc/version.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/api/boinc_api.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/api/graphics2.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/lib/app_ipc.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/lib/boinc_win.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/lib/common_defs.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/lib/diagnostics.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/lib/diagnostics_win.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/lib/filesys.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/lib/hostinfo.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/lib/proxy_info.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/lib/prefs.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/lib/miofile.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/lib/mfile.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/lib/parse.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
cp $ROOT/3rdparty/boinc/lib/util.h $ROOT/install/include/boinc >> $LOGFILE 2>&1 || failure
# invoke MinGW's ranlib as the archive lacks an index
${TARGET_HOST}-ranlib $ROOT/install/lib/libboinc.a
BOINC_SRC="$ROOT/3rdparty/boinc" AR="${TARGET_HOST}-ar" make -f Makefile.mingw >> $LOGFILE 2>&1 || failure
BOINC_PREFIX="$ROOT/install" RANLIB="${TARGET_HOST}-ranlib" make -f Makefile.mingw install >> $LOGFILE 2>&1 || failure
echo "Successfully built and installed BOINC!" | tee -a $LOGFILE
store_build_state $BS_BUILD_BOINC_MINGW || failure
......
--- Makefile.mingw
+++ Makefile.mingw 2009-07-07 15:03:03.000000000 +0200
@@ -1,14 +1,14 @@
-BOINCDIR = ./boinc
+BOINCDIR = $(BOINC_SRC)
DEBUG = -D__DEBUG__ -g3
-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
+OBJ = graphics2.o graphics2_util.o 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
LINKOBJ = $(OBJ)
LDFLAGS = -lwinmm -march=i386
INCS = -I"$(BOINCDIR)" -I"$(BOINCDIR)/db" -I"$(BOINCDIR)" -I"$(BOINCDIR)/lib" -I"$(BOINCDIR)/api"
CXXINCS = $(INCS)
BIN = libboinc.a
#
-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 -O1
-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 -O1
+CXXFLAGS = $(CXXINCS) $(DEBUG) --include $(BOINCDIR)/version.h -DMINGW_WIN32 -DWIN32 -D_WIN32 -D_WIN32_WINDOWS=0x0410 -D_MT -DNDEBUG -D_WINDOWS -DBOINC -DCLIENT -DNODB -D_CONSOLE -Wall -mtune=pentium-m -fexceptions -march=i386 -O1
+CFLAGS = $(INCS) $(DEBUG) --include $(BOINCDIR)/version.h -DWIN32 -D_WIN32 -D_WIN32_WINDOWS=0x0410 -D_MT -DNDEBUG -D_WINDOWS -DBOINC -DCLIENT -DNODB -D_CONSOLE -Wall -mtune=pentium-m -fexceptions -march=i386 -O1
.PHONY: all all-before all-after clean clean-custom
--- boinc_api.h
+++ boinc_api.h 2009-11-06 16:30:39.000000000 +0100
@@ -22,6 +22,10 @@
#include <Carbon/Carbon.h>
#endif
+#ifdef _WIN32
+#include "boinc_win.h"
+#endif
+
// ANSI C API BEGINS HERE
// Do not put implementation stuff here
--- diagnostics.cpp
+++ diagnostics.cpp 2009-11-06 14:35:59.000000000 +0100
@@ -22,7 +22,7 @@
#include "boinc_win.h"
#endif
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__MINGW32__)
#define snprintf _snprintf
#define strdate _strdate
#define strtime _strtime
--- diagnostics_win.cpp
+++ diagnostics_win.cpp 2009-11-06 15:10:47.000000000 +0100
@@ -22,7 +22,7 @@
#include "boinc_win.h"
#endif
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__MINGW32__)
#define snprintf _snprintf
#define strdate _strdate
#define strtime _strtime
--- diagnostics_win.cpp
+++ diagnostics_win.cpp 2009-11-06 15:00:28.000000000 +0100
@@ -2069,9 +2069,15 @@
// library this function will write whatever trace information it can and
// then throw a breakpoint exception to dump all the rest of the useful
// information.
+#ifdef MINGW_WIN32
+void boinc_catch_signal_invalid_parameter(
+ const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line)
+#else
void boinc_catch_signal_invalid_parameter(
const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line, uintptr_t /* pReserved */
-) {
+)
+#endif
+{
fprintf(
stderr,
"ERROR: Invalid parameter detected in function %s. File: %s Line: %d\n",
--- filesys.cpp
+++ 3rdparty/boinc/lib/filesys.cpp 2009-03-28 18:30:26.000000000 +0100
@@ -19,7 +19,7 @@
#include "boinc_win.h"
#endif
-#if !defined(_WIN32) || defined(__CYGWIN32__)
+#if !defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__)
#include "config.h"
#ifdef _USING_FCGI_
#include "boinc_fcgi.h"
......@@ -32,7 +32,7 @@ LIBS += -lframework -loglft -L$(STARSPHERE_INSTALL)/lib
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --libs)
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/xml2-config --libs)
LIBS += -lws2_32 # required by libxml2
LIBS += -lboinc
LIBS += -lboinc_graphics2 -lboinc_api -lboinc
LIBS += -Wl,-Bdynamic
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --static-libs)
LIBS += -lopengl32 -lglu32
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment