|
91 | 91 |
|
92 | 92 | # Check for libsystemd availability. Optional, only required for MCTP dbus scan |
93 | 93 | libsystemd_dep = dependency('libsystemd', version: '>219', required: false) |
94 | | -conf.set('CONFIG_LIBSYSTEMD', libsystemd_dep.found(), description: 'Is libsystemd(>219) available?') |
| 94 | +if libsystemd_dep.found() |
| 95 | + if cc.links('''#include <systemd/sd-bus.h> |
| 96 | + int main(void) { |
| 97 | + struct sd_bus *ret; |
| 98 | + return sd_bus_default(&ret); |
| 99 | + } |
| 100 | + ''', |
| 101 | + dependencies: libsystemd_dep, |
| 102 | + name: 'Link check') |
| 103 | + conf.set('CONFIG_LIBSYSTEMD', libsystemd_dep.found(), description: 'Is libsystemd(>219) available?') |
| 104 | + else |
| 105 | + libsystemd_dep = dependency('', required: false) |
| 106 | + endif |
| 107 | +endif |
95 | 108 |
|
96 | 109 | # local (cross-compilable) implementations of ccan configure steps |
97 | 110 | conf.set10( |
@@ -180,24 +193,20 @@ conf.set10( |
180 | 193 | description: 'Is linux/mctp.h include-able?' |
181 | 194 | ) |
182 | 195 |
|
183 | | -if meson.version().version_compare('>= 0.48') |
184 | | - has_fallthrough = cc.has_function_attribute('fallthrough') |
185 | | -else |
186 | | - has_fallthrough = cc.compiles( |
187 | | - '''int main(int argc, char **argv) { |
188 | | - switch(argc) { |
189 | | - case 0: |
190 | | - __attribute__((__fallthrough__)); |
191 | | - case 1: |
192 | | - return 1; |
193 | | - } |
194 | | - return 0; |
195 | | - } |
196 | | - ''', |
197 | | - name: 'has fallthrough') |
198 | | -endif |
| 196 | +conf.set( |
| 197 | + 'HAVE_LIBNSS', |
| 198 | + cc.links( |
| 199 | + '''int main(int argc, char **argv) { |
| 200 | + struct addrinfo hints, *result; |
| 201 | + return getaddrinfo(argv[1], argv[2], &hints, &result); |
| 202 | + } |
| 203 | + ''', |
| 204 | + name: 'havelibnss', |
| 205 | + ), |
| 206 | + description: 'Is network address and service translation available' |
| 207 | +) |
199 | 208 |
|
200 | | -if has_fallthrough |
| 209 | +if cc.has_function_attribute('fallthrough') |
201 | 210 | conf.set('fallthrough', '__attribute__((__fallthrough__))') |
202 | 211 | else |
203 | 212 | conf.set('fallthrough', 'do {} while (0) /* fallthrough */') |
|
0 commit comments