[PATCH] Detect libdivecomputer using pkg-config if possible

Miika Turkia miika.turkia at gmail.com
Sat May 18 22:35:48 PDT 2013


If libdivecomputer is managed by pkg-config, we should query it for the
compiler parameters on Linux also.

Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
Same patch should be added to Gtk branch, if that is not yet dead.
(There directly to Makefile.)
---
 Configure.mk |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/Configure.mk b/Configure.mk
index c7b6ba5..e482de6 100644
--- a/Configure.mk
+++ b/Configure.mk
@@ -33,6 +33,9 @@ ifeq ($(CC), i686-w64-mingw32-gcc)
 else ifeq ($(UNAME), darwin)
 	LIBDIVECOMPUTERINCLUDES = $(shell $(PKGCONFIG) --cflags libdivecomputer)
 	LIBDIVECOMPUTERARCHIVE = $(shell $(PKGCONFIG) --libs libdivecomputer)
+else ifeq ($(shell $(PKGCONFIG) --exists libdivecomputer; echo $$?),0)
+	LIBDIVECOMPUTERINCLUDES = $(shell $(PKGCONFIG) --cflags libdivecomputer)
+	LIBDIVECOMPUTERARCHIVE = $(shell $(PKGCONFIG) --libs libdivecomputer)
 else
 libdc-local := $(wildcard /usr/local/lib/libdivecomputer.a)
 libdc-local64 := $(wildcard /usr/local/lib64/libdivecomputer.a)
-- 
1.7.9.5



More information about the subsurface mailing list