Bug 17346 - Storing PKG_CONFIG_PATH in Makeconf
Summary: Storing PKG_CONFIG_PATH in Makeconf
Alias: None
Product: R
Classification: Unclassified
Component: Installation (show other bugs)
Version: R 3.4.1
Hardware: Other Other
: P5 enhancement
Assignee: R-core
Depends on:
Reported: 2017-09-29 12:38 UTC by Jeroen Ooms
Modified: 2017-09-29 12:38 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Ooms 2017-09-29 12:38:50 UTC
It would be useful to store the 'PKG_CONFIG_PATH' variable that was used to build R in the ./etc/Makeconf file (along with CC, CXX, etc). This would allow packages to link against the same libraries as R itself.

My immediate use case is on that MacOS, binary packages should be able link against XQuartz libraries, if R itself also does this. The CRAN build for MacOS currently builds against XQuartz as we can see from the comment '/opt/X11/lib/pkgconfig' in:

   grep PKG_CONFIG_PATH $(R RHOME)/etc/Makeconf

When building binary packages for this version of R (which already depends on XQuartz) I want take advantage of the same PKG_CONFIG_PATH. However there are also MacOS builds of R that avoid the XQuartz dependency. On these builds we should not include '/opt/X11/lib/pkgconfig' in PKG_CONFIG_PATH when building packages.

Therefore being able to call 'R CMD config PKG_CONFIG_PATH' would be very helpful.

In addition one could even consider letting R automatically set 'PKG_CONFIG_PATH' to match that of R when running package configure scripts. Thereby packages that use pkg-config in their configure script will automatically be able to take advantage of the libraries that R itself already depends on.