From c2b1b9236b628d4cb24e3216a5b5e2499508136d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Oct 2021 11:53:50 +0100 Subject: [PATCH] ts-xen-build: Pass --enable if --disable found in usage, and v.v. The existing code works in practice if the usage message always lists the non-default, since the unlisted-in-usage options that would be supported, but are elided, are in any case the default. But configure might *compute* its defaults. In which case it will list only one of them in the usage message. If the computed default is not the same as the usual default (the one implied by listing the opposite in the usage message) we would wrongly not pass the option. So grep for both enable and disable. Signed-off-by: Ian Jackson Reviewed-by: Juergen Gross --- ts-xen-build | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ts-xen-build b/ts-xen-build index d6f6bfa..c294a51 100755 --- a/ts-xen-build +++ b/ts-xen-build @@ -142,12 +142,20 @@ END } sub build () { + # We want to explicitly enable and disable some things. But not + # all versions of Xen support all configuration options. We + # detect presence of an option by grepping configure. That finds + # them in the usage message. The usage message has only one of + # the two, depending on the usual default. (Presence of --enable + # in the usage output means --disable is supported, and vice + # versa.) So we search for both enable and disable, and if either + # is found, we use the one we want. my $enable_opts = ''; # shell script to set "enable_opts" shell var my $enable_disable = sub { my ($subdir, $feat, $enable) = @_; my $opt = "--".($enable ? 'enable' : 'disable')."-$feat"; $enable_opts .= <