2018-05-21 12:23:52 -04:00
################################################################################
# retroshare.pri #
2019-09-10 11:10:26 -04:00
# Copyright (C) 2004-2019, Retroshare Team <contact@retroshare.cc> #
# Copyright (C) 2016-2019, Gioacchino Mazzurco <gio@eigenlab.org> #
2018-05-21 12:23:52 -04:00
# #
# This program is free software: you can redistribute it and/or modify #
2019-09-10 11:10:26 -04:00
# it under the terms of the GNU Lesser General Public License as #
2018-05-21 12:23:52 -04:00
# published by the Free Software Foundation, either version 3 of the #
# License, or (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
2019-09-10 11:10:26 -04:00
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
2018-05-28 16:03:39 -04:00
# GNU Lesser General Public License for more details. #
2018-05-21 12:23:52 -04:00
# #
2018-05-28 16:03:39 -04:00
# You should have received a copy of the GNU Lesser General Public License #
2019-09-10 11:10:26 -04:00
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
2018-05-21 12:23:52 -04:00
################################################################################
2018-04-15 07:41:52 -04:00
################################################################################
## Documented build options (CONFIG) goes here as all the rest depend on them ##
## CONFIG must not be edited in other .pro files, aka if CONFIG need do be #####
## programatically modified depending on platform or from CONFIG itself it #####
## can be done ONLY inside this file (retroshare.pri) ##########################
################################################################################
2016-08-02 18:48:19 -04:00
# To disable RetroShare-gui append the following
# assignation to qmake command line "CONFIG+=no_retroshare_gui"
CONFIG *= retroshare_gui
no_retroshare_gui:CONFIG -= retroshare_gui
2016-07-14 16:48:44 -04:00
2019-05-10 11:58:38 -04:00
# Enable GXS distant syncronization
2018-04-25 08:58:53 -04:00
CONFIG *= gxsdistsync
2019-10-06 07:58:10 -04:00
# To enable RetroShare-nogui append the following
# assignation to qmake command line "CONFIG+=retroshare_nogui"
2019-08-29 17:15:46 -04:00
CONFIG *= no_retroshare_nogui
retroshare_nogui:CONFIG -= no_retroshare_nogui
2016-08-02 18:48:19 -04:00
2019-10-06 07:58:10 -04:00
# To enable cmark append the following
# assignation to qmake command line "CONFIG+=rs_gui_cmark"
2019-09-05 16:21:39 -04:00
CONFIG *= no_rs_gui_cmark
rs_gui_cmark:CONFIG -= no_rs_gui_cmark
2018-07-23 11:20:13 -04:00
2018-02-20 09:56:16 -05:00
# To enable RetroShare plugins append the following
# assignation to qmake command line "CONFIG+=retroshare_plugins"
CONFIG *= no_retroshare_plugins
retroshare_plugins:CONFIG -= no_retroshare_plugins
2016-08-02 18:48:19 -04:00
# To enable RetroShare-android-service append the following assignation to
# qmake command line "CONFIG+=retroshare_android_service"
CONFIG *= no_retroshare_android_service
retroshare_android_service:CONFIG -= no_retroshare_android_service
2017-04-07 12:26:08 -04:00
# To enable RetroShare-android-notify-service append the following
# assignation to qmake command line
# "CONFIG+=retroshare_android_notify_service"
CONFIG *= no_retroshare_android_notify_service
retroshare_android_notify_service:CONFIG -= no_retroshare_android_notify_service
2016-11-10 05:45:41 -05:00
# To enable RetroShare-QML-app append the following assignation to
# qmake command line "CONFIG+=retroshare_qml_app"
CONFIG *= no_retroshare_qml_app
retroshare_qml_app:CONFIG -= no_retroshare_qml_app
2019-10-06 07:58:10 -04:00
# To disable RetroShare service append the following assignation to
# qmake command line "CONFIG+=no_retroshare_service"
2019-08-29 17:15:46 -04:00
CONFIG *= retroshare_service
2019-10-06 07:58:10 -04:00
no_retroshare_service:CONFIG -= retroshare_service
2018-09-28 18:15:10 -04:00
2019-09-05 17:06:06 -04:00
# To enable libresapi (deprecated) append the following assignation to qmake command line
2019-10-06 07:58:10 -04:00
# "CONFIG+=libresapi"
2019-08-30 15:41:34 -04:00
CONFIG+=no_libresapi
2019-09-05 17:06:06 -04:00
libresapi:CONFIG -= no_libresapi
2018-09-28 18:15:10 -04:00
2016-08-02 18:48:19 -04:00
# To enable libresapi via local socket (unix domain socket or windows named
# pipes) append the following assignation to qmake command line
2019-10-06 07:58:10 -04:00
# "CONFIG+=libresapilocalserver"
2016-08-02 18:48:19 -04:00
CONFIG *= no_libresapilocalserver
libresapilocalserver:CONFIG -= no_libresapilocalserver
2018-04-15 07:41:52 -04:00
# To enable libresapi settings handler in libresapi append the following
# assignation to qmake command line "CONFIG+=libresapi_settings"
CONFIG *= no_libresapi_settings
libresapi_settings:CONFIG -= no_libresapi_settings
2017-03-28 05:18:27 -04:00
2019-10-06 07:58:10 -04:00
# To enable libresapi via HTTP (based on libmicrohttpd) append the following
# assignation to qmake command line "CONFIG+=libresapihttpserver"
2019-09-06 16:28:15 -04:00
CONFIG *= no_libresapihttpserver
libresapihttpserver:CONFIG -= no_libresapihttpserver
2016-08-02 18:48:19 -04:00
# To disable SQLCipher support append the following assignation to qmake
# command line "CONFIG+=no_sqlcipher"
CONFIG *= sqlcipher
no_sqlcipher:CONFIG -= sqlcipher
2016-12-03 14:04:25 -05:00
# To enable autologin (this is higly discouraged as it may compromise your node
# security in multiple ways) append the following assignation to qmake command
# line "CONFIG+=rs_autologin"
CONFIG *= no_rs_autologin
rs_autologin:CONFIG -= no_rs_autologin
2017-08-20 07:17:28 -04:00
# To have only hidden node generation append the following assignation
# to qmake command line "CONFIG+=rs_onlyhiddennode"
CONFIG *= no_rs_onlyhiddennode
rs_onlyhiddennode:CONFIG -= no_rs_onlyhiddennode
2016-08-02 18:48:19 -04:00
# To disable GXS (General eXchange System) append the following
# assignation to qmake command line "CONFIG+=no_rs_gxs"
CONFIG *= rs_gxs
no_rs_gxs:CONFIG -= rs_gxs
2016-07-28 08:08:49 -04:00
2018-11-16 13:09:37 -05:00
# To disable GXS distrubuting all available posts independed of the "sync"
# settings append the following assignation to qmake command line
# "CONFIG+=no_rs_gxs_send_all"
2018-11-05 06:55:51 -05:00
CONFIG *= rs_gxs_send_all
no_rs_gxs_send_all:CONFIG -= rs_gxs_send_all
2018-11-05 05:00:32 -05:00
2017-07-17 10:04:52 -04:00
# To enable RS Deprecated Warnings append the following assignation to qmake
# command line "CONFIG+=rs_deprecatedwarning"
CONFIG *= no_rs_deprecatedwarning
rs_deprecatedwarning:CONFIG -= no_rs_deprecatedwarning
2016-12-21 16:05:57 -05:00
2017-07-17 10:04:52 -04:00
# To enable CPP #warning append the following assignation to qmake command
# line "CONFIG+=rs_cppwarning"
CONFIG *= no_rs_cppwarning
rs_cppwarning:CONFIG -= no_rs_cppwarning
2015-09-04 11:48:20 -04:00
2017-02-26 07:06:38 -05:00
# To disable GXS mail append the following assignation to qmake command line
2017-03-01 20:37:53 -05:00
# "CONFIG+=no_rs_gxs_trans"
CONFIG *= rs_gxs_trans
#no_rs_gxs_trans:CONFIG -= rs_gxs_trans ## Disabing not supported ATM
2017-01-14 17:20:42 -05:00
2017-05-30 09:43:43 -04:00
# To enable GXS based async chat append the following assignation to qmake
# command line "CONFIG+=rs_async_chat"
CONFIG *= no_rs_async_chat
rs_async_chat:CONFIG -= no_rs_async_chat
2018-12-24 06:48:03 -05:00
# To disable direct chat which has been deprecated since RetroShare 0.6.5 append
# the following assignation to qmake command line "CONFIG+=no_direct_chat"
CONFIG *= direct_chat
no_direct_chat:CONFIG -= direct_chat
2018-11-20 05:32:00 -05:00
2019-08-21 09:23:25 -04:00
# To enable messemger window which has been deprecated since RetroShare 0.6.6 append
# the following assignation to qmake command line "CONFIG+=messenger"
# CONFIG *= messenger
2018-04-15 07:41:52 -04:00
# To disable bitdht append the following assignation to qmake command line
# "CONFIG+=no_bitdht"
CONFIG *= bitdht
no_bitdht:CONFIG -= bitdht
2017-07-25 12:08:37 -04:00
# To select your MacOsX version append the following assignation to qmake
2017-12-08 13:00:34 -05:00
# command line "CONFIG+=rs_macos10.11" where 10.11 depends your version
2018-02-28 17:32:13 -05:00
macx:CONFIG *= rs_macos10.11
2017-07-25 12:08:37 -04:00
rs_macos10.8:CONFIG -= rs_macos10.11
rs_macos10.9:CONFIG -= rs_macos10.11
rs_macos10.10:CONFIG -= rs_macos10.11
rs_macos10.12:CONFIG -= rs_macos10.11
2019-01-23 07:20:05 -05:00
rs_macos10.13:CONFIG -= rs_macos10.11
2019-03-24 11:22:17 -04:00
rs_macos10.14:CONFIG -= rs_macos10.11
2017-05-30 09:43:43 -04:00
2018-06-23 11:13:38 -04:00
# To enable JSON API append the following assignation to qmake command line
# "CONFIG+=rs_jsonapi"
CONFIG *= no_rs_jsonapi
rs_jsonapi:CONFIG -= no_rs_jsonapi
2019-06-20 11:24:18 -04:00
# To enable channel indexing append the following assignation to qmake command
# line "CONFIG+=rs_deep_channel_index"
CONFIG *= no_rs_deep_channel_index
rs_deep_channel_index:CONFIG -= no_rs_deep_channel_index
2019-06-21 07:33:10 -04:00
# To enable deep files indexing append the following assignation to qmake
# command line "CONFIG+=rs_files_index"
2019-06-20 11:24:18 -04:00
CONFIG *= no_rs_deep_files_index
rs_deep_files_index:CONFIG -= no_rs_deep_files_index
2019-06-21 07:33:10 -04:00
# To enable Ogg files deep indexing append the following assignation to qmake
# command line "CONFIG+=rs_deep_files_index_ogg"
2019-06-20 11:24:18 -04:00
CONFIG *= no_rs_deep_files_index_ogg
2019-06-21 07:33:10 -04:00
rs_deep_files_index_ogg:CONFIG -= no_rs_deep_files_index_ogg
# To enable FLAC files deep indexing append the following assignation to qmake
# command line "CONFIG+=rs_deep_files_index_flac"
CONFIG *= no_rs_deep_files_index_flac
rs_deep_files_index_flac:CONFIG -= no_rs_deep_files_index_flac
# To enable taglib files deep indexing append the following assignation to qmake
# command line "CONFIG+=rs_deep_files_index_taglib"
CONFIG *= no_rs_deep_files_index_taglib
rs_deep_files_index_taglib:CONFIG -= no_rs_deep_files_index_taglib
2018-06-23 11:13:38 -04:00
2019-02-04 08:49:09 -05:00
# To enable native dialogs append the following assignation to qmake command
2019-04-11 20:53:39 -04:00
# line "CONFIG+=rs_use_native_dialogs"
2019-02-04 08:49:09 -05:00
CONFIG *= no_rs_use_native_dialogs
rs_use_native_dialogs:CONFIG -= no_rs_use_native_dialogs
2019-09-10 11:10:26 -04:00
# To disable broadcast discovery append the following assignation to qmake
2019-04-11 20:53:39 -04:00
# command line "CONFIG+=no_rs_broadcast_discovery"
CONFIG *= rs_broadcast_discovery
no_rs_broadcast_discovery:CONFIG -= rs_broadcast_discovery
2019-11-10 11:38:16 -05:00
# To disable webui append the following assignation to qmake
# command line "CONFIG+=rs_no_webui"
CONFIG *= rs_webui
rs_no_webui:CONFIG -= rs_webui
2019-09-10 11:10:26 -04:00
# To enable webui append the following assignation to qmake
# command line "CONFIG+=rs_service_webui_terminal_password"
2019-11-17 07:23:08 -05:00
CONFIG *= rs_service_webui_terminal_password
no_rs_service_webui_terminal_password:CONFIG -= rs_service_webui_terminal_password
2019-09-10 11:10:26 -04:00
# To enable retroshare-service terminal login append the following assignation
# to qmake command line "CONFIG+=rs_service_terminal_login"
2019-11-17 07:23:08 -05:00
CONFIG *= rs_service_terminal_login
no_rs_service_terminal_login:CONFIG -= rs_service_terminal_login
2019-09-10 11:10:26 -04:00
2018-09-28 18:15:10 -04:00
# Specify host precompiled jsonapi-generator path, appending the following
# assignation to qmake command line
# 'JSONAPI_GENERATOR_EXE=/myBuildDir/jsonapi-generator'. Required for JSON API
# cross-compiling
#JSONAPI_GENERATOR_EXE=/myBuildDir/jsonapi-generator
2018-12-18 15:25:46 -05:00
# Specify RetroShare major version (must be a number) appending the following
# assignation to qmake command line 'RS_MAJOR_VERSION=0'
2018-09-11 18:33:29 -04:00
#RS_MAJOR_VERSION=0
2018-12-18 15:25:46 -05:00
# Specify RetroShare minor version (must be a number) appending the following
# assignation to qmake command line 'RS_MINOR_VERSION=6'
2018-09-11 18:33:29 -04:00
#RS_MINOR_VERSION=6
2018-12-18 15:25:46 -05:00
# Specify RetroShare mini version (must be a number) appending the following
# assignation to qmake command line 'RS_MINI_VERSION=4'
2018-09-11 18:33:29 -04:00
#RS_MINI_VERSION=4
2018-12-18 15:25:46 -05:00
# Specify RetroShare extra version (must be a string) appending the following
# assignation to qmake command line 'RS_EXTRA_VERSION=""'
2018-09-11 18:33:29 -04:00
#RS_EXTRA_VERSION=git
2019-02-10 09:46:17 -05:00
# Specify threading library to use appending the following assignation to qmake
# commandline 'RS_THREAD_LIB=pthread' the name of the multi threading library to
# use (pthread, "") usually depends on platform.
isEmpty(RS_THREAD_LIB):RS_THREAD_LIB = pthread
2019-04-24 12:08:35 -04:00
# Specify UPnP library to use, appending the following assignation to qmake
# command line
# 'RS_UPNP_LIB=none' do not compile UPnP support
# 'RS_UPNP_LIB=miniupnpc' to use miniupnpc
# 'RS_UPNP_LIB="upnp ixml threadutil"' to use libupnp-1.6.x
# 'RS_UPNP_LIB="upnp ixml"' to use libupnp-1.8.x
# Which library is better suited usually depends on the platform.
# See http://miniupnp.free.fr/ and http://pupnp.sourceforge.net/ for more
# information about the libraries. Autodetection is attempted by default.
#RS_UPNP_LIB=
2019-02-10 09:46:17 -05:00
2018-04-15 07:41:52 -04:00
###########################################################################################################################################################
#
# V07_NON_BACKWARD_COMPATIBLE_CHANGE_001:
#
# What: Computes the node id by performing a sha256 hash of the certificate's PGP signature, instead of simply picking up the last 20 bytes of it.
#
# Why: There is no real risk in forging a certificate with the same ID as the authentication is performed over the PGP signature of the certificate
# which hashes the full SSL certificate (i.e. the full serialized CERT_INFO structure). However the possibility to
# create two certificates with the same IDs is a problem, as it can be used to cause disturbance in the software.
#
# Backward compat: connexions impossible with non patched peers older than Nov 2017, probably because the SSL id that is computed is not the same on both side,
# and in particular unpatched peers see a cerficate with ID different (because computed with the old method) than the ID that was
# submitted when making friends.
#
# Note: the advantage of basing the ID on the signature rather than the public key is not very clear, given that the signature is based on a hash
# of the public key (and the rest of the certificate info).
#
# V07_NON_BACKWARD_COMPATIBLE_CHANGE_002:
#
# What: Use RSA+SHA256 instead of RSA+SHA1 for PGP certificate signatures
#
# Why: Sha1 is likely to be prone to primary collisions anytime soon, so it is urgent to turn to a more secure solution.
#
# Backward compat: unpatched peers after Nov 2017 are able to verify signatures since openpgp-sdk already handle it.
#
# V07_NON_BACKWARD_COMPATIBLE_CHANGE_003:
#
2019-04-12 15:29:49 -04:00
# What: Do not hash PGP certificate twice when signing
2018-04-15 07:41:52 -04:00
#
# Why: hasing twice is not per se a security issue, but it makes it harder to change the settings for hashing.
#
# Backward compat: patched peers cannot connect to non patched peers older than Nov 2017.
2019-04-12 15:29:49 -04:00
#
# V07_NON_BACKWARD_COMPATIBLE_CHANGE_004:
#
# What: Do not probe that GXS tunnels accept fast items. Just assume they do.
# Why: Avoids sending probe packets
# BackwardCompat: old RS before Mai 2019 will not be able to distant chat.
#
2018-04-15 07:41:52 -04:00
###########################################################################################################################################################
2017-01-14 17:20:42 -05:00
2018-04-15 07:41:52 -04:00
#CONFIG += rs_v07_changes
rs_v07_changes {
DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_001
DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_002
DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_003
2019-04-12 15:29:49 -04:00
DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_004
2019-02-14 16:52:35 -05:00
DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_UNNAMED
2018-04-15 07:41:52 -04:00
}
2016-12-03 14:04:25 -05:00
2018-04-15 07:41:52 -04:00
################################################################################
2018-06-23 11:13:38 -04:00
## RetroShare qmake functions goes here as all the rest may use them. ##########
2018-04-15 07:41:52 -04:00
################################################################################
2018-05-16 04:38:47 -04:00
## Qt versions older the 5 are not supported anymore, check if the user is
## attempting use them and fail accordingly with a proper error message
lessThan(QT_MAJOR_VERSION, 5) {
error(Qt 5.0.0 or newer is needed to build RetroShare)
}
2018-04-15 07:41:52 -04:00
## This function is useful to look for the location of a file in a list of paths
## like the which command on linux, first paramether is the file name,
## second parameter is the name of a variable containing the list of folders
## where to look for. First match is returned.
defineReplace(findFileInPath) {
fileName=$$1
pathList=$$2
for(mDir, $$pathList) {
attempt = $$clean_path($$mDir/$$fileName)
exists($$attempt) {
return($$system_path($$attempt))
2016-12-03 14:04:25 -05:00
}
}
2018-04-15 07:41:52 -04:00
return()
2015-08-31 11:55:30 -04:00
}
2015-09-04 11:43:52 -04:00
2018-04-15 07:41:52 -04:00
## This function return linker option to link statically the libraries contained
## in the variable given as paramether.
## Be carefull static library are very susceptible to order
defineReplace(linkStaticLibs) {
libsVarName = $$1
retSlib =
for(mLib, $$libsVarName) {
attemptPath=$$findFileInPath(lib$${mLib}.a, QMAKE_LIBDIR)
isEmpty(attemptPath):error(lib$${mLib}.a not found in [$${QMAKE_LIBDIR}])
retSlib += -L$$dirname(attemptPath) -l$$mLib
2017-04-07 12:26:08 -04:00
}
2018-04-15 07:41:52 -04:00
return($$retSlib)
2016-07-28 08:08:49 -04:00
}
2019-04-24 12:08:35 -04:00
## This function return pretarget deps for the static libraries contained in
2018-04-15 07:41:52 -04:00
## the variable given as paramether.
defineReplace(pretargetStaticLibs) {
libsVarName = $$1
2016-08-14 08:11:01 -04:00
2018-04-15 07:41:52 -04:00
retPreTarget =
2015-09-23 12:25:03 -04:00
2018-04-15 07:41:52 -04:00
for(mLib, $$libsVarName) {
attemptPath=$$findFileInPath(lib$${mLib}.a, QMAKE_LIBDIR)
isEmpty(attemptPath):error(lib$${mLib}.a not found in [$${QMAKE_LIBDIR}])
2017-07-25 12:08:37 -04:00
2018-04-15 07:41:52 -04:00
retPreTarget += $$attemptPath
}
2017-07-25 12:08:37 -04:00
2018-04-15 07:41:52 -04:00
return($$retPreTarget)
}
2017-07-25 12:08:37 -04:00
2018-04-15 07:41:52 -04:00
## This function return linker option to link dynamically the libraries
## contained in the variable given as paramether.
defineReplace(linkDynamicLibs) {
libsVarName = $$1
retDlib =
2017-07-25 12:08:37 -04:00
2018-04-15 07:41:52 -04:00
for(mLib, $$libsVarName) {
retDlib += -l$$mLib
}
2017-07-25 12:08:37 -04:00
2018-04-15 07:41:52 -04:00
return($$retDlib)
2015-12-21 11:25:02 -05:00
}
2019-04-15 07:34:27 -04:00
## On some environements qmake chose a C++ compiler as C compiler, this breaks
## some sub targets, such as those based on cmake which test for chosen C
## compiler to be a proper C compiler. This function try to deduce the correct C
## compiler also in those cases, and return it. So you can use
## $$fixQmakeCC($$QMAKE_CC) in those cases instead of plain $$QMAKE_CC
defineReplace(fixQmakeCC) {
retVal = $$1
contains(1, .*\+\+$):retVal=$$str_member($$1, 0 ,-3)
contains(1, .*g\+\+$):retVal=$$str_member($$1, 0 ,-3)cc
2019-04-24 12:58:09 -04:00
contains(1, .*g\+\+-[0-9]$):retVal=$$str_member($$1, 0 ,-5)cc$$str_member($$1, -2 ,-1)
2019-04-15 07:34:27 -04:00
contains(1, .*clang\+\+$):retVal=$$str_member($$1, 0 ,-3)
return($$retVal)
}
2018-04-15 07:41:52 -04:00
################################################################################
2018-05-16 04:38:47 -04:00
## Statements and variables that depends on build options (CONFIG) goes here ###
2018-04-15 07:41:52 -04:00
################################################################################
##
## Defining the following variables may be needed depending on platform and
## build options (CONFIG)
##
## PREFIX String variable containing the directory considered as prefix set
## with = operator.
## QMAKE_LIBDIR, INCLUDEPATH Lists variables where qmake will look for includes
## and libraries. Add values using *= operator.
## RS_BIN_DIR, RS_LIB_DIR, RS_INCLUDE_DIR, RS_DATA_DIR, RS_PLUGIN_DIR String
## variables of directories where RetroShare components will be installed, on
## most platforms they are automatically calculated from PREFIX or in other
## ways.
## RS_SQL_LIB String viariable containing the name of the SQL library to use
## ("sqlcipher sqlite3", sqlite3) it is usually precalculated depending on
## CONFIG.
2015-09-04 11:52:25 -04:00
2018-09-28 18:15:10 -04:00
isEmpty(QMAKE_HOST_SPEC):QMAKE_HOST_SPEC=$$[QMAKE_SPEC]
isEmpty(QMAKE_TARGET_SPEC):QMAKE_TARGET_SPEC=$$[QMAKE_XSPEC]
equals(QMAKE_HOST_SPEC, $$QMAKE_TARGET_SPEC) {
CONFIG *= no_rs_cross_compiling
CONFIG -= rs_cross_compiling
} else {
CONFIG *= rs_cross_compiling
CONFIG -= no_rs_cross_compiling
2018-10-06 12:49:17 -04:00
message(Cross-compiling detected QMAKE_HOST_SPEC: $$QMAKE_HOST_SPEC \
QMAKE_TARGET_SPEC: $$QMAKE_TARGET_SPEC)
2018-09-28 18:15:10 -04:00
}
2018-09-11 18:33:29 -04:00
defined(RS_MAJOR_VERSION,var):\
defined(RS_MINOR_VERSION,var):\
defined(RS_MINI_VERSION,var):\
defined(RS_EXTRA_VERSION,var) {
2018-09-15 14:57:28 -04:00
message("RetroShare version\
$${RS_MAJOR_VERSION}.$${RS_MINOR_VERSION}.$${RS_MINI_VERSION}$${RS_EXTRA_VERSION}\
defined in command line")
2018-09-11 18:33:29 -04:00
DEFINES += RS_MAJOR_VERSION=$${RS_MAJOR_VERSION}
DEFINES += RS_MINOR_VERSION=$${RS_MINOR_VERSION}
DEFINES += RS_MINI_VERSION=$${RS_MINI_VERSION}
DEFINES += RS_EXTRA_VERSION=\\\"$${RS_EXTRA_VERSION}\\\"
} else {
RS_GIT_DESCRIBE = $$system(git describe)
2018-09-15 14:57:28 -04:00
contains(RS_GIT_DESCRIBE, ^v\d+\.\d+\.\d+.*) {
RS_GIT_DESCRIBE_SPLIT = $$split(RS_GIT_DESCRIBE, v)
RS_GIT_DESCRIBE_SPLIT = $$split(RS_GIT_DESCRIBE_SPLIT, .)
RS_MAJOR_VERSION = $$member(RS_GIT_DESCRIBE_SPLIT, 0)
RS_MINOR_VERSION = $$member(RS_GIT_DESCRIBE_SPLIT, 1)
2018-09-11 18:33:29 -04:00
2018-09-15 14:57:28 -04:00
RS_GIT_DESCRIBE_SPLIT = $$member(RS_GIT_DESCRIBE_SPLIT, 2)
RS_GIT_DESCRIBE_SPLIT = $$split(RS_GIT_DESCRIBE_SPLIT, -)
2018-09-11 18:33:29 -04:00
2018-09-15 14:57:28 -04:00
RS_MINI_VERSION = $$member(RS_GIT_DESCRIBE_SPLIT, 0)
RS_GIT_DESCRIBE_SPLIT = $$member(RS_GIT_DESCRIBE_SPLIT, 1, -1)
2018-09-11 18:33:29 -04:00
RS_EXTRA_VERSION = $$join(RS_GIT_DESCRIBE_SPLIT,-,-)
2018-09-15 14:57:28 -04:00
message("RetroShare version\
$${RS_MAJOR_VERSION}.$${RS_MINOR_VERSION}.$${RS_MINI_VERSION}$${RS_EXTRA_VERSION}\
determined via git")
2018-09-11 18:33:29 -04:00
DEFINES += RS_MAJOR_VERSION=$${RS_MAJOR_VERSION}
DEFINES += RS_MINOR_VERSION=$${RS_MINOR_VERSION}
DEFINES += RS_MINI_VERSION=$${RS_MINI_VERSION}
DEFINES += RS_EXTRA_VERSION=\\\"$${RS_EXTRA_VERSION}\\\"
2018-09-15 14:57:28 -04:00
} else {
warning("Determining RetroShare version via git failed plese specify it\
trough qmake command line arguments!")
2018-09-11 18:33:29 -04:00
}
}
2018-06-22 17:38:31 -04:00
gxsdistsync:DEFINES *= RS_USE_GXS_DISTANT_SYNC
2015-09-04 11:52:25 -04:00
wikipoos:DEFINES *= RS_USE_WIKI
2016-08-02 18:48:19 -04:00
rs_gxs:DEFINES *= RS_ENABLE_GXS
2018-11-05 06:55:51 -05:00
rs_gxs_send_all:DEFINES *= RS_GXS_SEND_ALL
2019-09-10 11:10:26 -04:00
rs_webui:DEFINES *= RS_WEBUI
rs_service_webui_terminal_password:DEFINES *= RS_SERVICE_TERMINAL_WEBUI_PASSWORD
rs_service_terminal_login:DEFINES *= RS_SERVICE_TERMINAL_LOGIN
2018-04-15 07:41:52 -04:00
sqlcipher {
DEFINES -= NO_SQLCIPHER
2018-05-03 05:32:24 -04:00
RS_SQL_LIB = sqlcipher
2018-04-15 07:41:52 -04:00
}
no_sqlcipher {
DEFINES *= NO_SQLCIPHER
RS_SQL_LIB = sqlite3
}
2016-12-03 14:04:25 -05:00
rs_autologin {
DEFINES *= RS_AUTOLOGIN
2019-09-10 11:10:26 -04:00
RS_AUTOLOGIN_WARNING_MSG = QMAKE: \
2018-06-23 11:13:38 -04:00
You have enabled RetroShare auto-login, this is discouraged. The usage \
of auto-login on some linux distributions may allow someone having \
access to your session to steal the SSL keys of your node location and \
therefore compromise your security
warning("$${RS_AUTOLOGIN_WARNING_MSG}")
2016-12-03 14:04:25 -05:00
}
2016-12-21 16:05:57 -05:00
2017-08-20 07:17:28 -04:00
rs_onlyhiddennode {
DEFINES *= RS_ONLYHIDDENNODE
2018-04-15 07:41:52 -04:00
CONFIG -= bitdht
CONFIG *= no_bitdht
message("QMAKE: You have enabled only hidden node.")
2017-08-20 07:17:28 -04:00
}
2019-05-11 16:25:02 -04:00
rs_sanitize {
QMAKE_CXXFLAGS *= -fsanitize=address -fsanitize=bounds -fsanitize=undefined
}
2017-07-17 10:04:52 -04:00
no_rs_deprecatedwarning {
2016-12-21 16:05:57 -05:00
QMAKE_CXXFLAGS += -Wno-deprecated
QMAKE_CXXFLAGS += -Wno-deprecated-declarations
2017-01-14 17:12:50 -05:00
DEFINES *= RS_NO_WARN_DEPRECATED
2019-09-10 11:10:26 -04:00
warning("QMAKE: You have disabled deprecated warnings.")
2016-12-21 16:05:57 -05:00
}
2017-01-14 17:12:50 -05:00
2017-07-17 10:04:52 -04:00
no_rs_cppwarning {
2017-01-21 10:51:37 -05:00
QMAKE_CXXFLAGS += -Wno-cpp
2019-02-14 18:14:42 -05:00
QMAKE_CXXFLAGS += -Wno-inconsistent-missing-override
2017-01-21 10:51:37 -05:00
DEFINES *= RS_NO_WARN_CPP
2019-09-10 11:10:26 -04:00
warning("QMAKE: You have disabled C preprocessor warnings.")
2017-01-21 10:51:37 -05:00
}
2017-03-01 20:37:53 -05:00
rs_gxs_trans {
DEFINES *= RS_GXS_TRANS
2017-02-26 07:13:55 -05:00
greaterThan(QT_MAJOR_VERSION, 4) {
CONFIG += c++11
} else {
QMAKE_CXXFLAGS += -std=c++0x
}
}
2018-11-08 12:13:20 -05:00
bitdht {
DEFINES *= RS_USE_BITDHT
}
2018-11-20 05:32:00 -05:00
direct_chat {
2019-09-10 11:10:26 -04:00
warning("QMAKE: You have enabled RetroShare direct chat which is deprecated!")
2018-11-20 05:32:00 -05:00
DEFINES *= RS_DIRECT_CHAT
}
2017-05-30 09:43:43 -04:00
rs_async_chat {
DEFINES *= RS_ASYNC_CHAT
}
2017-07-18 10:34:56 -04:00
rs_chatserver {
DEFINES *= RS_CHATSERVER
}
2017-11-19 14:15:36 -05:00
2018-06-23 11:13:38 -04:00
rs_jsonapi {
2018-09-28 18:15:10 -04:00
rs_cross_compiling:!exists($$JSONAPI_GENERATOR_EXE):error("Inconsistent \
build configuration, cross-compiling JSON API requires JSONAPI_GENERATOR_EXE \
to contain the path to an host executable jsonapi-generator")
2018-06-23 11:13:38 -04:00
DEFINES *= RS_JSONAPI
}
2019-09-10 11:10:26 -04:00
libresapilocalserver {
warning("QMAKE: you have enabled libresapilocalserver which is deprecated")
DEFINES *= LIBRESAPI_LOCAL_SERVER
}
libresapi_settings {
warning("QMAKE: you have enabled libresapi_settings which is deprecated")
DEFINES *= LIBRESAPI_SETTINGS
}
libresapihttpserver {
warning("QMAKE: you have enabled libresapihttpserver which is deprecated")
DEFINES *= ENABLE_WEBUI
}
retroshare_nogui {
warning("QMAKE: you have enabled retroshare_nogui which is deprecated")
}
retroshare_android_service {
warning("QMAKE: you have enabled retroshare_android_service which is deprecated")
}
retroshare_android_notify_service {
warning("QMAKE: you have enabled retroshare_android_notify_service which is deprecated")
}
retroshare_qml_app {
warning("QMAKE: you have enabled retroshare_qml_app which is deprecated")
}
2019-06-20 11:24:18 -04:00
rs_deep_channels_index:DEFINES *= RS_DEEP_CHANNEL_INDEX
2018-07-31 12:08:24 -04:00
2019-06-20 11:24:18 -04:00
rs_deep_files_index:DEFINES *= RS_DEEP_FILES_INDEX
rs_deep_files_index_ogg:DEFINES *= RS_DEEP_FILES_INDEX_OGG
2019-06-21 07:33:10 -04:00
rs_deep_files_index_flac:DEFINES *= RS_DEEP_FILES_INDEX_FLAC
rs_deep_files_index_taglib:DEFINES *= RS_DEEP_FILES_INDEX_TAGLIB
2018-06-09 12:06:14 -04:00
2019-02-04 08:49:09 -05:00
rs_use_native_dialogs:DEFINES *= RS_NATIVEDIALOGS
2019-04-11 20:53:39 -04:00
rs_broadcast_discovery:DEFINES *= RS_BROADCAST_DISCOVERY
2018-04-15 07:41:52 -04:00
debug {
QMAKE_CXXFLAGS -= -O2 -fomit-frame-pointer
QMAKE_CFLAGS -= -O2 -fomit-frame-pointer
2017-11-19 14:15:36 -05:00
2018-04-15 07:41:52 -04:00
QMAKE_CXXFLAGS *= -O0 -g -fno-omit-frame-pointer
QMAKE_CFLAGS *= -O0 -g -fno-omit-frame-pointer
}
profiling {
QMAKE_CXXFLAGS -= -fomit-frame-pointer
QMAKE_CFLAGS -= -fomit-frame-pointer
QMAKE_CXXFLAGS *= -pg -g -fno-omit-frame-pointer
QMAKE_CFLAGS *= -pg -g -fno-omit-frame-pointer
QMAKE_LFLAGS *= -pg
}
################################################################################
## Last goes platform specific statements common to all RetroShare subprojects #
################################################################################
linux-* {
isEmpty(PREFIX) : PREFIX = "/usr"
isEmpty(RS_BIN_DIR) : RS_BIN_DIR = "$${PREFIX}/bin"
isEmpty(RS_INCLUDE_DIR): RS_INCLUDE_DIR = "$${PREFIX}/include"
isEmpty(RS_LIB_DIR) : RS_LIB_DIR = "$${PREFIX}/lib"
isEmpty(RS_DATA_DIR) : RS_DATA_DIR = "$${PREFIX}/share/retroshare"
2018-12-21 07:51:03 -05:00
isEmpty(RS_PLUGIN_DIR) : RS_PLUGIN_DIR = "$${PREFIX}/lib/retroshare/extensions6"
2018-04-15 07:41:52 -04:00
QMAKE_LIBDIR *= "$$RS_LIB_DIR"
rs_autologin {
2018-05-04 14:52:31 -04:00
# try libsecret first since it is not limited to gnome keyring and libgnome-keyring is deprecated
LIBSECRET_AVAILABLE = $$system(pkg-config --exists libsecret-1 && echo yes)
isEmpty(LIBSECRET_AVAILABLE) {
message("using libgnome-keyring for auto login")
DEFINES *= HAS_GNOME_KEYRING
PKGCONFIG *= gnome-keyring-1
} else {
message("using libsecret for auto login")
DEFINES *= HAS_LIBSECRET
PKGCONFIG *= libsecret-1
}
2018-04-15 07:41:52 -04:00
}
}
android-* {
isEmpty(NATIVE_LIBS_TOOLCHAIN_PATH) {
NATIVE_LIBS_TOOLCHAIN_PATH = $$(NATIVE_LIBS_TOOLCHAIN_PATH)
}
retroshare_qml_app {
CONFIG -= no_retroshare_android_notify_service
CONFIG *= retroshare_android_notify_service
}
CONFIG *= no_libresapihttpserver
CONFIG -= libresapihttpserver
2019-11-17 07:23:08 -05:00
CONFIG += no_rs_service_terminal_login
CONFIG += no_rs_service_webui_terminal_password
2018-04-15 07:41:52 -04:00
QT *= androidextras
INCLUDEPATH *= $$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/include
QMAKE_LIBDIR *= "$$NATIVE_LIBS_TOOLCHAIN_PATH/sysroot/usr/lib/"
# The android libc, bionic, provides built-in support for pthreads,
# additional linking (-lpthreads) break linking.
# See https://stackoverflow.com/a/31277163
RS_THREAD_LIB =
}
win32-g++ {
2018-05-07 01:30:29 -04:00
!isEmpty(EXTERNAL_LIB_DIR) {
message(Use pre-compiled libraries in $${EXTERNAL_LIB_DIR}.)
PREFIX = $$system_path($$EXTERNAL_LIB_DIR)
}
2018-04-15 07:41:52 -04:00
PREFIX_MSYS2 = $$(MINGW_PREFIX)
isEmpty(PREFIX_MSYS2) {
message("MINGW_PREFIX is not set, attempting MSYS2 autodiscovery.")
TEMPTATIVE_MSYS2=$$system_path(C:\\msys32\\mingw32)
exists($$clean_path($${TEMPTATIVE_MSYS2}/include)) {
PREFIX_MSYS2=$${TEMPTATIVE_MSYS2}
}
TEMPTATIVE_MSYS2=$$system_path(C:\\msys64\\mingw32)
exists($$clean_path($${TEMPTATIVE_MSYS2}/include)) {
PREFIX_MSYS2=$${TEMPTATIVE_MSYS2}
}
2018-06-11 10:05:25 -04:00
!isEmpty(PREFIX_MSYS2):message(Found MSYS2: $${PREFIX_MSYS2})
}
2018-05-07 01:30:29 -04:00
2018-06-11 10:05:25 -04:00
isEmpty(PREFIX):!isEmpty(PREFIX_MSYS2) {
PREFIX = $$system_path($${PREFIX_MSYS2})
2018-04-15 07:41:52 -04:00
}
isEmpty(PREFIX) {
2018-05-07 01:30:29 -04:00
error(PREFIX is not set. Set either EXTERNAL_LIB_DIR or PREFIX_MSYS2.)
2018-04-15 07:41:52 -04:00
}
INCLUDEPATH *= $$system_path($${PREFIX}/include)
2018-05-07 01:30:29 -04:00
!isEmpty(PREFIX_MSYS2) : INCLUDEPATH *= $$system_path($${PREFIX_MSYS2}/include)
2018-04-15 07:41:52 -04:00
QMAKE_LIBDIR *= $$system_path($${PREFIX}/lib)
2018-05-07 01:30:29 -04:00
!isEmpty(PREFIX_MSYS2) : QMAKE_LIBDIR *= $$system_path($${PREFIX_MSYS2}/lib)
2018-04-15 07:41:52 -04:00
RS_BIN_DIR = $$system_path($${PREFIX}/bin)
RS_INCLUDE_DIR = $$system_path($${PREFIX}/include)
RS_LIB_DIR = $$system_path($${PREFIX}/lib)
RS_UPNP_LIB = miniupnpc
2018-10-07 07:07:22 -04:00
DEFINES *= NOGDI WIN32 WIN32_LEAN_AND_MEAN WINDOWS_SYS
2018-04-15 07:41:52 -04:00
# This defines the platform to be WinXP or later and is needed for
# getaddrinfo (_WIN32_WINNT_WINXP)
DEFINES *= WINVER=0x0501
message(***retroshare.pri:Win32 PREFIX $$PREFIX INCLUDEPATH $$INCLUDEPATH QMAKE_LIBDIR $$QMAKE_LIBDIR DEFINES $$DEFINES)
}
macx-* {
rs_macos10.8 {
message(***retroshare.pri: Set Target and SDK to MacOS 10.8 )
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.8
QMAKE_MAC_SDK = macosx10.8
}
rs_macos10.9 {
message(***retroshare.pri: Set Target and SDK to MacOS 10.9 )
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.9
QMAKE_MAC_SDK = macosx10.9
}
rs_macos10.10 {
message(***retroshare.pri: Set Target and SDK to MacOS 10.10 )
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.10
QMAKE_MAC_SDK = macosx10.10
}
rs_macos10.11 {
message(***retroshare.pri: Set Target and SDK to MacOS 10.11 )
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.11
QMAKE_MAC_SDK = macosx10.11
}
rs_macos10.12 {
message(***retroshare.pri: Set Target and SDK to MacOS 10.12 )
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.12
QMAKE_MAC_SDK = macosx10.12
QMAKE_CXXFLAGS += -Wno-nullability-completeness
QMAKE_CFLAGS += -Wno-nullability-completeness
}
2019-01-23 07:20:05 -05:00
rs_macos10.13 {
message(***retroshare.pri: Set Target and SDK to MacOS 10.13 )
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13
QMAKE_MAC_SDK = macosx10.13
QMAKE_CXXFLAGS += -Wno-nullability-completeness
QMAKE_CFLAGS += -Wno-nullability-completeness
}
2019-03-24 11:22:17 -04:00
rs_macos10.14 {
message(***retroshare.pri: Set Target and SDK to MacOS 10.14 )
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.14
QMAKE_MAC_SDK = macosx10.14
QMAKE_CXXFLAGS += -Wno-nullability-completeness
QMAKE_CFLAGS += -Wno-nullability-completeness
}
2019-01-23 07:20:05 -05:00
2018-04-15 07:41:52 -04:00
message(***retroshare.pri:MacOSX)
2019-01-23 11:39:29 -05:00
# BIN_DIR += "/usr/bin"
# INC_DIR += "/usr/include"
# INC_DIR += "/usr/local/include"
# INC_DIR += "/opt/local/include"
# LIB_DIR += "/usr/local/lib"
# LIB_DIR += "/opt/local/lib"
BIN_DIR += "/Applications/Xcode.app/Contents/Developer/usr/bin"
INC_DIR += "/usr/local/Cellar/miniupnpc/2.1/include"
2019-01-24 05:59:31 -05:00
INC_DIR += "/usr/local/Cellar/libmicrohttpd/0.9.62_1/include"
2019-03-24 13:58:18 -04:00
INC_DIR += "/usr/local/Cellar/sqlcipher/4.1.0/include"
2019-01-23 11:39:29 -05:00
LIB_DIR += "/usr/local/opt/openssl/lib/"
2019-01-24 05:59:31 -05:00
LIB_DIR += "/usr/local/Cellar/libmicrohttpd/0.9.62_1/lib"
2019-03-24 13:58:18 -04:00
LIB_DIR += "/usr/local/Cellar/sqlcipher/4.1.0/lib"
2019-01-23 11:39:29 -05:00
LIB_DIR += "/usr/local/Cellar/miniupnpc/2.1/lib"
2018-04-15 07:41:52 -04:00
CONFIG += c++11
2019-01-23 11:39:29 -05:00
INCLUDEPATH += "/usr/local/include"
RS_UPNP_LIB = miniupnpc
QT += macextras
2017-11-19 14:15:36 -05:00
}
2018-04-28 03:06:10 -04:00
2019-04-24 12:08:35 -04:00
# If not yet defined attempt UPnP library autodetection should works at least
# for miniupnc libupnp-1.6.x and libupnp-1.8.x
isEmpty(RS_UPNP_LIB) {
__TEMP_UPNP_LIBS = upnp ixml threadutil
for(mLib, __TEMP_UPNP_LIBS) {
attemptPath=$$findFileInPath(lib$${mLib}.a, QMAKE_LIBDIR)
isEmpty(attemptPath):attemptPath=$$findFileInPath(lib$${mLib}.so, QMAKE_LIBDIR)
!isEmpty(attemptPath):RS_UPNP_LIB += $${mLib}
}
isEmpty(RS_UPNP_LIB) {
__TEMP_UPNP_LIBS=$$findFileInPath(libminiupnpc.a, QMAKE_LIBDIR)
!isEmpty(__TEMP_UPNP_LIBS):RS_UPNP_LIB=miniupnpc
__TEMP_UPNP_LIBS=$$findFileInPath(libminiupnpc.so, QMAKE_LIBDIR)
!isEmpty(__TEMP_UPNP_LIBS):RS_UPNP_LIB=miniupnpc
}
isEmpty(RS_UPNP_LIB) {
warning("RS_UPNP_LIB detection failed, UPnP support disabled!")
} else {
message("Autodetected RS_UPNP_LIB=$$RS_UPNP_LIB")
}
}
equals(RS_UPNP_LIB, none):RS_UPNP_LIB=
equals(RS_UPNP_LIB, miniupnpc):DEFINES*=RS_USE_LIBMINIUPNPC
2019-04-24 17:36:40 -04:00
contains(RS_UPNP_LIB, upnp):DEFINES*=RS_USE_LIBUPNP
2019-04-24 12:08:35 -04:00
2017-11-19 14:15:36 -05:00
2018-04-28 03:06:10 -04:00
## Retrocompatibility assignations, get rid of this ASAP
isEmpty(BIN_DIR) : BIN_DIR = $${RS_BIN_DIR}
isEmpty(INC_DIR) : INC_DIR = $${RS_INCLUDE_DIR}
isEmpty(LIBDIR) : LIBDIR = $${QMAKE_LIBDIR}
isEmpty(DATA_DIR) : DATA_DIR = $${RS_DATA_DIR}
isEmpty(PLUGIN_DIR): PLUGIN_DIR= $${RS_PLUGIN_DIR}