2 version: run_command('./src/git_tag.sh', check: true).stdout().strip(),
3 license: 'GPL-2.0-or-later',
4 meson_version: '>=0.51',
8 'buildtype=debugoptimized',
12 dir_run_state = get_option('runstatedir')
13 opt_crypto = get_option('crypto')
14 opt_curses = get_option('curses')
15 opt_docs = get_option('docs')
16 opt_harden = get_option('hardening')
17 opt_jumbograms = get_option('jumbograms')
18 opt_lz4 = get_option('lz4')
19 opt_lzo = get_option('lzo')
20 opt_miniupnpc = get_option('miniupnpc')
21 opt_readline = get_option('readline')
22 opt_static = get_option('static')
23 opt_systemd = get_option('systemd')
24 opt_tests = get_option('tests')
25 opt_tunemu = get_option('tunemu')
26 opt_uml = get_option('uml')
27 opt_vde = get_option('vde')
28 opt_zlib = get_option('zlib')
30 meson_version = meson.version()
32 cc = meson.get_compiler('c')
33 os_name = host_machine.system()
36 cc_defs = ['-D_GNU_SOURCE']
41 static = os_name == 'windows'
43 static = opt_static.enabled()
52 '-D_FORTIFY_SOURCE=2',
54 '-fno-strict-overflow',
56 '-Wold-style-definition',
57 '-Wmissing-declarations',
58 '-Wmissing-prototypes',
59 '-Wstrict-prototypes',
61 '-Wbad-function-cast',
63 '-fdiagnostics-show-option',
68 cc_flags += '-Qunused-arguments'
70 ld_flags += ['-Wl,-z,relro', '-Wl,-z,now']
71 if os_name == 'windows'
72 ld_flags += ['-Wl,--dynamicbase', '-Wl,--nxcompat']
76 cc_flags = cc.get_supported_arguments(cc_flags)
77 ld_flags = cc.get_supported_link_arguments(ld_flags)
79 add_project_arguments(cc_flags, language: 'c')
80 add_project_link_arguments(ld_flags, language: 'c')
82 build_root = meson.current_build_dir()
83 src_root = meson.current_source_dir()
85 prefix = get_option('prefix')
86 dir_bin = prefix / get_option('bindir')
87 dir_data = prefix / get_option('datadir')
88 dir_info = prefix / get_option('infodir')
89 dir_lib = prefix / get_option('libdir')
90 dir_local_state = prefix / get_option('localstatedir')
91 dir_locale = prefix / get_option('localedir')
92 dir_man = prefix / get_option('mandir')
93 dir_sbin = prefix / get_option('sbindir')
94 dir_sysconf = prefix / get_option('sysconfdir')
96 if dir_run_state == ''
97 dir_run_state = dir_local_state / 'run'
100 if not opt_docs.disabled()
106 if not opt_tests.disabled()
110 subdir('bash_completion.d')
112 if os_name == 'linux' and not opt_systemd.disabled()
116 prog_reformat = find_program('astyle', native: true, required: false)
117 if prog_reformat.found()
118 run_target('reformat', command: [
120 '--options=@SOURCE_ROOT@/.astylerc',
121 '@SOURCE_ROOT@/*.c', '@SOURCE_ROOT@/*.h',