-
Notifications
You must be signed in to change notification settings - Fork 146
Expand file tree
/
Copy pathmeson.build
More file actions
107 lines (91 loc) · 2.92 KB
/
Copy pathmeson.build
File metadata and controls
107 lines (91 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
project('irqbalance', 'c',
version: '1.9.5',
default_options: ['warning_level=1'],
meson_version: '>=0.54.0',
)
cc = meson.get_compiler('c')
glib_dep = dependency('glib-2.0')
m_dep = cc.find_library('m', required: false)
capng_dep = dependency('libcap-ng', required: get_option('capng'))
ncurses_dep = dependency('curses', required: get_option('ui'))
numa_dep = cc.find_library('numa', required: get_option('numa'))
libnl_3_dep = dependency('libnl-3.0', required: get_option('thermal'))
libnl_genl_3_dep = dependency('libnl-genl-3.0', required: get_option('thermal'))
systemd_dep = dependency('libsystemd', required: get_option('systemd'))
systemd_dir_dep = dependency('systemd', required: get_option('systemd'))
systemdsystemunitdir = systemd_dir_dep.get_variable(
pkgconfig: 'systemdsystemunitdir',
default_value: get_option('prefix') / 'lib/systemd/system'
)
cdata = configuration_data()
cdata.set('HAVE_GETOPT_LONG', cc.has_function('getopt_long'))
cdata.set('HAVE_IRQBALANCEUI', ncurses_dep.found())
cdata.set('HAVE_NUMA_H', cc.has_header('numa.h') and numa_dep.found())
cdata.set('HAVE_THERMAL', libnl_3_dep.found() and libnl_genl_3_dep.found())
cdata.set('HAVE_LIBCAP_NG', capng_dep.found())
cdata.set('HAVE_LIBSYSTEMD', systemd_dep.found())
cdata.set_quoted('VERSION', meson.project_version())
cfile = configure_file(output: 'config.h', configuration: cdata)
if cdata.get('HAVE_IRQBALANCEUI')
add_project_arguments('-D_GNU_SOURCE', language: 'c')
executable(
'irqbalance-ui',
'ui/helpers.c',
'ui/irqbalance-ui.c',
'ui/ui.c',
dependencies: [glib_dep, ncurses_dep],
install: true,
install_dir : get_option('sbindir'),
)
install_man('irqbalance-ui.1')
endif
irqbalance_sources = files(
'activate.c',
'bitmap.c',
'classify.c',
'cputree.c',
'irqbalance.c',
'irqlist.c',
'numa.c',
'placement.c',
'procinterrupts.c',
)
if libnl_3_dep.found() and libnl_genl_3_dep.found()
irqbalance_sources += files(
'thermal.c',
)
endif
executable(
'irqbalance',
irqbalance_sources,
dependencies: [glib_dep, m_dep, capng_dep, libnl_3_dep, libnl_genl_3_dep, numa_dep, systemd_dep],
install: true,
install_dir : get_option('sbindir'),
)
install_man('irqbalance.1')
if systemd_dep.found() or get_option('systemd-service')
pkgconfdir = get_option('pkgconfdir')
usrconfdir = get_option('usrconfdir')
# Set defaults
if pkgconfdir == ''
pkgconfdir = get_option('prefix') / 'etc/default'
endif
if usrconfdir == ''
usrconfdir = get_option('sysconfdir') / 'default'
endif
idata = configuration_data()
idata.set('usrconfdir', usrconfdir)
idata.set('pkgconfdir', pkgconfdir)
configure_file(
input: 'misc/irqbalance.service.in',
output: 'irqbalance.service',
install_dir: systemdsystemunitdir,
configuration: idata
)
configure_file(
input: 'misc/irqbalance.env',
output: 'irqbalance.env',
install_dir: pkgconfdir,
configuration: idata
)
endif