On 8 April 2019 at 10:59, Travers Ching wrote: | I think the correct way to do it is through the configure script. See | for example the Cairo package that uses pkg-config. Configure scripts | are slightly hard to work through in my experience, but are worth it | if you need customization of the installation environment.
Or from the RcppRedis package you and I stand behind :) [...] ## ... but check for pkg-config AC_DEFUN([AC_PROG_PKGCONFIG], [AC_CHECK_PROG(PKGCONFIG,pkg-config,yes)]) AC_PROG_PKGCONFIG ## use pkg-config for hiredis ## if test x"${PKGCONFIG}" == x"yes"; then ## check via pkg-config for hiredis if pkg-config --exists hiredis; then ## obtain cflags and obtain libs hiredis_cxxflags=`pkg-config --cflags hiredis` hiredis_libs=`pkg-config --libs hiredis` ## no need to build libhiredis.a hiredis_tgt="" else AC_MSG_WARN([pkg-config exists but hiredis is not available.]) fi fi ## And make sure these flags are used for the tests below. CPPFLAGS="${hiredis_cxxflags} ${CPPFLAGS}" CXXFLAGS="${hiredis_cxxflags} ${CXXFLAGS}" [...] There is more at https://github.com/eddelbuettel/rcppredis/blob/master/configure.ac but is a key part. Another useful trick is to just write a shell script 'configure' as one does not have to use 'autoconf' to produce 'configure' see eg https://github.com/Rblp/Rblpapi/blob/master/configure for that approach, or one of Jeroen's packages. Last but not least you can call 'pkg-config' directly from src/Makevars too. 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