diff --git a/src/libretroshare.pro b/src/libretroshare.pro index c2604fa4a..fa9491c63 100644 --- a/src/libretroshare.pro +++ b/src/libretroshare.pro @@ -2,30 +2,17 @@ TEMPLATE = lib CONFIG += staticlib -CONFIG += create_prl CONFIG -= qt TARGET = retroshare TARGET_PRL = libretroshare DESTDIR = lib -#CONFIG += dsdv - -retrotor { - DEFINES *= RETROTOR - CONFIG -= bitdht -} else { - CONFIG += bitdht -} +!include("use_libretroshare.pri"):error("Including") # the dht stunner is used to obtain RS external ip addr. when it is natted # this system is unreliable and rs supports a newer and better one (asking connected peers) # CONFIG += useDhtStunner -profiling { - QMAKE_CXXFLAGS -= -fomit-frame-pointer - QMAKE_CXXFLAGS *= -pg -g -fno-omit-frame-pointer -} - # treat warnings as error for better removing #QMAKE_CFLAGS += -Werror #QMAKE_CXXFLAGS += -Werror @@ -203,21 +190,11 @@ linux-* { PKGCONFIG *= libssl libupnp PKGCONFIG *= libcrypto zlib - LIBS *= -lpthread -ldl -} + no_sqlcipher:PKGCONFIG *= sqlite3 + LIBS *= -ldl -linux-* { DEFINES *= PLUGIN_DIR=\"\\\"$${PLUGIN_DIR}\\\"\" DEFINES *= DATA_DIR=\"\\\"$${DATA_DIR}\\\"\" - - ## where to put the librarys interface - #include_rsiface.path = "$${INC_DIR}" - #include_rsiface.files = $$PUBLIC_HEADERS - #INSTALLS += include_rsiface - - ## where to put the shared library itself - #target.path = "$$LIB_DIR" - #INSTALLS *= target } linux-g++ { @@ -234,7 +211,7 @@ version_detail_bash_script { PRE_TARGETDEPS = write_version_detail write_version_detail.commands = $$PWD/version_detail.sh } - win32 { + win32-* { QMAKE_EXTRA_TARGETS += write_version_detail PRE_TARGETDEPS = write_version_detail write_version_detail.commands = $$PWD/version_detail.bat @@ -263,13 +240,11 @@ win32-x-g++ { } ################################# Windows ########################################## -win32 { +win32-g++ { QMAKE_CC = $${QMAKE_CXX} OBJECTS_DIR = temp/obj MOC_DIR = temp/moc - DEFINES *= WINDOWS_SYS WIN32 STATICLIB MINGW WIN32_LEAN_AND_MEAN _USE_32BIT_TIME_T - # This defines the platform to be WinXP or later and is needed for getaddrinfo (_WIN32_WINNT_WINXP) - DEFINES *= WINVER=0x0501 + DEFINES *= STATICLIB # Switch on extra warnings QMAKE_CFLAGS += -Wextra @@ -289,15 +264,8 @@ win32 { CONFIG += upnp_miniupnpc - no_sqlcipher { - PKGCONFIG *= sqlite3 - LIBS += -lsqlite3 - } else { - LIBS += -lsqlcipher - } - - DEPENDPATH += . $$INC_DIR - INCLUDEPATH += . $$INC_DIR + wLibs = ws2_32 gdi32 uuid iphlpapi crypt32 ole32 winmm + LIBS += $$linkDynamicLibs(wLibs) } ################################# MacOSX ########################################## @@ -697,13 +665,16 @@ SOURCES += util/folderiterator.cc \ util/rsrecogn.cc \ util/rstime.cc - -upnp_miniupnpc { - HEADERS += upnp/upnputil.h upnp/upnphandler_miniupnp.h - SOURCES += upnp/upnputil.c upnp/upnphandler_miniupnp.cc +## Added for retrocompatibility remove ASAP +isEmpty(RS_UPNP_LIB) { + upnp_miniupnpc:RS_UPNP_LIB=miniupnpc + upnp_libupnp:RS_UPNP_LIB="upnp ixml threadutil" } -upnp_libupnp { +equals(RS_UPNP_LIB, miniupnpc) { + HEADERS += upnp/upnputil.h upnp/upnphandler_miniupnp.h + SOURCES += upnp/upnputil.c upnp/upnphandler_miniupnp.cc +} else { HEADERS += upnp/UPnPBase.h upnp/upnphandler_linux.h SOURCES += upnp/UPnPBase.cpp upnp/upnphandler_linux.cc DEFINES *= RS_USE_LIBUPNP @@ -934,19 +905,13 @@ android-* { DEFINES *= "fopen64=fopen" DEFINES *= "fseeko64=fseeko" DEFINES *= "ftello64=ftello" - LIBS *= -lbz2 -lupnp -lixml -lthreadutil -lsqlite3 -## Static library are verysensible to order in command line, has to be in the -## end of file for this reason +## Static library are very susceptible to order in command line + sLibs = bz2 $$RS_UPNP_LIB $$RS_SQL_LIB ssl crypto - LIBS += -L$$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/lib/ -lsqlcipher - PRE_TARGETDEPS += $$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/lib/libsqlcipher.a - - LIBS += -L$$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/lib/ -lssl - PRE_TARGETDEPS += $$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/lib/libssl.a - - LIBS += -L$$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/lib/ -lcrypto - PRE_TARGETDEPS += $$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/lib/libcrypto.a + LIBS += $$linkStaticLibs(sLibs) + PRE_TARGETDEPS += $$pretargetStaticLibs(sLibs) HEADERS += util/androiddebug.h } + diff --git a/src/use_libretroshare.pri b/src/use_libretroshare.pri new file mode 100644 index 000000000..d17e36739 --- /dev/null +++ b/src/use_libretroshare.pri @@ -0,0 +1,33 @@ +DEPENDPATH *= $$system_path($$clean_path($${PWD}/../../libretroshare/src/)) +INCLUDEPATH *= $$system_path($$clean_path($${PWD}/../../libretroshare/src)) +LIBS *= -L$$system_path($$clean_path($${OUT_PWD}/../../libretroshare/src/lib/)) -lretroshare + +equals(TARGET, retroshare):equals(TEMPLATE, lib){ +} else { + PRE_TARGETDEPS *= $$system_path($$clean_path($$OUT_PWD/../../libretroshare/src/lib/libretroshare.a)) +} + +!include("../../openpgpsdk/src/use_openpgpsdk.pri"):error("Including") + +bitdht { + !include("../../libbitdht/src/use_libbitdht.pri"):error("Including") +} + +sLibs = +mLibs = $$RS_SQL_LIB ssl crypto $$RS_THREAD_LIB $$RS_UPNP_LIB +dLibs = + +linux-* { + mLibs += dl +} + +static { + sLibs *= $$mLibs +} else { + dLibs *= $$mLibs +} + +LIBS += $$linkStaticLibs(sLibs) +PRE_TARGETDEPS += $$pretargetStaticLibs(sLibs) + +LIBS += $$linkDynamicLibs(dLibs) diff --git a/tests/unittests/unittests.pro b/tests/unittests/unittests.pro index 790ab1c6d..c17be5b77 100644 --- a/tests/unittests/unittests.pro +++ b/tests/unittests/unittests.pro @@ -1,6 +1,6 @@ !include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri") -QT += network xml script +QT += network xml CONFIG += bitdht CONFIG += gxs debug