(1) SO_RUNDIR can be used to choose the place in the run tree where
the .so should be installed.
(2) lib-flags is used, so shared libs can directly depend on other shared
libs if needed. (This is useful for building shared libs that do not
use pkgconfig themselves -- e.g., Perl/Python modules.)
%.so:
$(M)LD $@
- $(Q)$(CC) $(LSHARED) $(LDFLAGS) -o $@ $^
- $(Q)$(call symlink-alias,$@,run/lib,$(*F)$(SONAME_INFIX).so$(SONAME_SUFFIX))
+ $(Q)$(CC) $(LSHARED) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(BUILDSYS)/lib-flags $^) $(LIBS)
+ $(Q)$(call symlink-alias,$@,run/$(SO_RUNDIR),$(*F)$(SONAME_INFIX).so$(SONAME_SUFFIX))
$(o)/%.pc: $(s)/%.pc $(o)/%.$(LS)
$(M)PC $<
else
SOEXT=so
endif
+SO_RUNDIR=lib
# Whenever "make -s" (silent) is run, turn on verbose mode (paradoxical, but gives the right result)
ifneq ($(findstring s,$(MAKEFLAGS)),)