]> mj.ucw.cz Git - libucw.git/commit
Use pkg-config to handle library dependencies.
authorMartin Mares <mj@ucw.cz>
Tue, 17 Jul 2007 17:00:58 +0000 (19:00 +0200)
committerMartin Mares <mj@ucw.cz>
Tue, 17 Jul 2007 17:00:58 +0000 (19:00 +0200)
commit580fd9c443c2a4faba5a703d49f366de5d3968c9
tree347dc4e3bbb6633c9ab72a7cb9a86de1af0cda33
parent9ff544a875f8ee8f78317667fb6200f2f516bc31
Use pkg-config to handle library dependencies.

The original system of library dependencies was very confusing and brittle,
so I have decided to use pkg-config instead.

Each library now has its .pc file, which is processed by genconf, so conditionals
and variable substitutions can be used. You need to specify three Makefile
rules:
(1) libsomething.a to build the static version
(2) libsomething.so to build the shared version
(3) libsomething.pc for the pkg-config metadata; this target should
    depend on .pc files of all libraries required by this library.
    @DEPS@ in the .pc file will be substituted by the names of such
    libraries, so you can just say "Requires: @DEPS@" to handle
    dependencies on other Sherlock libraries.

To link with a library, just add a depedency on its .pc file. The default
rules are smart enough to run pkg-config and construct the appropriate
linker flags.

If you want to link with an external library, the LIBS variable still works.

If you want an internal library to depend on an external library, just
mention it in the linker flags in the .pc file.
build/lib-deps [new file with mode: 0755]
build/lib-flags [new file with mode: 0755]
charset/Makefile
charset/libcharset.pc [new file with mode: 0644]
images/Makefile
images/libimages.pc [new file with mode: 0644]
lib/Makefile
lib/libucw.pc [new file with mode: 0644]