-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
70 lines (59 loc) · 1.62 KB
/
meson.build
File metadata and controls
70 lines (59 loc) · 1.62 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
project('libfreeinit', 'c', version: '0.1')
pkgconfig = import('pkgconfig')
cc = meson.get_compiler('c')
args = []
if cc.has_function('vasprintf', args: '-D_GNU_SOURCE')
args = ['-D_GNU_SOURCE']
elif cc.has_function('vasprintf', args: '-D_BSD_SOURCE')
args = ['-D_BSD_SOURCE']
endif
libsystemd_link = get_option('libsystemd_links')
libfreeinit = library(
'freeinit',
'libfreeinit.c',
c_args: args,
version: '0.1',
soversion: 1,
install: true,
)
libfreeinit_sd_daemon = library(
'freeinit-sd-daemon',
'libfreeinit-sd-daemon.c',
c_args: args,
version: '0.1',
soversion: 1,
install: true,
link_with: [libfreeinit],
)
pkgconfig.generate(
libfreeinit,
name: 'libfreeinit',
description: 'Init system/daemon communication library',
version: '0.1',
filebase: 'libfreeinit',
)
pkgconfig.generate(
libfreeinit_sd_daemon,
name: 'libfreeinit-sd-daemon',
description: 'libfreeinit sd-daemon stub',
version: '0.1',
filebase: 'libfreeinit-sd-daemon',
)
install_headers('libfreeinit.h', subdir: 'freeinit')
install_headers('sd-daemon.h', subdir: 'freeinit')
if libsystemd_link
includedir = get_option('includedir')
libdir = get_option('libdir')
pkgconfig_dir = join_paths(libdir, 'pkgconfig')
install_symlink(
'libsystemd.so',
install_dir: libdir,
pointing_to: 'libfreeinit-sd-daemon.so',
)
install_symlink(
'libsystemd.pc',
install_dir: pkgconfig_dir,
pointing_to: 'libfreeinit-sd-daemon.pc',
)
install_symlink('systemd', install_dir: includedir, pointing_to: 'freeinit')
endif