}
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