Skip to content

Commit 0a5c066

Browse files
authored
Merge pull request #534 from igaw/cleanup-static-build
build: Always set CONFIG_LIBSYSTEMD variable
2 parents d98d2d2 + 0fda914 commit 0a5c066

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

meson.build

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,20 @@ endif
9292
# Check for libsystemd availability. Optional, only required for MCTP dbus scan
9393
libsystemd_dep = dependency('libsystemd', version: '>219', required: false)
9494
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)
95+
# When the user has CFLAGS=-static environment variable set
96+
# dependency() will find the shared library libsystemd Thus double
97+
# check if we are able to link
98+
if not cc.links('''#include <systemd/sd-bus.h>
99+
int main(void) {
100+
struct sd_bus *ret;
101+
return sd_bus_default(&ret);
102+
}
103+
''',
104+
dependencies: libsystemd_dep,
105+
name: 'libsystemd')
106+
libsystemd_dep = declare_dependency()
106107
endif
108+
conf.set('CONFIG_LIBSYSTEMD', libsystemd_dep.found(), description: 'Is libsystemd(>219) available?')
107109
endif
108110

109111
# local (cross-compilable) implementations of ccan configure steps
@@ -201,7 +203,7 @@ conf.set(
201203
return getaddrinfo(argv[1], argv[2], &hints, &result);
202204
}
203205
''',
204-
name: 'havelibnss',
206+
name: 'libnss',
205207
),
206208
description: 'Is network address and service translation available'
207209
)

0 commit comments

Comments
 (0)