]>
Commit | Line | Data |
---|---|---|
3a726fcd ZJS |
1 | # SPDX-License-Identifier: LGPL-2.1+ |
2 | # | |
3 | # Copyright 2017 Zbigniew Jędrzejewski-Szmek | |
4 | # | |
5 | # systemd is free software; you can redistribute it and/or modify it | |
6 | # under the terms of the GNU Lesser General Public License as published by | |
7 | # the Free Software Foundation; either version 2.1 of the License, or | |
8 | # (at your option) any later version. | |
9 | # | |
10 | # systemd is distributed in the hope that it will be useful, but | |
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | # Lesser General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU Lesser General Public License | |
16 | # along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
17 | ||
5c23128d | 18 | udevadm_sources = files(''' |
37efbbd8 ZJS |
19 | udevadm.c |
20 | udevadm-info.c | |
21 | udevadm-control.c | |
22 | udevadm-monitor.c | |
23 | udevadm-hwdb.c | |
24 | udevadm-settle.c | |
25 | udevadm-trigger.c | |
26 | udevadm-test.c | |
27 | udevadm-test-builtin.c | |
28 | udevadm-util.c | |
29 | udevadm-util.h | |
5c23128d ZJS |
30 | '''.split()) |
31 | ||
32 | systemd_udevd_sources = files('udevd.c') | |
33 | ||
34 | libudev_core_sources = ''' | |
37efbbd8 ZJS |
35 | udev.h |
36 | udev-event.c | |
37 | udev-watch.c | |
38 | udev-node.c | |
39 | udev-rules.c | |
40 | udev-ctrl.c | |
41 | udev-builtin.c | |
42 | udev-builtin-btrfs.c | |
43 | udev-builtin-hwdb.c | |
44 | udev-builtin-input_id.c | |
45 | udev-builtin-keyboard.c | |
46 | udev-builtin-net_id.c | |
47 | udev-builtin-net_setup_link.c | |
48 | udev-builtin-path_id.c | |
49 | udev-builtin-usb_id.c | |
50 | net/link-config.c | |
51 | net/link-config.h | |
52 | net/ethtool-util.c | |
53 | net/ethtool-util.h | |
5c23128d ZJS |
54 | '''.split() |
55 | ||
349cc4a5 | 56 | if conf.get('HAVE_KMOD') == 1 |
37efbbd8 | 57 | libudev_core_sources += ['udev-builtin-kmod.c'] |
5c23128d ZJS |
58 | endif |
59 | ||
349cc4a5 | 60 | if conf.get('HAVE_BLKID') == 1 |
37efbbd8 | 61 | libudev_core_sources += ['udev-builtin-blkid.c'] |
5c23128d ZJS |
62 | endif |
63 | ||
349cc4a5 | 64 | if conf.get('HAVE_ACL') == 1 |
37efbbd8 ZJS |
65 | libudev_core_sources += ['udev-builtin-uaccess.c', |
66 | logind_acl_c, | |
67 | sd_login_c] | |
5c23128d ZJS |
68 | endif |
69 | ||
70 | ############################################################ | |
71 | ||
72 | generate_keyboard_keys_list = find_program('generate-keyboard-keys-list.sh') | |
73 | keyboard_keys_list_txt = custom_target( | |
37efbbd8 ZJS |
74 | 'keyboard-keys-list.txt', |
75 | output : 'keyboard-keys-list.txt', | |
76 | command : [generate_keyboard_keys_list, cpp], | |
77 | capture : true) | |
5c23128d | 78 | |
1b833237 | 79 | generate_keyboard_keys_gperf = find_program('generate-keyboard-keys-gperf.sh') |
5c23128d ZJS |
80 | fname = 'keyboard-keys-from-name.gperf' |
81 | gperf_file = custom_target( | |
37efbbd8 ZJS |
82 | fname, |
83 | input : keyboard_keys_list_txt, | |
84 | output : fname, | |
1b833237 | 85 | command : [generate_keyboard_keys_gperf, '@INPUT@'], |
37efbbd8 | 86 | capture : true) |
5c23128d ZJS |
87 | |
88 | fname = 'keyboard-keys-from-name.h' | |
89 | keyboard_keys_from_name_h = custom_target( | |
37efbbd8 ZJS |
90 | fname, |
91 | input : gperf_file, | |
92 | output : fname, | |
93 | command : [gperf, | |
8ff213fd | 94 | '-L', 'ANSI-C', '-t', |
37efbbd8 ZJS |
95 | '-N', 'keyboard_lookup_key', |
96 | '-H', 'hash_key_name', | |
97 | '-p', '-C', | |
98 | '@INPUT@'], | |
99 | capture : true) | |
5c23128d ZJS |
100 | |
101 | ############################################################ | |
102 | ||
103 | link_config_gperf_c = custom_target( | |
37efbbd8 ZJS |
104 | 'link-config-gperf.c', |
105 | input : 'net/link-config-gperf.gperf', | |
106 | output : 'link-config-gperf.c', | |
107 | command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) | |
5c23128d ZJS |
108 | |
109 | ############################################################ | |
110 | ||
3a30f21f | 111 | if get_option('link-udev-shared') |
1aec3ed9 ZJS |
112 | udev_link_with = [libshared] |
113 | udev_rpath = rootlibexecdir | |
3a30f21f | 114 | else |
1aec3ed9 ZJS |
115 | udev_link_with = [libshared_static, |
116 | libsystemd_internal] | |
117 | udev_rpath = '' | |
3a30f21f ZJS |
118 | endif |
119 | ||
aac26058 | 120 | libudev_internal = static_library( |
37efbbd8 ZJS |
121 | 'udev', |
122 | libudev_sources, | |
123 | include_directories : includes, | |
1aec3ed9 | 124 | link_with : udev_link_with) |
aac26058 | 125 | |
69e96427 | 126 | libudev_core_includes = [includes, include_directories('net')] |
5c23128d | 127 | libudev_core = static_library( |
37efbbd8 ZJS |
128 | 'udev-core', |
129 | libudev_core_sources, | |
130 | link_config_gperf_c, | |
131 | keyboard_keys_from_name_h, | |
132 | include_directories : libudev_core_includes, | |
6671e818 | 133 | c_args : ['-DLOG_REALM=LOG_REALM_UDEV'], |
1aec3ed9 | 134 | link_with : udev_link_with, |
eb8124f6 | 135 | dependencies : [libblkid, libkmod]) |
3a30f21f ZJS |
136 | |
137 | foreach prog : [['ata_id/ata_id.c'], | |
138 | ['cdrom_id/cdrom_id.c'], | |
139 | ['collect/collect.c'], | |
140 | ['scsi_id/scsi_id.c', | |
141 | 'scsi_id/scsi_id.h', | |
142 | 'scsi_id/scsi_serial.c', | |
143 | 'scsi_id/scsi.h'], | |
144 | ['v4l_id/v4l_id.c'], | |
145 | ['mtd_probe/mtd_probe.c', | |
146 | 'mtd_probe/mtd_probe.h', | |
147 | 'mtd_probe/probe_smartmedia.c']] | |
148 | ||
37efbbd8 ZJS |
149 | executable(prog[0].split('/')[0], |
150 | prog, | |
151 | include_directories : includes, | |
5c72049f | 152 | c_args : ['-DLOG_REALM=LOG_REALM_UDEV'], |
37efbbd8 | 153 | link_with : [libudev_internal], |
1aec3ed9 | 154 | install_rpath : udev_rpath, |
37efbbd8 ZJS |
155 | install : true, |
156 | install_dir : udevlibexecdir) | |
3a30f21f | 157 | endforeach |
5c23128d ZJS |
158 | |
159 | install_data('udev.conf', | |
e17e5ba9 | 160 | install_dir : join_paths(sysconfdir, 'udev')) |
5c23128d ZJS |
161 | |
162 | udev_pc = configure_file( | |
37efbbd8 ZJS |
163 | input : 'udev.pc.in', |
164 | output : 'udev.pc', | |
165 | configuration : substs) | |
5c23128d ZJS |
166 | install_data(udev_pc, |
167 | install_dir : pkgconfigdatadir) | |
94e75a54 ZJS |
168 | |
169 | meson.add_install_script('sh', '-c', | |
e17e5ba9 | 170 | mkdir_p.format(join_paths(sysconfdir, 'udev/rules.d'))) |