@@ -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 .= <<END;
- if grep -q -- $opt \\
+ if egrep -q -- '--disable-$feat|--enable-$feat' \\
${subdir}configure ; then
enable_opts="\$enable_opts $opt"
fi
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 <iwj@xenproject.org> CC: Juergen Gross <jgross@suse.com> --- ts-xen-build | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)