Adds a new `port prefix` command that prints MacPorts' installation prefix on
stdout, unadorned, so it can be used directly in shell scripts.
Closes: https://trac.macports.org/ticket/72961
GNU Make tries to remake any included makefile, so `include
Mk/macports.autoconf.mk` causes the top-level `Mk/macports.autoconf.mk:`
rule to fire. That rule depends on `config.status`, whose rule re-runs
`./config.status --recheck` (effectively `./configure`), and the
autoconf.mk recipe then runs `make clean` as a side effect.
The result: `make clean` and `make distclean` both trigger a configure
run before cleaning, which is wasteful and surprising.
Skip the regeneration rules entirely when the only goals on the command
line are clean or distclean. Any other goal (or the default build)
still picks up configuration changes as before.
During selfupdate, only a few configure arguments (--prefix,
--with-install-user, --with-install-group, --with-directory-mode)
were reconstructed and passed to configure. Other arguments such as
--with-curlprefix, --with-applications-dir, --with-frameworks-dir,
and tool paths were silently lost.
Save the original configure arguments to
$prefix/share/macports/configure_args during make install, and read
them back during selfupdate. Fall back to the previous reconstruction
logic when upgrading from an older version that lacks the saved file.
Closes: https://trac.macports.org/ticket/73670
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>