gh-119696: Install build-details.json with relative paths (#161907)

`make install` writes `build-details.json` (PEP 739) with absolute paths, so the file is wrong once the installation is moved. Fixing that is one of the steps towards [relocatable CPython installations](https://discuss.python.org/t/making-the-default-cpython-build-more-relocatable/109937).

PEP 739 allows the paths to be relative to `base_prefix`, and `base_prefix` to be relative to the file's directory; `generate-build-details.py` already implements that behind `--relative-paths --config-file-path`. The Makefile now passes `--relative-paths` with a new `--installed-location` flag, which takes the file's installed path from `sysconfig` instead of from `$(LIBDEST)`, so that `make install prefix=...` (which the Android build uses) doesn't change the result.

The installed-file tests now resolve the paths like a consumer would, instead of skipping on a relocated installation.
5 files changed