Skip to content

Commit 3ec3936

Browse files
committed
build: disable netdb test for static builds
The linker test doesn't include the default library configuration thus it will not fail for a static build. Add an explicit static build test. Signed-off-by: Daniel Wagner <wagi@kernel.org>
1 parent 82aef43 commit 3ec3936

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

meson.build

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,10 @@ conf.set10(
216216
description: 'Is linux/mctp.h include-able?'
217217
)
218218

219-
conf.set(
220-
'HAVE_NETDB',
221-
cc.links(
219+
is_static = get_option('default_library') == 'static'
220+
have_netdb = false
221+
if not is_static
222+
have_netdb = cc.links(
222223
'''#include <sys/types.h>
223224
#include <sys/socket.h>
224225
#include <netdb.h>
@@ -228,9 +229,15 @@ conf.set(
228229
}
229230
''',
230231
name: 'netdb',
231-
),
232+
)
233+
endif
234+
235+
conf.set(
236+
'HAVE_NETDB',
237+
have_netdb,
232238
description: 'Is network address and service translation available'
233239
)
240+
234241
dl_dep = dependency('dl', required: false)
235242
conf.set(
236243
'HAVE_LIBC_DLSYM',

0 commit comments

Comments
 (0)