From f2c61aefa762ce2ef7dea61886afeb23b0fe5eff Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 14 Oct 2011 16:06:13 +1200 Subject: [PATCH] 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 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.43.0