From 1baefdf7d6ccde47f6e25d9db50b06e96b9212db Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Wed, 22 Aug 2012 11:26:26 -0700 Subject: [PATCH] Discourage repeated usage of VARIABLE-PREFIX in PKG_CHECK_MODULES When the VARIABLE-PREFIX tag is used more than once in PKG_CHECK_MODULES it can result in later runs reporting success without actually running pkg-config. This is because PKG_CHECK_MODULES looks for FOO_CFLAGS and FOO_LIBS from the environment as a way to allow users to override the test. PKG_CHECK_MODULES also sets these variables, though, and subsequent calls will simply use these values. Although there are legitimate ways to use the same VARIABLE-PREFIX (e.g., they're all under conditionals meaning only one will be used), document that repeated usage is not recommended. Freedesktop #3550 --- pkg-config.1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg-config.1 b/pkg-config.1 index aba3758..e8df5b3 100644 --- a/pkg-config.1 +++ b/pkg-config.1 @@ -323,6 +323,11 @@ use to display what went wrong. Note that if there is a possibility the first call to PKG_CHECK_MODULES might not happen, you should be sure to include an explicit call to PKG_PROG_PKG_CONFIG in your configure.ac. + +Also note that repeated usage of VARIABLE-PREFIX is not recommended. +After the first successful usage, subsequent calls with the same +VARIABLE-PREFIX will simply use the _LIBS and _CFLAGS variables set from +the previous usage without calling \fIpkg-config\fP again. .\" .TP .I "PKG_PROG_PKG_CONFIG([MIN-VERSION])"