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