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
This commit is contained in:
Dan Nicholson 2012-08-22 11:26:26 -07:00
parent 617963c55e
commit 1baefdf7d6

View file

@ -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])"