[build2] Failure to compile build2 with libpkgconf 1.5.3

Matthew Krupcale mkrupcale at matthewkrupcale.com
Sun Oct 21 16:43:44 UTC 2018


Hello,

I'm trying to build build2 on Fedora 29, which uses libpkgconf version
1.5.3, and it seems that since 1.5.1 there has been an API change[1]
pertaining to their pkgconf_client_t. This results in build errors
such as the following:

c++ build2/cc/cxx{pkgconfig}
/builddir/build/BUILD/build2-toolchain-0.8.0/build2-0.8.0/build2/cc/pkgconfig.cxx:
In constructor ‘build2::pkgconf::pkgconf(build2::pkgconf::path_type,
const dir_paths&, const dir_paths&, const dir_paths&)’:
/builddir/build/BUILD/build2-toolchain-0.8.0/build2-0.8.0/build2/cc/pkgconfig.cxx:279:59:
error: too few arguments to function ‘pkgconf_client_t*
pkgconf_client_new(pkgconf_error_handler_func_t, void*, const
pkgconf_cross_personality_t*)’
                           nullptr /* error_handler_data */),
                                                           ^
In file included from
/builddir/build/BUILD/build2-toolchain-0.8.0/build2-0.8.0/build2/cc/pkgconfig.cxx:9:
/usr/include/pkgconf/libpkgconf/libpkgconf.h:202:32: note: declared here
 PKGCONF_API pkgconf_client_t *
pkgconf_client_new(pkgconf_error_handler_func_t error_handler, void
*error_handler_data, const pkgconf_cross_personality_t *personality);
                                ^~~~~~~~~~~~~~~~~~
info: failed to update build2/exe{b}

As far as I can tell, libpkgconf does not define any version
preprocessor macros as part of its API, so you'll probably have to use
during build2 configuration/compilation either:
 * the version set in libpkgconf.pc
 * the version extracted from pkgconf --version
 * try to compile/link a test executable using pkgconf_client_new to
determine the right function call to use

Then based on this conditionally set some preprocessor macro in
build2/cc/pkgconfig.cxx to use the right libpkgconf API or something
to that effect.

Best,
Matthew

[1] https://github.com/pkgconf/pkgconf/commit/854490c5b982a5bf690287de54e48177d052f32b



More information about the users mailing list