diff --git a/.gitignore b/.gitignore index c83e293..00a6af0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,14 @@ *.o *.qm build/ -Makefile +debug/ +release/ +Makefile* qrc_bitcoin.cpp gostcoin-qt gostcoind -*.pro.user \ No newline at end of file +*.pro.user +.qmake.stash +gostcoin-qt_plugin_import.cpp +object_script.gostcoin-qt.Debug +object_script.gostcoin-qt.Release diff --git a/gostcoin-qt.pro b/gostcoin-qt.pro index 9f4beff..3f8bd87 100644 --- a/gostcoin-qt.pro +++ b/gostcoin-qt.pro @@ -34,6 +34,9 @@ contains(RELEASE, 1) { # Linux: static link and extra security (see: https://wiki.debian.org/Hardening) LIBS += -Wl,-Bstatic -Wl,-z,relro -Wl,-z,now } + win32 { + QMAKE_LFLAGS += -Wl,-Bstatic + } } !win32 { @@ -51,6 +54,7 @@ win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat win32:QMAKE_LFLAGS *= -Wl,--large-address-aware # i686-w64-mingw32 win32:QMAKE_LFLAGS *= -static-libgcc -static-libstdc++ +win32:LIBS *= -lstdc++ -lpthread # use: qmake "USE_QRCODE=1" # libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support @@ -178,7 +182,7 @@ HEADERS += src/qt/bitcoingui.h \ src/json/json_spirit_reader.h \ src/json/json_spirit_error_position.h \ src/json/json_spirit.h \ - i2psam/i2psam.h \ + i2psam/i2psam.h \ src/qt/clientmodel.h \ src/qt/guiutil.h \ src/qt/transactionrecord.h \ @@ -212,7 +216,7 @@ HEADERS += src/qt/bitcoingui.h \ src/ui_interface.h \ src/qt/rpcconsole.h \ src/i2p.h \ - src/Gost.h \ + src/Gost.h \ src/version.h \ src/netbase.h \ src/clientversion.h \ @@ -292,7 +296,7 @@ SOURCES += src/qt/gostcoin.cpp \ src/qt/paymentserver.cpp \ src/qt/rpcconsole.cpp \ src/i2p.cpp \ - src/Gost.cpp \ + src/Gost.cpp \ src/noui.cpp \ src/leveldb.cpp \ src/txdb.cpp \ @@ -300,7 +304,7 @@ SOURCES += src/qt/gostcoin.cpp \ src/qt/showi2paddresses.cpp \ src/qt/i2poptionswidget.cpp \ src/qt/setupdarknet.cpp \ - i2psam/i2psam.cpp + i2psam/i2psam.cpp RESOURCES += src/qt/bitcoin.qrc @@ -379,7 +383,7 @@ OTHER_FILES += README.md \ # platform specific defaults, if not overridden on command line isEmpty(BOOST_LIB_SUFFIX) { macx:BOOST_LIB_SUFFIX = -mt - win32:BOOST_LIB_SUFFIX = -mgw44-mt-s-1_50 + win32:BOOST_LIB_SUFFIX = -mt } isEmpty(BOOST_THREAD_LIB_SUFFIX) { @@ -400,10 +404,12 @@ isEmpty(BDB_INCLUDE_PATH) { isEmpty(BOOST_LIB_PATH) { macx:BOOST_LIB_PATH = /opt/local/lib + win32:BOOST_LIB_PATH = /mingw32/lib } isEmpty(BOOST_INCLUDE_PATH) { macx:BOOST_INCLUDE_PATH = /opt/local/include + win32:BOOST_INCLUDE_PATH = /mingw32/include } win32:DEFINES += WIN32 @@ -440,7 +446,8 @@ macx:QMAKE_INFO_PLIST = share/qt/Info.plist # Set libraries and includes at end, to use platform-defined defaults if not overridden INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,) -LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX -lz -ldl +LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX -lz +!win32:LIBS += -ldl # -lgdi32 has to happen after -lcrypto (see #681) win32:LIBS += -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32 LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX diff --git a/src/makefile.mingw b/src/makefile.mingw index a1bab98..f0f1650 100644 --- a/src/makefile.mingw +++ b/src/makefile.mingw @@ -19,6 +19,7 @@ CXX ?= g++ USE_UPNP:=- USE_IPV6:=1 +USE_DEBUG:=no DEPSDIR?=/usr/local BOOST_SUFFIX?=-mt @@ -46,11 +47,15 @@ LIBS= \ -l crypto \ -l i2psam -DEFS=-D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DEBUGFLAGS=-g +DEFS=-D_MT -DWIN32 -D_WINDOWS -DWIN32_LEAN_AND_MEAN -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE + +ifneq (${USE_DEBUG}, no) + DEBUGFLAGS=-g +endif + CFLAGS=-mthreads -O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) # enable: ASLR, DEP and large address aware -LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware +LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware -Wl,-Bstatic -Wl,-rpath,/usr/local/lib -L/usr/local/lib -static-libgcc -static-libstdc++ TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data) @@ -66,7 +71,7 @@ ifneq (${USE_IPV6}, -) DEFS += -DUSE_IPV6=$(USE_IPV6) endif -LIBS += -l mingwthrd -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l mswsock -l shlwapi +LIBS += -l stdc++ -l mingwthrd -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l mswsock -l shlwapi -l pthread # I2P Support DEFS += -DUSE_NATIVE_I2P -I"../i2psam" diff --git a/src/net.cpp b/src/net.cpp index 9d6f20e..3c82892 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1245,7 +1245,7 @@ void ThreadMapPort() #else /* miniupnpc 1.6 */ int error = 0; - devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error); + devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, 2, &error); #endif struct UPNPUrls urls;