[R-pkg-devel] set pkg_config for 3rd party software

Ralf Stubner r@||@@tubner @end|ng |rom gm@||@com
Thu Sep 5 16:53:36 CEST 2019


On Thu, Sep 5, 2019 at 12:27 PM Martin Maechler
<maechler using stat.math.ethz.ch> wrote:

> Now what is the officially / best way to have either 'configure'
> or  Makevars.{in,win}  use the 'pkg-config' information
> *dynamically*, i.e.,
> if I update my MPFR from 4.0.1 to 4.0.2  the newer 4.0.2 is found ?

I don't know what is best, but here are three alternatives:

* Use PKG_CHECK_MODULES which sets up default variables with _CFLAGS
and _LIBS suffix after searching for a library with pkg-config, c.f.
https://autotools.io/pkgconfig/pkg_check_modules.html
* Call pkg-config by hand in configure.ac (and hence configure).
Example: https://github.com/eddelbuettel/rcppredis/blob/master/configure.ac#L47-L60
* Call pkg-config within an "Anticonf" configure script. Example:
https://github.com/jeroen/curl/blob/master/configure#L16-L24

cheerio
ralf



More information about the R-package-devel mailing list