From e7489ea2dc8b5137e763ce8a41beece1cff7e9e4 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 9 Jul 2014 18:11:10 +0000 Subject: [PATCH] patch from serhaf to fix auto-detection of sqlcipher git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7445 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/retroshare-gui.pro | 15 +++++++++++++-- retroshare-nogui/src/retroshare-nogui.pro | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index f7b7f5ce0..1ee5be20d 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -75,8 +75,19 @@ linux-* { gxs { LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a - # We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database. - LIBS += ../../../lib/sqlcipher/.libs/libsqlcipher.a + SQLCIPHER_OK = $$system(pkg-config --exists sqlcipher && echo yes) + isEmpty(SQLCIPHER_OK) { + # 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) { + message(../../../lib/sqlcipher/.libs/libsqlcipher.a does not exist) + error(Please fix this and try again. Will stop now.) + } + + LIBS += ../../../lib/sqlcipher/.libs/libsqlcipher.a + } else { + LIBS += -lsqlcipher + } } LIBS *= -lglib-2.0 diff --git a/retroshare-nogui/src/retroshare-nogui.pro b/retroshare-nogui/src/retroshare-nogui.pro index c19d7cb1d..58df992e6 100644 --- a/retroshare-nogui/src/retroshare-nogui.pro +++ b/retroshare-nogui/src/retroshare-nogui.pro @@ -32,8 +32,19 @@ linux-* { LIBS *= -rdynamic gxs { - # We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database. - LIBS += ../../../lib/sqlcipher/.libs/libsqlcipher.a + SQLCIPHER_OK = $$system(pkg-config --exists sqlcipher && echo yes) + isEmpty(SQLCIPHER_OK) { + # 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) { + message(../../../lib/sqlcipher/.libs/libsqlcipher.a does not exist) + error(Please fix this and try again. Will stop now.) + } + + LIBS += ../../../lib/sqlcipher/.libs/libsqlcipher.a + } else { + LIBS += -lsqlcipher + } } }