summaryrefslogtreecommitdiffstats
path: root/subsurface-configure.pri
diff options
context:
space:
mode:
authorGravatar Thiago Macieira <thiago@macieira.org>2013-10-09 17:40:25 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-09 17:43:42 -0700
commit1a98e049dc36fc4d385a9a6d02beb73e816a6353 (patch)
tree898a0aec2b56d11c6e31260713a96f6480dd66c9 /subsurface-configure.pri
parentcf2dc742f46d1193127ad9a28fc730e69982a2d7 (diff)
downloadsubsurface-1a98e049dc36fc4d385a9a6d02beb73e816a6353.tar.gz
Try to read the libdivecomputer.la file (created by GNU libtool)
Getting dependency information for static libraries requires extra files. Libtool creates .la files, which are "industry standard". qmake has its own .prl files, but it can create .la in a pinch if necessary. This change allows us to get the actual dependency information from libdivecomputer, without having to guess whether it linked to something else or not. If it changes in the future, we shouldn't have to do anything. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-configure.pri')
-rw-r--r--subsurface-configure.pri22
1 files changed, 15 insertions, 7 deletions
diff --git a/subsurface-configure.pri b/subsurface-configure.pri
index d75af3c86..dc98867a3 100644
--- a/subsurface-configure.pri
+++ b/subsurface-configure.pri
@@ -42,20 +42,28 @@ PKG_CONFIG_OUT = $$system(pkg-config --version 2> $$NUL)
# find it next to our sources
INCLUDEPATH += ../libdivecomputer/include
LIBS += ../libdivecomputer/src/.libs/libdivecomputer.a
+ LIBDC_LA = ../libdivecomputer/src/libdivecomputer.la
} else:exists(/usr/local/lib/libdivecomputer.a) {
LIBS += /usr/local/lib/libdivecomputer.a
+ LIBDC_LA = /usr/local/lib/libdivecomputer.la
} else:exists(/usr/local/lib64/libdivecomputer.a) {
LIBS += /usr/local/lib64/libdivecomputer.a
+ LIBDC_LA = /usr/local/lib64/libdivecomputer.la
} else:link_pkgconfig {
- # find it via pkg-config
- PKGCONFIG += libdivecomputer
+ # find it via pkg-config, but we need to pass the --static flag,
+ # so we can't use the PKGCONFIG variable.
+ LIBS += $$system("pkg-config --static --libs libdivecomputer")
+ LIBDC_CFLAGS = $$system("pkg-config --static --cflags libdivecomputer")
+ QMAKE_CFLAGS += $$LIBDC_CFLAGS
+ QMAKE_CXXFLAGS += $$LIBDC_CFLAGS
+ unset(LIBDC_CFLAGS)
}
-# Libusb-1.0 is only required if libdivecomputer was built with it.
-# And libdivecomputer is only built with it if libusb-1.0 is
-# installed. So get libusb if it exists, but don't complain
-# about it if it doesn't.
-link_pkgconfig: packagesExist(libusb-1.0): PKGCONFIG += libusb-1.0
+!isEmpty(LIBDC_LA):exists($$LIBDC_LA) {
+ # Source the libtool .la file to get the dependent libs
+ LIBS += $$system(". $$LIBDC_LA && echo \$dependency_libs")
+ unset(LIBDC_LA)
+}
#
# Find libxml2 and libxslt