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

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Thu Sep 5 17:14:21 CEST 2019


On 5 September 2019 at 16:53, Ralf Stubner wrote:
| 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

Make it four alternatives:

  * Call pkg-config from an autoconf configure script.  Examples:

  edd using rob:~$ grep -l pkg-config git/*/configure.{ac,in}
  git/libxls/configure.ac
  git/nloptr/configure.ac
  git/rcppmlpack2/configure.ac
  git/rcppredis/configure.ac
  git/rprotobuf/configure.ac
  edd using rob:~$

I know all the cool kids these days hate autoconf, but it a) really is just
careful (and more portable) shell scripting (plus some extra glue).  And it
b) avoids having users on some marginal OSs yell at you when they do not have
bash (just yesterday a Nix user had to comment on a five year old bug in that
is no longer valid as we went back to autoconf there too).  As an extra bonus
it c) also works on Slowlaris.

Best, Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-package-devel mailing list