From: Fred Morcos Date: Wed, 16 Aug 2023 10:02:05 +0000 (+0200) Subject: Meson: Cleanup the netlibs module X-Git-Tag: rec-5.1.0-alpha1~80^2~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=086c10ec5187097f9e723b283bd195470f6eb432;p=thirdparty%2Fpdns.git Meson: Cleanup the netlibs module --- diff --git a/meson.build b/meson.build index d45ba24933..67e3744400 100644 --- a/meson.build +++ b/meson.build @@ -187,6 +187,7 @@ deps = [ dep_atomics, dep_lua, dep_lua_records, + dep_netlibs, dep_gss_tsig, dep_pkcs11, dep_yahttp, diff --git a/meson/net-libs/meson.build b/meson/net-libs/meson.build index 9736d33813..fd494ce311 100644 --- a/meson/net-libs/meson.build +++ b/meson/net-libs/meson.build @@ -1,5 +1,4 @@ -# Network Libraries ---------------------------------------------------------------------- -# Inputs: deps conf +netlib_deps = [] variants = [ ['inet_aton', 'resolv'], @@ -7,6 +6,7 @@ variants = [ ['socket', 'socket'], ['gethostent', 'nsl'], ] + foreach variant: variants func_name = variant[0] lib_name = variant[1] @@ -15,23 +15,30 @@ foreach variant: variants if not found lib = cxx.find_library(lib_name, required: true) if not cxx.has_function(func_name, dependencies: lib) - error('Cannot find function ' + func_name) + error('Cannot find function ' + func_name + ', searched library `' + lib_name + '`') endif - deps += lib + netlib_deps += lib found = lib.name() + ' ' + lib.version() endif - # summary(func_name, found, bool_yn: true, section: 'Network Functions') + summary(func_name, found, bool_yn: true, section: 'Networking Functions') endforeach -variants = ['recvmmsg', 'sendmmsg', 'accept4'] +dep_netlibs = declare_dependency(dependencies: netlib_deps) + +variants = [ + 'recvmmsg', + 'sendmmsg', + 'accept4', +] + foreach variant: variants found = cxx.has_function(variant) define = 'HAVE_' + variant.to_upper() - conf.set10(define, found, description: 'Whether we have ' + variant) - # summary(variant, found, bool_yn: true, section: 'Network Functions') + conf.set(define, found, description: 'Have ' + variant) + summary(variant, found, bool_yn: true, section: 'Networking Functions') endforeach declared = cxx.has_header_symbol('ifaddrs.h', 'getifaddrs') -conf.set10('HAVE_GETIFADDRS', declared, description: 'Whether we have getifaddrs') -# summary('getifaddrs', declared, bool_yn: true, section: 'Network Functions') +conf.set('HAVE_GETIFADDRS', declared, description: 'Have getifaddrs') +summary('getifaddrs', declared, bool_yn: true, section: 'Networking Functions')