mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-05 13:19:32 -04:00
Use PKGCONFIG instead of manually specifying LIBS for Linux
- The advantage is that this method automatically includes additional dependencies of LIBS (e.g. libupnp needs -lixml). - Also if some distribution moves headers to non default locations the correct locations get added by PKGCONFIG
This commit is contained in:
parent
b8e3a434cf
commit
66b9557833
8 changed files with 34 additions and 38 deletions
|
@ -168,5 +168,3 @@ SOURCES += \
|
||||||
bitdht/bdquerymgr.cc \
|
bitdht/bdquerymgr.cc \
|
||||||
util/bdbloom.cc \
|
util/bdbloom.cc \
|
||||||
bitdht/bdfriendlist.cc \
|
bitdht/bdfriendlist.cc \
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
CONFIG += staticlib
|
CONFIG += staticlib
|
||||||
|
CONFIG += create_prl
|
||||||
CONFIG -= qt
|
CONFIG -= qt
|
||||||
TARGET = resapi
|
TARGET = resapi
|
||||||
|
TARGET_PRL = libresapi
|
||||||
DESTDIR = lib
|
DESTDIR = lib
|
||||||
|
|
||||||
CONFIG += libmicrohttpd
|
CONFIG += libmicrohttpd
|
||||||
|
@ -26,6 +28,12 @@ win32{
|
||||||
}
|
}
|
||||||
|
|
||||||
libmicrohttpd{
|
libmicrohttpd{
|
||||||
|
linux {
|
||||||
|
CONFIG += link_pkgconfig
|
||||||
|
PKGCONFIG *= libmicrohttpd
|
||||||
|
} else {
|
||||||
|
LIBS *= -lmicrohttpd
|
||||||
|
}
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
api/ApiServerMHD.cpp
|
api/ApiServerMHD.cpp
|
||||||
|
|
||||||
|
|
|
@ -120,8 +120,7 @@ HEADERS += $$PUBLIC_HEADERS
|
||||||
|
|
||||||
################################# Linux ##########################################
|
################################# Linux ##########################################
|
||||||
linux-* {
|
linux-* {
|
||||||
# These two lines fixe compilation on ubuntu natty. Probably a ubuntu packaging error.
|
CONFIG += link_pkgconfig
|
||||||
INCLUDEPATH += $$system(pkg-config --cflags glib-2.0 | sed -e "s/-I//g")
|
|
||||||
|
|
||||||
OPENPGPSDK_DIR = ../../openpgpsdk/src
|
OPENPGPSDK_DIR = ../../openpgpsdk/src
|
||||||
DEPENDPATH *= $${OPENPGPSDK_DIR} ../openpgpsdk
|
DEPENDPATH *= $${OPENPGPSDK_DIR} ../openpgpsdk
|
||||||
|
@ -131,17 +130,12 @@ linux-* {
|
||||||
QMAKE_CXXFLAGS *= -Wall -D_FILE_OFFSET_BITS=64
|
QMAKE_CXXFLAGS *= -Wall -D_FILE_OFFSET_BITS=64
|
||||||
QMAKE_CC = g++
|
QMAKE_CC = g++
|
||||||
|
|
||||||
SSL_DIR = /usr/include/openssl
|
|
||||||
UPNP_DIR = /usr/include/upnp
|
|
||||||
DEPENDPATH += . $${SSL_DIR} $${UPNP_DIR}
|
|
||||||
INCLUDEPATH += . $${SSL_DIR} $${UPNP_DIR}
|
|
||||||
|
|
||||||
contains(CONFIG, NO_SQLCIPHER) {
|
contains(CONFIG, NO_SQLCIPHER) {
|
||||||
DEFINES *= NO_SQLCIPHER
|
DEFINES *= NO_SQLCIPHER
|
||||||
LIBS *= -lsqlite3
|
PKGCONFIG *= sqlite3
|
||||||
} else {
|
} else {
|
||||||
SQLCIPHER_OK = $$system(pkg-config --exists sqlcipher && echo yes)
|
SQLCIPHER_OK = $$system(pkg-config --exists sqlcipher && echo yes)
|
||||||
isEmpty(SQLCIPHER_OK) {
|
isEmpty(SQLCIPHER_OK) {
|
||||||
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
|
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
|
||||||
exists(../../../lib/sqlcipher/.libs/libsqlcipher.a) {
|
exists(../../../lib/sqlcipher/.libs/libsqlcipher.a) {
|
||||||
LIBS += ../../../lib/sqlcipher/.libs/libsqlcipher.a
|
LIBS += ../../../lib/sqlcipher/.libs/libsqlcipher.a
|
||||||
|
@ -151,7 +145,7 @@ linux-* {
|
||||||
error("libsqlcipher is not installed and libsqlcipher.a not found. SQLCIPHER is necessary for encrypted database, to build with unencrypted database, run: qmake CONFIG+=NO_SQLCIPHER")
|
error("libsqlcipher is not installed and libsqlcipher.a not found. SQLCIPHER is necessary for encrypted database, to build with unencrypted database, run: qmake CONFIG+=NO_SQLCIPHER")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LIBS *= -lsqlcipher
|
PKGCONFIG *= sqlcipher
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +157,7 @@ linux-* {
|
||||||
CONFIG += upnp_libupnp
|
CONFIG += upnp_libupnp
|
||||||
|
|
||||||
# Check if the systems libupnp has been Debian-patched
|
# Check if the systems libupnp has been Debian-patched
|
||||||
system(grep -E 'char[[:space:]]+PublisherUrl' $${UPNP_DIR}/upnp.h >/dev/null 2>&1) {
|
system(grep -E 'char[[:space:]]+PublisherUrl' /usr/include/upnp/upnp.h >/dev/null 2>&1) {
|
||||||
# Normal libupnp
|
# Normal libupnp
|
||||||
} else {
|
} else {
|
||||||
# Patched libupnp or new unreleased version
|
# Patched libupnp or new unreleased version
|
||||||
|
@ -171,10 +165,10 @@ linux-* {
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINES *= UBUNTU
|
DEFINES *= UBUNTU
|
||||||
INCLUDEPATH += /usr/include/glib-2.0/ /usr/lib/glib-2.0/include
|
PKGCONFIG *= gnome-keyring-1
|
||||||
LIBS *= -lgnome-keyring
|
PKGCONFIG *= libssl libupnp
|
||||||
LIBS *= -lssl -lupnp -lixml
|
PKGCONFIG *= libcrypto zlib
|
||||||
LIBS *= -lcrypto -lz -lpthread
|
LIBS *= -lpthread -ldl
|
||||||
}
|
}
|
||||||
|
|
||||||
unix {
|
unix {
|
||||||
|
|
|
@ -81,12 +81,9 @@ TRANSLATIONS += \
|
||||||
lang/FeedReader_zh_CN.ts
|
lang/FeedReader_zh_CN.ts
|
||||||
|
|
||||||
linux-* {
|
linux-* {
|
||||||
LIBXML2_DIR = /usr/include/libxml2
|
CONFIG += link_pkgconfig
|
||||||
|
|
||||||
DEPENDPATH += $${LIBXML2_DIR}
|
PKGCONFIG *= libcurl libxml-2.0 libxslt
|
||||||
INCLUDEPATH += $${LIBXML2_DIR}
|
|
||||||
|
|
||||||
LIBS += -lcurl -lxml2 -lxslt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
|
@ -102,4 +99,3 @@ openbsd-* {
|
||||||
|
|
||||||
LIBS += -lcurl -lxml2 -lxslt
|
LIBS += -lcurl -lxml2 -lxslt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,10 +21,11 @@ INCLUDEPATH += ../../retroshare-gui/src/temp/ui ../../libretroshare/src
|
||||||
linux-* {
|
linux-* {
|
||||||
CONFIG += link_pkgconfig
|
CONFIG += link_pkgconfig
|
||||||
|
|
||||||
# Necessary for openSUSE
|
|
||||||
PKGCONFIG += libavcodec libavutil
|
PKGCONFIG += libavcodec libavutil
|
||||||
|
PKGCONFIG += speex speexdsp
|
||||||
PKGCONFIG += opencv
|
PKGCONFIG += opencv
|
||||||
|
} else {
|
||||||
|
LIBS += -lspeex -lspeexdsp -lavcodec -lavutil
|
||||||
}
|
}
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
|
@ -103,5 +104,3 @@ TRANSLATIONS += \
|
||||||
lang/VOIP_sv.ts \
|
lang/VOIP_sv.ts \
|
||||||
lang/VOIP_tr.ts \
|
lang/VOIP_tr.ts \
|
||||||
lang/VOIP_zh_CN.ts
|
lang/VOIP_zh_CN.ts
|
||||||
|
|
||||||
LIBS += -lspeex -lspeexdsp -lavcodec -lavutil
|
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
|
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
|
||||||
|
|
||||||
|
TEMPLATE = app
|
||||||
QT += network xml
|
QT += network xml
|
||||||
CONFIG += qt gui uic qrc resources idle bitdht
|
CONFIG += qt gui uic qrc resources idle bitdht
|
||||||
CONFIG += link_prl
|
CONFIG += link_prl
|
||||||
|
TARGET = RetroShare06
|
||||||
|
|
||||||
# Plz never commit the .pro with these flags enabled.
|
# Plz never commit the .pro with these flags enabled.
|
||||||
# Use this flag when developping new features only.
|
# Use this flag when developping new features only.
|
||||||
|
@ -34,9 +36,6 @@ CONFIG += gxsgui
|
||||||
#CONFIG += framecatcher
|
#CONFIG += framecatcher
|
||||||
#CONFIG += blogs
|
#CONFIG += blogs
|
||||||
|
|
||||||
TEMPLATE = app
|
|
||||||
TARGET = RetroShare06
|
|
||||||
|
|
||||||
DEFINES += RS_RELEASE_VERSION
|
DEFINES += RS_RELEASE_VERSION
|
||||||
RCC_DIR = temp/qrc
|
RCC_DIR = temp/qrc
|
||||||
UI_DIR = temp/ui
|
UI_DIR = temp/ui
|
||||||
|
@ -61,15 +60,16 @@ INCLUDEPATH *= retroshare-gui
|
||||||
################################# Linux ##########################################
|
################################# Linux ##########################################
|
||||||
# Put lib dir in QMAKE_LFLAGS so it appears before -L/usr/lib
|
# Put lib dir in QMAKE_LFLAGS so it appears before -L/usr/lib
|
||||||
linux-* {
|
linux-* {
|
||||||
|
CONFIG += link_pkgconfig
|
||||||
#CONFIG += version_detail_bash_script
|
#CONFIG += version_detail_bash_script
|
||||||
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
|
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
|
||||||
|
|
||||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||||
|
|
||||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||||
LIBS *= -lX11 -lXss
|
PKGCONFIG *= x11 xscrnsaver
|
||||||
|
|
||||||
LIBS *= -rdynamic -ldl
|
LIBS *= -rdynamic
|
||||||
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
|
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
|
||||||
DEFINES *= UBUNTU
|
DEFINES *= UBUNTU
|
||||||
}
|
}
|
||||||
|
@ -289,7 +289,7 @@ wikipoos {
|
||||||
DEPENDPATH += ../../libresapi/src
|
DEPENDPATH += ../../libresapi/src
|
||||||
INCLUDEPATH += ../../libresapi/src
|
INCLUDEPATH += ../../libresapi/src
|
||||||
PRE_TARGETDEPS *= ../../libresapi/src/lib/libresapi.a
|
PRE_TARGETDEPS *= ../../libresapi/src/lib/libresapi.a
|
||||||
LIBS += ../../libresapi/src/lib/libresapi.a -lmicrohttpd
|
LIBS += ../../libresapi/src/lib/libresapi.a
|
||||||
|
|
||||||
# Input
|
# Input
|
||||||
HEADERS += rshare.h \
|
HEADERS += rshare.h \
|
||||||
|
|
|
@ -27,7 +27,7 @@ linux-* {
|
||||||
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
|
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
|
||||||
|
|
||||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||||
LIBS *= -rdynamic -ldl
|
LIBS *= -rdynamic
|
||||||
}
|
}
|
||||||
|
|
||||||
unix {
|
unix {
|
||||||
|
@ -169,7 +169,7 @@ introserver {
|
||||||
webui {
|
webui {
|
||||||
DEFINES *= ENABLE_WEBUI
|
DEFINES *= ENABLE_WEBUI
|
||||||
PRE_TARGETDEPS *= ../../libresapi/src/lib/libresapi.a
|
PRE_TARGETDEPS *= ../../libresapi/src/lib/libresapi.a
|
||||||
LIBS += ../../libresapi/src/lib/libresapi.a -lmicrohttpd
|
LIBS += ../../libresapi/src/lib/libresapi.a
|
||||||
DEPENDPATH += ../../libresapi/src
|
DEPENDPATH += ../../libresapi/src
|
||||||
INCLUDEPATH += ../../libresapi/src
|
INCLUDEPATH += ../../libresapi/src
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
|
|
@ -15,8 +15,9 @@ debug {
|
||||||
|
|
||||||
################################# Linux ##########################################
|
################################# Linux ##########################################
|
||||||
linux-* {
|
linux-* {
|
||||||
DESTDIR = lib
|
CONFIG += link_pkgconfig
|
||||||
LIBS *= -lglib-2.0
|
|
||||||
|
PKGCONFIG *= glib-2.0
|
||||||
}
|
}
|
||||||
|
|
||||||
linux-g++ {
|
linux-g++ {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue