Making the default CPython build more relocatable

  1. Writing prefix=${pcfiledir}/../.. instead of the absolute prefix in the installed python-3.16.pc and python-3.16-embed.pc (draft impl). Both pkg-config and pkgconf support pcfiledir, and this is how Conda and Homebrew ship their .pc files.

These changes are visible to anyone who looks at the installed files, but nothing should break for users of the default build. We’d rather avoid adding a new dimension (relocatability on/off) to the already large CI and buildbots test matrix. A flag would also mean two layouts for consumers to deal with, and the relocatable one would be the less tested one.

I would like to caution that ${pcfiledir}/../../ for cases where it
canonicalizes to /usr, is an actual issue. The pkg-config tool will
get confused and stop deduplicating system directories, and you can get
some fairly weird results.

e.g. Meson has a global option for this (it is automatically available
for all packages that ship pkg-config files):

Users can ask for a relocatable build (and perhaps you’d only test that
mode in CI), but users who don’t need them and aren’t planning to
relocate them, for example Linux distros packaging the software for
installation into /usr, can still choose to get artifacts which play
nice with installation into the system directories.

A flag to change the pkgconfig file does not necessarily imply a flag to
change the way the interpreter is compiled and installed.