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 <torvalds@linux-foundation.org>
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