[DTrace-devel] [oracle/dtrace-utils] 0191e4: build: add configure script
Nick Alcock
noreply at github.com
Wed Nov 29 15:59:32 UTC 2023
Branch: refs/heads/nix/review/configury
Home: https://github.com/oracle/dtrace-utils
Commit: 0191e4b578d25f43bf73c154910b2208d2683f0a
https://github.com/oracle/dtrace-utils/commit/0191e4b578d25f43bf73c154910b2208d2683f0a
Author: Nick Alcock <nick.alcock at oracle.com>
Date: 2023-11-29 (Wed, 29 Nov 2023)
Changed paths:
M GNUmakefile
M README.md
A configure
Log Message:
-----------
build: add configure script
This serves three purposes:
- let you bake configuration into build/config.* so that you don't
need to specify the same arguments to make repeatedly
- provide a somewhat familiar interface to builders
- provide more documentation for bits of the build configuration
which there was no place to document (notably Make variables
overridden by the user, which were documented only
intermittently in comments in the top-level GNUmakefile).
It is *not* generated by Autoconf but is a short and hopefully
comprehensible shell script.
Internally it's fairly boring.
Overrides of makefile variables go into a new config-vars.mk, which is
written as a unit, since their construction is very cheap and they don't
need the variable-by-variable, test-by- test construction process used for
variables that end up in config.{mk,h}.
Some of the help (for all the Makeconfig overrides) is printed by calling
"make help-overrides", which ultimately derives it from the Makeconfig
itself. (Unfortunately I can't see a way to generate the actual
write_config_var invocations from the same place, so there's still a bit of
extra work to do when you add new Makeconfig tests.)
The rest of the "make help" -- and really most of the configure script -- is
duplicative of stuff already in the GNUmakefile, but I can't see a way to
automate its generation without ending up with *way* more automation than we
have duplicated code here.
In the GNUmakefile, the biggest impact is making all the paths normal
recursively evaluated variables, so that they can pick up
configure-generated paths (which are defined later), and moving most of the
rest of the non-configure-modified variables down below the inclusion of
config-vars.mk. This gives the desired properties for defaulting:
- doing nothing causes the assignments in the Makefile to kick in
- defining stuff via configure causes them to be overridden by
further assignments in the config-vars.mk (which values are then
picked up by the moved-down assignments
- passing stuff on the make command line does what that normally
does, and suppresses the corresponding in-makefile variable
assignments, both in GNUmakefile itself and in config-vars.mk,
thus overriding both the defaults and configure-generated paths
Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
More information about the DTrace-devel
mailing list