]> mj.ucw.cz Git - libucw.git/commitdiff
Shared library building features from Ego.
authorMartin Mares <mj@ucw.cz>
Fri, 21 Nov 2008 19:24:53 +0000 (20:24 +0100)
committerMartin Mares <mj@ucw.cz>
Fri, 21 Nov 2008 19:24:53 +0000 (20:24 +0100)
(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.)

build/Makebottom
build/Maketop

index 8565d02c50eae1d8002761c00d2e64b337029b1e..76a3331b555da71f40626d2902cfa3aef90700b2 100644 (file)
@@ -63,8 +63,8 @@ endif
 
 %.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 $<
index cdaae4f6b7b9e22cd76318dc24cabc50a98924ac..5027cfce74d7a57ebc70986e3af4fa8d42279683 100644 (file)
@@ -39,6 +39,7 @@ SOEXT=bundle
 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)),)