if get_option('sphinx_build') == ''
  sphinx_build = find_program(['sphinx-build-3', 'sphinx-build'],
                              required: get_option('docs'))
else
  sphinx_build = find_program(get_option('sphinx_build'),
                              required: get_option('docs'))
endif

# Check if tools are available to build documentation.
build_docs = false
if sphinx_build.found()
  SPHINX_ARGS = ['env', 'CONFDIR=' + qemu_confdir, sphinx_build]
  # If we're making warnings fatal, apply this to Sphinx runs as well
  if get_option('werror')
    SPHINX_ARGS += [ '-W' ]
  endif

  # This is a bit awkward but works: create a trivial document and
  # try to run it with our configuration file (which enforces a
  # version requirement). This will fail if sphinx-build is too old.
  run_command('mkdir', ['-p', tmpdir / 'sphinx'])
  run_command('touch', [tmpdir / 'sphinx/index.rst'])
  sphinx_build_test_out = run_command(SPHINX_ARGS + [
    '-c', meson.current_source_dir(),
    '-b', 'html', tmpdir / 'sphinx',
    tmpdir / 'sphinx/out'])
  build_docs = (sphinx_build_test_out.returncode() == 0)

  if not build_docs
    warning('@0@ is either too old or uses too old a Python version'
            .format(sphinx_build.full_path()))
    if get_option('docs').enabled()
      error('Install a Python 3 version of python-sphinx')
    endif
  endif
endif

if build_docs
  SPHINX_ARGS += ['-Dversion=' + meson.project_version(), '-Drelease=' + config_host['PKGVERSION']]

  sphinx_extn_depends = [ meson.source_root() / 'docs/sphinx/depfile.py',
                          meson.source_root() / 'docs/sphinx/hxtool.py',
                          meson.source_root() / 'docs/sphinx/kerneldoc.py',
                          meson.source_root() / 'docs/sphinx/kernellog.py',
                          meson.source_root() / 'docs/sphinx/qapidoc.py',
                          meson.source_root() / 'docs/sphinx/qmp_lexer.py',
                          qapi_gen_depends ]

  configure_file(output: 'index.html',
                 input: files('index.html.in'),
                 configuration: {'VERSION': meson.project_version()},
                 install_dir: qemu_docdir)
  manuals = [ 'devel', 'interop', 'tools', 'specs', 'system', 'user' ]
  man_pages = {
    'interop' : {
        'qemu-ga.8': (have_tools ? 'man8' : ''),
        'qemu-ga-ref.7': 'man7',
        'qemu-qmp-ref.7': 'man7',
    },
    'tools': {
        'qemu-img.1': (have_tools ? 'man1' : ''),
        'qemu-nbd.8': (have_tools ? 'man8' : ''),
        'qemu-pr-helper.8': (have_tools ? 'man8' : ''),
        'qemu-trace-stap.1': (config_host.has_key('CONFIG_TRACE_SYSTEMTAP') ? 'man1' : ''),
        'virtfs-proxy-helper.1': (have_virtfs_proxy_helper ? 'man1' : ''),
        'virtiofsd.1': (have_virtiofsd ? 'man1' : ''),
    },
    'system': {
        'qemu.1': 'man1',
        'qemu-block-drivers.7': 'man7',
        'qemu-cpu-models.7': 'man7'
    },
  }

  sphinxdocs = []
  sphinxmans = []
  foreach manual : manuals
    private_dir = meson.current_build_dir() / (manual + '.p')
    output_dir = meson.current_build_dir() / manual
    input_dir = meson.current_source_dir() / manual

    this_manual = custom_target(manual + ' manual',
                build_by_default: build_docs,
                output: [manual + '.stamp'],
                input: [files('conf.py'), files(manual / 'conf.py')],
                depfile: manual + '.d',
                depend_files: sphinx_extn_depends,
                command: [SPHINX_ARGS, '-Ddepfile=@DEPFILE@',
                          '-Ddepfile_stamp=@OUTPUT0@',
                          '-b', 'html', '-d', private_dir,
                          input_dir, output_dir])
    sphinxdocs += this_manual
    if build_docs and manual != 'devel'
      install_subdir(output_dir, install_dir: qemu_docdir)
    endif

    these_man_pages = []
    install_dirs = []
    foreach page, section : man_pages.get(manual, {})
      these_man_pages += page
      install_dirs += section == '' ? false : get_option('mandir') / section
    endforeach
    if these_man_pages.length() > 0
      sphinxmans += custom_target(manual + ' man pages',
                         build_by_default: build_docs,
                         output: these_man_pages,
                         input: this_manual,
                         install: build_docs,
                         install_dir: install_dirs,
                         command: [SPHINX_ARGS, '-b', 'man', '-d', private_dir,
                                   input_dir, meson.current_build_dir()])
    endif
  endforeach
  alias_target('sphinxdocs', sphinxdocs)
  alias_target('html', sphinxdocs)
  alias_target('man', sphinxmans)
endif
