# Migrate ac-style options to meson
list_remove LIBVIRT_OPTS \
	    --with{,out}-{uml,driver-modules,xen-inotify,avahi,hal} &&
for i in $LIBVIRT_OPTS; do
  case "$i" in
    (--without*) res=disabled ;;
    (--with*)    res=enabled  ;;
    (*)          continue     ;;
  esac &&
  list_remove LIBVIRT_OPTS "$i" &&
  i="${i#--*-}" &&
  case "$i" in
    (xenapi) i=driver_libxl ;;
    (network|qemu|vmware|esx|lxc|vbox|remote|libvirtd) i="driver_$i" ;;
  esac &&
  list_add LIBVIRT_OPTS "${i/-/_}=$res" || exit 1
done

config_query_option  LIBVIRT_OPTS  'Build mpath storage backend' y \
                     storage_mpath={enabled,disabled} &&

config_query_option  LIBVIRT_OPTS  'Build FileSystem storage backend' y \
                     storage_fs={enabled,disabled} &&

config_query_option  LIBVIRT_OPTS  'Build virtual network driver' y \
                     driver_network={enabled,disabled} &&

config_query_option  LIBVIRT_OPTS  'Build with QEMU/KVM support' y \
                     driver_qemu={enabled,disabled} &&

config_query_option  LIBVIRT_OPTS  'Build with VMWare Workstation/Player support' y \
                     driver_vmware={enabled,disabled} &&

config_query_option  LIBVIRT_OPTS  'Build with VMWare ESX/GSX support' y \
                     driver_esx={enabled,disabled} &&

config_query_option  LIBVIRT_OPTS  'Build Linux Containers (lxc) support' y \
                     driver_lxc={enabled,disabled} &&

config_query_option  LIBVIRT_OPTS  'Build VirtualBox support' y \
                     driver_vbox={enabled,disabled} &&

config_query_option  LIBVIRT_OPTS  'Build remote driver support?'  y  \
                     driver_remote={enabled,disabled} &&

config_query_option  LIBVIRT_OPTS  'Build libvirtd support?'  y  \
                     driver_libvirtd={enabled,disabled}
