Kick off work on pkg-config support (issue #738, and also #4435).
pkg-config support allows API consumers on UNIX-like systems to link to Subversion libraries without having to manually specify the correct set of linker flags, including the particular flags for dependencies required by a particular build of Subversion (bdb, serf, etc.). pkg-config uses libsvn_foo.pc files which describe the set of flags required to link to libsvn_foo. See http://www.freedesktop.org/wiki/Software/pkg-config/ for more information.
Make gen-make.py produce .pc.in files for all Subversion libraries, and make the configure script produce .pc files from these .pc.in files. Dependency declarations and linker flags are based on information parsed from build.conf.
Dependencies of Subversion which support pkg-config can be marked as such in build.conf, allowing pkg-config to resolve them. The name of the dependency's pkg-config script has to be specified without the .pc extension, e.g.:
[gnome-keyring] type = lib external-lib = $(SVN_GNOME_KEYRING_LIBS) pkg-config = gnome-keyring-1
Dependencies not aware of pkg-config are added to linker flags directly.
To illustrate, the generated libsvn_client.pc file on my system contains:
There is no support for optional dependencies between Subversion libraries yet, however. For instance, libsvn_client might or might not be linked to libsvn_ra_serf. Such dependencies are currently omitted. Also, I'm not sure yet what to do in cases where a dependency might be statically or dynamically linked, e.g. sqlite.
The .pc files are not being installed yet. I don't want to expose these files to systems using pkg-config until all outstanding issues are resolved.
* build/generator/gen_make.py (Generator.write): Generate .pc.in files. (Generator.write_pkg_config_dot_in_files): New helper function.
* build/generator/templates/pkg-config.in.ezt: New file, the .pc.in template.
* build.conf: apr, apr-util, serf, gnome-keyring, and sqlite support pkg-config. There may be others (kwallet?) but I haven't investiged more yet. I also haven't checked yet if all versions of these dependencies support pkg-config. The most recent versions do support it.
* configure.ac (SVN_APR_MAJOR_VERSION): Declare. APR's major version number is needed to select the correct pkg-config script name (e.g. apr-1 or apr-2). Generate .pc files from pc.in files.