From 79d761ae2efb54396bb5ee88a238936e4f5ea1ff Mon Sep 17 00:00:00 2001 From: Phenom Date: Wed, 23 Sep 2015 18:25:03 +0200 Subject: [PATCH] Add Win32 section in retroshare.pri And add MSys2 directories. --- libresapi/src/libresapi.pro | 2 +- libretroshare/src/libretroshare.pro | 6 ++---- libretroshare/src/upnp/upnputil.h | 6 +++--- openpgpsdk/src/openpgpsdk.pro | 6 ++---- plugins/Common/retroshare_plugin.pri | 14 +++++++------- plugins/FeedReader/FeedReader.pro | 6 ++++++ retroshare-gui/src/retroshare-gui.pro | 15 +++++---------- retroshare-nogui/src/retroshare-nogui.pro | 10 ++++------ retroshare.pri | 18 ++++++++++++++++++ 9 files changed, 48 insertions(+), 35 deletions(-) diff --git a/libresapi/src/libresapi.pro b/libresapi/src/libresapi.pro index d814219db..08dbfc6ac 100644 --- a/libresapi/src/libresapi.pro +++ b/libresapi/src/libresapi.pro @@ -24,7 +24,7 @@ unix { win32{ DEFINES *= WINDOWS_SYS - INCLUDEPATH += $$PWD/../../../libs/include + INCLUDEPATH += . $$INC_DIR } libmicrohttpd{ diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index 9c0ee33e6..8cb5e742c 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -253,10 +253,8 @@ win32 { LIBS += -lsqlcipher - LIBS_DIR = $$PWD/../../../libs - - DEPENDPATH += . $$LIBS_DIR/include $$LIBS_DIR/include/miniupnpc - INCLUDEPATH += . $$LIBS_DIR/include $$LIBS_DIR/include/miniupnpc + DEPENDPATH += . $$INC_DIR + INCLUDEPATH += . $$INC_DIR } ################################# MacOSX ########################################## diff --git a/libretroshare/src/upnp/upnputil.h b/libretroshare/src/upnp/upnputil.h index 64dca304a..b1bfe6e51 100644 --- a/libretroshare/src/upnp/upnputil.h +++ b/libretroshare/src/upnp/upnputil.h @@ -17,9 +17,9 @@ #include #define snprintf _snprintf #endif -#include -#include -#include +#include +#include +#include /* Ensure linking names are okay on OSX platform. (C interface) */ diff --git a/openpgpsdk/src/openpgpsdk.pro b/openpgpsdk/src/openpgpsdk.pro index f54f5d7f8..2cee7847d 100644 --- a/openpgpsdk/src/openpgpsdk.pro +++ b/openpgpsdk/src/openpgpsdk.pro @@ -35,10 +35,8 @@ win32 { #QMAKE_CXXFLAGS_DEBUG += -O2 #QMAKE_CFLAGS_DEBUG += -O2 - LIBS_DIR = $$PWD/../../../libs - - DEPENDPATH += $$LIBS_DIR/include - INCLUDEPATH += $$LIBS_DIR/include + DEPENDPATH += $$INC_DIR + INCLUDEPATH += $$INC_DIR } # Input diff --git a/plugins/Common/retroshare_plugin.pri b/plugins/Common/retroshare_plugin.pri index d9a03cdc6..8a5e332b2 100644 --- a/plugins/Common/retroshare_plugin.pri +++ b/plugins/Common/retroshare_plugin.pri @@ -37,7 +37,7 @@ win32 { UI_DIR = temp/ui DEFINES += WINDOWS_SYS WIN32 STATICLIB MINGW WIN32_LEAN_AND_MEAN _USE_32BIT_TIME_T - DEFINES += MINIUPNPC_VERSION=13 + #DEFINES += MINIUPNPC_VERSION=13 # DESTDIR = lib # Switch off optimization for release version @@ -53,16 +53,16 @@ win32 { DEFINES += USE_CMD_ARGS #miniupnp implementation files - HEADERS += upnp/upnputil.h - SOURCES += upnp/upnputil.c + #HEADERS += upnp/upnputil.h + #SOURCES += upnp/upnputil.c - LIBS_DIR = $$PWD/../../../libs - - INCLUDEPATH += . $$LIBS_DIR/include $$LIBS_DIR/include/miniupnpc + DEPENDPATH += . $$INC_DIR + INCLUDEPATH += . $$INC_DIR PRE_TARGETDEPS += ../../retroshare-gui/src/lib/libretroshare-gui.a LIBS += -L"../../retroshare-gui/src/lib" -lretroshare-gui - LIBS += -L"$$LIBS_DIR/lib" + for(lib, LIB_DIR):LIBS += -L"$$lib" + for(bin, BIN_DIR):LIBS += -L"$$bin" LIBS += -lpthread } diff --git a/plugins/FeedReader/FeedReader.pro b/plugins/FeedReader/FeedReader.pro index 4ecc10352..34fb2f794 100644 --- a/plugins/FeedReader/FeedReader.pro +++ b/plugins/FeedReader/FeedReader.pro @@ -91,6 +91,12 @@ win32 { #Have to reorder libs, else got /libs/lib/libcrypto.a(bio_lib.o):bio_lib.c:(.text+0x0): multiple definition of `BIO_new' LIBS = -lcurl -lxml2 -lz -lxslt -lws2_32 -lwldap32 -lssl -lcrypto -lgdi32 $${LIBS} + exists(C:/msys64/mingw32/include) { + message(msys2 xml2 is installed.) + INC_DIR += "C:/msys64/mingw32/include/libxml2" + } + DEPENDPATH += . $$INC_DIR + INCLUDEPATH += . $$INC_DIR } openbsd-* { diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index cd4a57ceb..f5c3c33a6 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -174,14 +174,12 @@ win32 { #LIBS += -L"D/Qt/2009.03/qt/plugins/imageformats" #QTPLUGIN += qjpeg - LIBS_DIR = $$PWD/../../../libs - - LIBS += -L"$$LIBS_DIR/lib" - LIBS += -L"$$LIBS_DIR/bin" + for(lib, LIB_DIR):LIBS += -L"$$lib" + for(bin, BIN_DIR):LIBS += -L"$$bin" LIBS += -lssl -lcrypto -lpthread -lminiupnpc -lz -lws2_32 LIBS += -luuid -lole32 -liphlpapi -lcrypt32 -lgdi32 - LIBS += -lole32 -lwinmm + LIBS += -lwinmm RC_FILE = gui/images/retroshare_win.rc # export symbols for the plugins @@ -192,11 +190,8 @@ win32 { DEFINES *= WINDOWS_SYS WIN32_LEAN_AND_MEAN _USE_32BIT_TIME_T - DEPENDPATH += . - INCLUDEPATH += . - - DEPENDPATH += $$LIBS_DIR/include - INCLUDEPATH += $$LIBS_DIR/include + DEPENDPATH += . $$INC_DIR + INCLUDEPATH += . $$INC_DIR greaterThan(QT_MAJOR_VERSION, 4) { # Qt 5 diff --git a/retroshare-nogui/src/retroshare-nogui.pro b/retroshare-nogui/src/retroshare-nogui.pro index 043933278..718992cbc 100644 --- a/retroshare-nogui/src/retroshare-nogui.pro +++ b/retroshare-nogui/src/retroshare-nogui.pro @@ -72,22 +72,20 @@ win32 { # solve linker warnings because of the order of the libraries QMAKE_LFLAGS += -Wl,--start-group - LIBS_DIR = $$PWD/../../../libs - - LIBS += -L"$$LIBS_DIR/lib" + for(lib, LIB_DIR):LIBS += -L"$$lib" LIBS += -lssl -lcrypto -lpthread -lminiupnpc -lz LIBS += -lcrypto -lws2_32 -lgdi32 LIBS += -luuid -lole32 -liphlpapi -lcrypt32 LIBS += -lole32 -lwinmm - PROTOCPATH=$$LIBS_DIR/bin/ + PROTOCPATH=$$BIN_DIR RC_FILE = resources/retroshare_win.rc DEFINES *= WINDOWS_SYS _USE_32BIT_TIME_T - DEPENDPATH += $$LIBS_DIR/include - INCLUDEPATH += $$LIBS_DIR/include + DEPENDPATH += . $$INC_DIR + INCLUDEPATH += . $$INC_DIR } ##################################### MacOS ###################################### diff --git a/retroshare.pri b/retroshare.pri index 6e2ea0c9e..8a1f5fa3e 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -10,6 +10,24 @@ unix { isEmpty(PLUGIN_DIR) { PLUGIN_DIR = "$${LIB_DIR}/retroshare/extensions6" } } +win32 { + message(***retroshare.pri:Win32) + exists($$PWD/../libs) { + message(Get pre-compiled libraries.) + isEmpty(PREFIX) { PREFIX = "$$PWD/../libs" } + isEmpty(BIN_DIR) { BIN_DIR = "$${PREFIX}/bin" } + isEmpty(INC_DIR) { INC_DIR = "$${PREFIX}/include" } + isEmpty(LIB_DIR) { LIB_DIR = "$${PREFIX}/lib" } + } + exists(C:/msys64/mingw32/include) { + message(msys2 is installed.) + PREFIX_MSYS2 = "C:/msys64/mingw32" + BIN_DIR += "$${PREFIX_MSYS2}/bin" + INC_DIR += "$${PREFIX_MSYS2}/include" + LIB_DIR += "$${PREFIX_MSYS2}/lib" + } +} + unfinished { CONFIG += gxscircles CONFIG += gxsthewire