On 2021-10-17 12:32 , Karl Berry wrote:
https://git.savannah.gnu.org/cgit/automake.git/commit/m4/python.m4?id=ed8daa069a6c8ed34f7856c42402ec46f305e670
However, this change leads to pkg-config .pc files containing the
variable name $PYTHON_PREFIX, not its content
I admit I didn't test much explicitly, but my understanding was that the
use of ${PYTHON_PREFIX} in various places instead of its value was
intentional, to allow for overriding at make time.
Thus, whatever the process is for creating .pc files, I guess it
may need to change. A previous setting in the Makefile.am should yield
the value of PYTHON_PREFIX to be substituted.
The documentation mentions in several places that the variables set by
Automake are only really designed to be used in the Makefiles that it
generates. Using AC_SUBST to directly substitute them into other kinds
of files comes with the risk of exactly this kind of thing happening.
You could equally complain that some variables you want to use in the
.pc file are defined in terms of $prefix; except it just happens that
most .pc files already contain a prefix variable, so it works.
As Karl alluded to, if you want the fully expanded path, the .pc file
needs to be generated by make, not configure. If you don't do it that
way, the way these Makefile variables are defined will change and break
your non-Makefiles sometimes.
- Josh