@@ -92,18 +92,20 @@ endif
9292# Check for libsystemd availability. Optional, only required for MCTP dbus scan
9393libsystemd_dep = dependency (' libsystemd' , version : ' >219' , required : false )
9494if 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?' )
107109endif
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