From ebd22b9abc689d46e49532424adb0fac912cc409 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 1 Dec 2014 18:45:41 -0800 Subject: Allow static libgit2 Signed-off-by: Dirk Hohndel --- packaging/ubuntu/rules | 4 ++-- subsurface-configure.pri | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packaging/ubuntu/rules b/packaging/ubuntu/rules index bc5831655..5b9fdc516 100755 --- a/packaging/ubuntu/rules +++ b/packaging/ubuntu/rules @@ -18,8 +18,8 @@ override_dh_auto_clean: override_dh_auto_configure: (cd libdivecomputer ; autoreconf --install ; ./configure ; make) - (mkdir libgit2/build ; cd libgit2/build ; cmake .. ; make ) - qmake LIBDCDEVEL=./libdivecomputer LIBGIT2DEVEL=./libgit2 subsurface.pro + (mkdir libgit2/build ; cd libgit2/build ; cmake -DBUILD_SHARED_LIBS=OFF .. ; sed -i 's/.so$/.a/' CMakeCache.txt ; make ) + qmake LIBDCDEVEL=./libdivecomputer LIBGIT2DEVEL=./libgit2 LIBGIT2STATIC=1 subsurface.pro override_dh_installchangelogs: dh_installchangelogs diff --git a/subsurface-configure.pri b/subsurface-configure.pri index f8789b182..4c55c8b67 100644 --- a/subsurface-configure.pri +++ b/subsurface-configure.pri @@ -137,7 +137,11 @@ isEmpty(LIBGIT2DEVEL) { PKGCONFIG += libgit2 } else { INCLUDEPATH += $$LIBGIT2DEVEL/include - LIBS += -L$$LIBGIT2DEVEL/build -lgit2 -lz -lcrypto + isEmpty(LIBGIT2STATIC) { + LIBS += -L$$LIBGIT2DEVEL/build -lgit2 -lz -lcrypto + } else { + LIBS += $$LIBGIT2DEVEL/build/libgit2.a -Wl,-Bstatic -lz -lssl -lcrypto -Wl,-Bdynamic -ldl + } } # Add libiconv if needed -- cgit v1.2.3-70-g09d2