diff --git a/build.sh b/build.sh index 8267a5c6f68e518b06ab4c54110975d20f818933..46455eaea5c1129f1554bcaa325fab1e7897ab20 100755 --- a/build.sh +++ b/build.sh @@ -36,7 +36,7 @@ LOGFILE=$ROOT/build.log TARGET=0 TARGET_LINUX=1 TARGET_MAC=2 -TARGET_WIN32=3 +TARGET_WIN=3 TARGET_DOC=4 BUILDSTATE=0 @@ -208,38 +208,6 @@ prepare_version_header() } -prepare_mingw() -{ - if [ $BUILDSTATE -ge $BS_PREPARE_MINGW ]; then - return 0 - fi - - cd $ROOT || failure - - echo "Preparing MinGW source tree..." | tee -a $LOGFILE - mkdir -p 3rdparty/mingw/xscripts >> $LOGFILE || failure - cd 3rdparty/mingw/xscripts || failure - - if [ -d CVS ]; then - echo "Updating MinGW build script..." | tee -a $LOGFILE - cvs update -C >> $LOGFILE 2>&1 || failure - else - cd .. || failure - echo "Retrieving MinGW build script (this may take a while)..." | tee -a $LOGFILE - cvs -z3 -d:pserver:anonymous@mingw.cvs.sourceforge.net:/cvsroot/mingw checkout -P xscripts >> $LOGFILE 2>&1 || failure - fi - - echo "Preparing MinGW build script..." | tee -a $LOGFILE - cd $ROOT/3rdparty/mingw/xscripts || failure - # note: svn has no force/overwrite switch. the file might not be updated when patched - patch x86-mingw32-build.sh.conf < $ROOT/patches/x86-mingw32-build.sh.conf.patch >> $LOGFILE || failure - chmod +x x86-mingw32-build.sh >> $LOGFILE || failure - - store_build_state $BS_PREPARE_MINGW - return 0 -} - - prepare_sdl() { echo "Preparing SDL..." | tee -a $LOGFILE @@ -493,31 +461,12 @@ build_boinc() } -build_mingw() -{ - if [ $BUILDSTATE -ge $BS_BUILD_MINGW ]; then - return 0 - fi - TARGET_HOST=i586-pc-mingw32 - - echo "Building MinGW (this will take quite a while)..." | tee -a $LOGFILE - # note: the script's current config for unattended setup expects it to be run from three levels below root! - cd $ROOT/3rdparty/mingw/xscripts || failure - ./x86-mingw32-build.sh --unattended $TARGET_HOST >> $LOGFILE 2>&1 || failure - - store_build_state $BS_BUILD_MINGW - return 0 -} - - set_mingw() { # general config PREFIX=$ROOT/install - # the following target host spec is Debian specific! - # use "i586-pc-mingw32" when building MinGW automatically - export TARGET_HOST=i586-mingw32msvc - BUILD_HOST=i386-linux + export TARGET_HOST=x86_64-w64-mingw32 + BUILD_HOST=x86_64-linux PATH_MINGW="$PREFIX/bin:$PREFIX/$TARGET_HOST/bin:$PATH" PATH="$PATH_MINGW" export PATH @@ -525,7 +474,7 @@ set_mingw() export CC=`which ${TARGET_HOST}-gcc` export CXX=`which ${TARGET_HOST}-g++` - export CPPFLAGS="-D_WIN32_WINDOWS=0x0410 -DMINGW_WIN32 $CPPFLAGS" + export CPPFLAGS="-static -m64 $CPPFLAGS" } @@ -690,7 +639,7 @@ build_starsphere() export ORC_INSTALL=$ROOT/install || failure cd $ROOT/build/orc || failure cp $ROOT/src/orc/Makefile . >> $LOGFILE 2>&1 || failure - if [ "$1" == "$TARGET_WIN32" ]; then + if [ "$1" == "$TARGET_WIN" ]; then # backup MinGW compiler settings CC_MINGW=$CC CXX_MINGW=$CXX @@ -699,7 +648,7 @@ build_starsphere() export CXX=`which g++` fi make $2 >> $LOGFILE 2>&1 || failure - if [ "$1" == "$TARGET_WIN32" ]; then + if [ "$1" == "$TARGET_WIN" ]; then # restore MinGW compiler settings export CC=$CC_MINGW export CXX=$CXX_MINGW @@ -708,7 +657,7 @@ build_starsphere() echo "Successfully built and installed Starsphere [ORC]!" | tee -a $LOGFILE # set main include directory - if [ "$1" == "$TARGET_WIN32" ]; then + if [ "$1" == "$TARGET_WIN" ]; then export PATH=$PATH_MINGW else export PATH=$PATH_ORG @@ -718,7 +667,7 @@ build_starsphere() export FRAMEWORK_SRC=$ROOT/src/framework || failure export FRAMEWORK_INSTALL=$ROOT/install || failure cd $ROOT/build/framework || failure - if [ "$1" == "$TARGET_WIN32" ]; then + if [ "$1" == "$TARGET_WIN" ]; then cp -f $ROOT/src/framework/Makefile.mingw Makefile >> $LOGFILE 2>&1 || failure else cp -f $ROOT/src/framework/Makefile . >> $LOGFILE 2>&1 || failure @@ -734,7 +683,7 @@ build_starsphere() cp $ROOT/src/starsphere/*.res . >> $LOGFILE 2>&1 || failure if [ "$1" == "$TARGET_MAC" ]; then cp -f $ROOT/src/starsphere/Makefile.macos Makefile >> $LOGFILE 2>&1 || failure - elif [ "$1" == "$TARGET_WIN32" ]; then + elif [ "$1" == "$TARGET_WIN" ]; then cp -f $ROOT/src/starsphere/Makefile.mingw Makefile >> $LOGFILE 2>&1 || failure else cp -f $ROOT/src/starsphere/Makefile . >> $LOGFILE 2>&1 || failure @@ -774,10 +723,9 @@ build_mac() } -build_win32() +build_win() { - # no more prepare/build steps for MinGW - # we use Debian's MinGW with GCC 4.4 support + # we use Debian's mingw-w64 set_mingw || failure build_sdl_mingw || failure @@ -785,7 +733,7 @@ build_win32() build_libxml_mingw || failure build_oglft_mingw || failure build_boinc_mingw || failure - build_starsphere $TARGET_WIN32 || failure + build_starsphere $TARGET_WIN || failure return 0 } @@ -801,7 +749,7 @@ print_usage() echo "Available targets:" echo " --linux" echo " --mac" - echo " --win32" + echo " --win" echo " --doc" echo "*************************" @@ -838,10 +786,10 @@ case "$1" in echo "Building mac (Intel) version:" | tee -a $LOGFILE check_build_state || failure ;; - "--win32") - TARGET=$TARGET_WIN32 + "--win") + TARGET=$TARGET_WIN check_last_build "$1" || failure - echo "Building win32 version:" | tee -a $LOGFILE + echo "Building windoze version:" | tee -a $LOGFILE check_build_state || failure ;; "--doc") @@ -889,10 +837,10 @@ case $TARGET in prepare_tree || failure build_mac $TARGET_MAC || failure ;; - $TARGET_WIN32) + $TARGET_WIN) check_prerequisites || failure prepare_tree || failure - build_win32 || failure + build_win || failure ;; $TARGET_DOC) doxygen Doxyfile >> $LOGFILE 2>&1 || failure diff --git a/patches/x86-mingw32-build.sh.conf.patch b/patches/x86-mingw32-build.sh.conf.patch deleted file mode 100644 index 00061f56b1658cdb187183fe8fef628ce7f736bc..0000000000000000000000000000000000000000 --- a/patches/x86-mingw32-build.sh.conf.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- x86-mingw32-build.sh.conf -+++ x86-mingw32-build.sh.conf 2009-03-13 12:08:40.000000000 +0100 -@@ -35,16 +35,16 @@ - # the `x86-mingw32-build.sh.hosts' file for the `mirror' field - # in the following URL, to establish a default download host. - # -- assume DOWNLOAD_HOST http://mirror.dl.sourceforge.net/mingw -+ assume DOWNLOAD_HOST http://mesh.dl.sourceforge.net/mingw - # - # 3) Directories to use for temporary working space, package storage, - # and ultimate compiler installation. You should adjust these to - # match your own host configuration; note that you MUST have WRITE - # permission for each directory specified. - # -- assume WORKING_DIR $HOME/tmp/mingw-3.4.5 -- assume PACKAGE_DIR $HOME/packages/mingw-3.4.5 -- assume INSTALL_DIR $HOME/mingw32 -+ assume WORKING_DIR `pwd`/../../../build/mingw -+ assume PACKAGE_DIR `pwd`/../packages -+ assume INSTALL_DIR `pwd`/../../../install - # - # 4) Package versions, from which the compiler will be built. - # -@@ -92,11 +92,11 @@ - # the corresponding package is available in the PACKAGE_DIR, or - # if it is selected for download. - # -- option GCC_LANGUAGE_OPTIONS ada -+# option GCC_LANGUAGE_OPTIONS ada - option GCC_LANGUAGE_OPTIONS c++ -- option GCC_LANGUAGE_OPTIONS f77 -- option GCC_LANGUAGE_OPTIONS java -- option GCC_LANGUAGE_OPTIONS objc -+# option GCC_LANGUAGE_OPTIONS f77 -+# option GCC_LANGUAGE_OPTIONS java -+# option GCC_LANGUAGE_OPTIONS objc - # - # 8) User preferences for configuration options. These have been - # preconfigured to match the setup of the prebuilt compiler suite, diff --git a/src/framework/Makefile.mingw b/src/framework/Makefile.mingw index d9bd874a11dcd915217cf010a79bf10a49fe189c..9a2d88405497b23622f6680b34bd4046ee868ab8 100644 --- a/src/framework/Makefile.mingw +++ b/src/framework/Makefile.mingw @@ -1,5 +1,5 @@ ########################################################################### -# Copyright (C) 2008 by Oliver Bock # +# Copyright (C) 2008-2020 by Oliver Bock # # oliver.bock[AT]aei.mpg.de # # # # This file is part of Einstein@Home. # @@ -24,14 +24,13 @@ FRAMEWORK_INSTALL?=$(PWD) # config values CXX?=g++ -TARGET_HOST?=i586-pc-mingw32 +TARGET_HOST?=x86_64-w64-mingw32 # variables CPPFLAGS += $(shell $(FRAMEWORK_INSTALL)/bin/sdl2-config --cflags) CPPFLAGS += $(shell $(FRAMEWORK_INSTALL)/bin/freetype-config --cflags) CPPFLAGS += $(shell $(FRAMEWORK_INSTALL)/bin/xml2-config --cflags) CPPFLAGS += -I$(FRAMEWORK_INSTALL)/include/boinc -I$(FRAMEWORK_INSTALL)/include -CPPFLAGS += -D_WIN32_WINDOWS=0x0410 DEPS = Makefile OBJS = AbstractGraphicsEngine.o GraphicsEngineFactory.o WindowManager.o Resource.o ResourceFactory.o BOINCClientAdapter.o Libxml2Adapter.o diff --git a/src/starsphere/Makefile.mingw b/src/starsphere/Makefile.mingw index 05842e8c52bc6081886ab51cdcecdd3c7b9e717d..eb2098626010557e32104e682e7854f2032a5ee4 100644 --- a/src/starsphere/Makefile.mingw +++ b/src/starsphere/Makefile.mingw @@ -1,5 +1,5 @@ ########################################################################### -# Copyright (C) 2008 by Oliver Bock # +# Copyright (C) 2008-2020 by Oliver Bock # # oliver.bock[AT]aei.mpg.de # # # # This file is part of Einstein@Home. # @@ -24,14 +24,13 @@ STARSPHERE_INSTALL?=$(PWD) # config values CXX ?= g++ -TARGET_HOST ?= i586-pc-mingw32 +TARGET_HOST ?= x86_64-w64-mingw32 # variables LIBS += -Wl,-Bstatic 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_graphics2 -lboinc_api -lboinc LIBS += -Wl,-Bdynamic LIBS += $(shell $(STARSPHERE_INSTALL)/bin/sdl2-config --static-libs) @@ -44,7 +43,6 @@ CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/sdl2-config --cflags) CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --cflags) CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/xml2-config --cflags) CPPFLAGS += -I$(STARSPHERE_INSTALL)/include/boinc -CPPFLAGS += -D_WIN32_WINDOWS=0x0410 DEPS = Makefile OBJS = Starsphere.o StarsphereS5R3.o StarsphereRadio.o EinsteinS5R3Adapter.o EinsteinRadioAdapter.o starlist.o snr_list.o pulsar_list.o $(RESOURCESPEC).o $(RESOURCESPEC)_mingw.o @@ -71,10 +69,10 @@ callgrind: CPPFLAGS += $(DEBUGFLAGSCPP) -D DEBUG_VALGRIND # file based targets starsphere_Einstein_LVC: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS) - $(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o "graphics_app=einstein_RUNLABEL_VERSION_graphics_windows_intelx86.exe" $(OBJS) $(LIBS) + $(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o "graphics_app=einstein_RUNLABEL_VERSION_graphics_windows_intelx86_64.exe" $(OBJS) $(LIBS) starsphere_Einstein_ABP: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS) - $(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o "graphics_app=einsteinbinary_RUNLABEL_VERSION_graphics_windows_intelx86.exe" $(OBJS) $(LIBS) + $(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o "graphics_app=einsteinbinary_RUNLABEL_VERSION_graphics_windows_intelx86_64.exe" $(OBJS) $(LIBS) Starsphere.o: $(DEPS) $(STARSPHERE_SRC)/Starsphere.cpp $(STARSPHERE_SRC)/Starsphere.h $(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/Starsphere.cpp