]>
Commit | Line | Data |
---|---|---|
3a726fcd ZJS |
1 | # SPDX-License-Identifier: LGPL-2.1+ |
2 | # | |
3 | # Copyright 2017 Zbigniew Jędrzejewski-Szmek | |
3a726fcd | 4 | |
5c23128d | 5 | udevadm_sources = files(''' |
37efbbd8 ZJS |
6 | udevadm.c |
7 | udevadm-info.c | |
8 | udevadm-control.c | |
9 | udevadm-monitor.c | |
10 | udevadm-hwdb.c | |
11 | udevadm-settle.c | |
12 | udevadm-trigger.c | |
13 | udevadm-test.c | |
14 | udevadm-test-builtin.c | |
15 | udevadm-util.c | |
16 | udevadm-util.h | |
5c23128d ZJS |
17 | '''.split()) |
18 | ||
19 | systemd_udevd_sources = files('udevd.c') | |
20 | ||
21 | libudev_core_sources = ''' | |
37efbbd8 ZJS |
22 | udev.h |
23 | udev-event.c | |
24 | udev-watch.c | |
25 | udev-node.c | |
26 | udev-rules.c | |
27 | udev-ctrl.c | |
28 | udev-builtin.c | |
29 | udev-builtin-btrfs.c | |
30 | udev-builtin-hwdb.c | |
31 | udev-builtin-input_id.c | |
32 | udev-builtin-keyboard.c | |
33 | udev-builtin-net_id.c | |
34 | udev-builtin-net_setup_link.c | |
35 | udev-builtin-path_id.c | |
36 | udev-builtin-usb_id.c | |
37 | net/link-config.c | |
38 | net/link-config.h | |
39 | net/ethtool-util.c | |
40 | net/ethtool-util.h | |
5c23128d ZJS |
41 | '''.split() |
42 | ||
349cc4a5 | 43 | if conf.get('HAVE_KMOD') == 1 |
37efbbd8 | 44 | libudev_core_sources += ['udev-builtin-kmod.c'] |
5c23128d ZJS |
45 | endif |
46 | ||
349cc4a5 | 47 | if conf.get('HAVE_BLKID') == 1 |
37efbbd8 | 48 | libudev_core_sources += ['udev-builtin-blkid.c'] |
5c23128d ZJS |
49 | endif |
50 | ||
349cc4a5 | 51 | if conf.get('HAVE_ACL') == 1 |
37efbbd8 | 52 | libudev_core_sources += ['udev-builtin-uaccess.c', |
2f5fa62b | 53 | logind_acl_c, |
37efbbd8 | 54 | sd_login_c] |
5c23128d ZJS |
55 | endif |
56 | ||
57 | ############################################################ | |
58 | ||
59 | generate_keyboard_keys_list = find_program('generate-keyboard-keys-list.sh') | |
60 | keyboard_keys_list_txt = custom_target( | |
37efbbd8 ZJS |
61 | 'keyboard-keys-list.txt', |
62 | output : 'keyboard-keys-list.txt', | |
63 | command : [generate_keyboard_keys_list, cpp], | |
64 | capture : true) | |
5c23128d | 65 | |
1b833237 | 66 | generate_keyboard_keys_gperf = find_program('generate-keyboard-keys-gperf.sh') |
5c23128d ZJS |
67 | fname = 'keyboard-keys-from-name.gperf' |
68 | gperf_file = custom_target( | |
37efbbd8 ZJS |
69 | fname, |
70 | input : keyboard_keys_list_txt, | |
71 | output : fname, | |
1b833237 | 72 | command : [generate_keyboard_keys_gperf, '@INPUT@'], |
37efbbd8 | 73 | capture : true) |
5c23128d ZJS |
74 | |
75 | fname = 'keyboard-keys-from-name.h' | |
76 | keyboard_keys_from_name_h = custom_target( | |
37efbbd8 ZJS |
77 | fname, |
78 | input : gperf_file, | |
79 | output : fname, | |
80 | command : [gperf, | |
8ff213fd | 81 | '-L', 'ANSI-C', '-t', |
37efbbd8 ZJS |
82 | '-N', 'keyboard_lookup_key', |
83 | '-H', 'hash_key_name', | |
84 | '-p', '-C', | |
85 | '@INPUT@'], | |
86 | capture : true) | |
5c23128d ZJS |
87 | |
88 | ############################################################ | |
89 | ||
90 | link_config_gperf_c = custom_target( | |
37efbbd8 ZJS |
91 | 'link-config-gperf.c', |
92 | input : 'net/link-config-gperf.gperf', | |
93 | output : 'link-config-gperf.c', | |
94 | command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) | |
5c23128d ZJS |
95 | |
96 | ############################################################ | |
97 | ||
3a30f21f | 98 | if get_option('link-udev-shared') |
1aec3ed9 ZJS |
99 | udev_link_with = [libshared] |
100 | udev_rpath = rootlibexecdir | |
3a30f21f | 101 | else |
1aec3ed9 | 102 | udev_link_with = [libshared_static, |
37e4d7a8 | 103 | libsystemd_static] |
1aec3ed9 | 104 | udev_rpath = '' |
3a30f21f ZJS |
105 | endif |
106 | ||
0c06b506 ZJS |
107 | libudev_basic = static_library( |
108 | 'udev-basic', | |
37efbbd8 ZJS |
109 | libudev_sources, |
110 | include_directories : includes, | |
0c06b506 ZJS |
111 | c_args : ['-fvisibility=default']) |
112 | ||
113 | libudev_static = static_library( | |
70848ecf | 114 | 'udev_static', |
0c06b506 ZJS |
115 | 'udev.h', |
116 | include_directories : includes, | |
117 | link_with : udev_link_with, | |
118 | link_whole : libudev_basic) | |
119 | ||
70848ecf | 120 | static_libudev = get_option('static-libudev') |
20f3d32d | 121 | static_libudev_pic = static_libudev == 'true' or static_libudev == 'pic' |
70848ecf DC |
122 | install_libudev_static = static_library( |
123 | 'udev', | |
124 | libudev_sources, | |
125 | include_directories : includes, | |
126 | link_with : [libshared_static, | |
127 | libsystemd_static], | |
128 | link_whole : libudev_basic, | |
129 | build_by_default : static_libudev != 'false', | |
130 | install : static_libudev != 'false', | |
131 | install_dir : rootlibdir, | |
132 | link_depends : libudev_sym, | |
133 | dependencies : [threads], | |
20f3d32d DC |
134 | c_args : static_libudev_pic ? [] : ['-fno-PIC'], |
135 | pic : static_libudev_pic) | |
70848ecf | 136 | |
0c06b506 ZJS |
137 | libudev = shared_library( |
138 | 'udev', | |
7f1ea2cc | 139 | 'udev.h', # pick a header file at random to work around old meson bug |
0c06b506 ZJS |
140 | version : libudev_version, |
141 | include_directories : includes, | |
142 | link_args : ['-shared', | |
143 | '-Wl,--version-script=' + libudev_sym_path], | |
144 | link_with : [libsystemd_static, libshared_static], | |
145 | link_whole : libudev_basic, | |
146 | dependencies : [threads], | |
147 | link_depends : libudev_sym, | |
148 | install : true, | |
149 | install_dir : rootlibdir) | |
aac26058 | 150 | |
69e96427 | 151 | libudev_core_includes = [includes, include_directories('net')] |
5c23128d | 152 | libudev_core = static_library( |
37efbbd8 ZJS |
153 | 'udev-core', |
154 | libudev_core_sources, | |
155 | link_config_gperf_c, | |
156 | keyboard_keys_from_name_h, | |
157 | include_directories : libudev_core_includes, | |
6671e818 | 158 | c_args : ['-DLOG_REALM=LOG_REALM_UDEV'], |
1aec3ed9 | 159 | link_with : udev_link_with, |
eb8124f6 | 160 | dependencies : [libblkid, libkmod]) |
3a30f21f ZJS |
161 | |
162 | foreach prog : [['ata_id/ata_id.c'], | |
163 | ['cdrom_id/cdrom_id.c'], | |
164 | ['collect/collect.c'], | |
165 | ['scsi_id/scsi_id.c', | |
166 | 'scsi_id/scsi_id.h', | |
167 | 'scsi_id/scsi_serial.c', | |
168 | 'scsi_id/scsi.h'], | |
169 | ['v4l_id/v4l_id.c'], | |
170 | ['mtd_probe/mtd_probe.c', | |
171 | 'mtd_probe/mtd_probe.h', | |
172 | 'mtd_probe/probe_smartmedia.c']] | |
173 | ||
37efbbd8 ZJS |
174 | executable(prog[0].split('/')[0], |
175 | prog, | |
176 | include_directories : includes, | |
5c72049f | 177 | c_args : ['-DLOG_REALM=LOG_REALM_UDEV'], |
0c06b506 | 178 | link_with : [libudev_static], |
1aec3ed9 | 179 | install_rpath : udev_rpath, |
37efbbd8 ZJS |
180 | install : true, |
181 | install_dir : udevlibexecdir) | |
3a30f21f | 182 | endforeach |
5c23128d ZJS |
183 | |
184 | install_data('udev.conf', | |
e17e5ba9 | 185 | install_dir : join_paths(sysconfdir, 'udev')) |
5c23128d ZJS |
186 | |
187 | udev_pc = configure_file( | |
37efbbd8 ZJS |
188 | input : 'udev.pc.in', |
189 | output : 'udev.pc', | |
190 | configuration : substs) | |
5c23128d ZJS |
191 | install_data(udev_pc, |
192 | install_dir : pkgconfigdatadir) | |
94e75a54 ZJS |
193 | |
194 | meson.add_install_script('sh', '-c', | |
e17e5ba9 | 195 | mkdir_p.format(join_paths(sysconfdir, 'udev/rules.d'))) |