1 c2man = find_program('c2man', required: false)
4 error('c2man is required to build documentation. Or disable with -Ddocs=false')
7 # Extract list of man pages (one man page per symbol) from lib/libfribidi.def
8 python3 = import('python3').find_python()
10 result = run_command(python3,
11 '-c', 'import sys; print(open(sys.argv[1], "r").read())',
12 files('../lib/fribidi.def'))
14 if result.returncode() != 0
15 error('Could not extract list of symbols from fribidi.def.')
20 syms = result.stdout().strip().split('\n')
22 # for consistency with autotools build and because we don't pass -v to c2man
23 if sym != 'fribidi_unicode_version' and sym != 'fribidi_version_info'
24 gen_man_pages += ['@0@.3'.format(sym)]
29 c2man_incs += ['-I' + join_paths(meson.source_root(), 'lib')]
30 c2man_incs += ['-I' + join_paths(meson.build_root(), 'lib')]
31 c2man_incs += ['-I' + join_paths(meson.source_root(), 'gen.tab')]
32 c2man_incs += ['-I' + join_paths(meson.build_root(), 'gen.tab')]
34 custom_target('man pages',
35 command: [c2man, '-T', 'n', '-M', 'Programmer\'s Manual', c2man_incs,
36 '-D__FRIBIDI_DOC', '-DDONT_HAVE_FRIBIDI_CONFIG_H',
37 '-o@0@'.format(meson.current_build_dir()),
39 depends: [fribidi_unicode_version_h],
40 output: gen_man_pages,
41 install_dir: join_paths(get_option('prefix'), get_option('mandir'), 'man3'),