From: Linus Torvalds Date: Fri, 14 Oct 2011 04:06:13 +0000 (+1200) Subject: Don't use dynamic linking for libdivecomputer X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=f2c61aefa762ce2ef7dea61886afeb23b0fe5eff;p=ext%2Fsubsurface.git Don't use dynamic linking for libdivecomputer Commit bd8948386d55 ("Since we don't want configure, use gnumake to find libdivecomputer") was totally broken. Sure, using GNU make features is fine. But then hiding in that commit is the fact that it also changed it to use "-ldivecomputer" instead of just linking with the static libdivecomputer archive. And that's just a really bad idea. Dynamic linking is useful for things like libc, where it allows sharing of the code pages across all the programs using it. For something like libdivecomputer it's just a *bad* idea, and doesn't even work. The libdivecomputer interfaces aren't stable enough to make it a good idea even if it *did* work, and the libdivecomputer "make install" phase doesn't do the proper ldconfig etc setup anyway. Static linking is just simpler and better. It also means that the binary will work even if you move it around to another machine - since libdivecomputer isn't exactly a "standard library".. Signed-off-by: Linus Torvalds --- diff --git a/Makefile b/Makefile index be44007..edd88cb 100644 --- a/Makefile +++ b/Makefile @@ -30,11 +30,11 @@ libdc-usr := $(wildcard /usr/include/libdivecomputer/*) ifneq ($(strip $(libdc-local)),) LIBDIVECOMPUTERDIR = /usr/local LIBDIVECOMPUTERINCLUDES = $(LIBDIVECOMPUTERDIR)/include/libdivecomputer - LIBDIVECOMPUTERARCHIVE = -L$(LIBDIVECOMPUTERDIR)/lib -ldivecomputer + LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib/libdivecomputer.a else ifneq ($(strip $(libdc-usr)),) LIBDIVECOMPUTERDIR = /usr LIBDIVECOMPUTERINCLUDES = $(LIBDIVECOMPUTERDIR)/include/libdivecomputer - LIBDIVECOMPUTERARCHIVE = -ldivecomputer + LIBDIVECOMPUTERARCHIVE = $(LIBDIVECOMPUTERDIR)/lib/libdivecomputer.a else $(error Cannot find libdivecomputer - please edit Makefile) endif