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@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@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 | e...@debian.org ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel