Skip to content

Commit

Permalink
meson: Detect native Avahi before mDNS
Browse files Browse the repository at this point in the history
  • Loading branch information
singular0 authored and rdmark committed Oct 5, 2024
1 parent 283ed80 commit 94d57ed
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
6 changes: 3 additions & 3 deletions etc/netatalk/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ if use_mysql_backend
netatalk_deps += mysqlclient
endif

if have_dns
netatalk_deps += dns_sd_libs
elif avahi.found()
if avahi.found()
netatalk_deps += avahi
elif have_dns
netatalk_deps += dns_sd_libs
endif

executable(
Expand Down
36 changes: 16 additions & 20 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,10 @@ endif

enable_zeroconf = get_option('with-zeroconf')

have_zeroconf = false

zeroconf_provider = ''

avahi = dependency('avahi-client', required: false)

dns_sd_libs = []
Expand All @@ -716,8 +720,6 @@ if dns_sd.found()
dns_sd_libs += system
endif

zeroconf_provider = ''

have_dns = (
(dns_sd.found() or system.found())
and cc.has_header('dns_sd.h')
Expand All @@ -727,28 +729,22 @@ have_dns = (
)
)

if not enable_zeroconf
have_zeroconf = false
else
have_zeroconf = have_dns
if have_dns
if enable_zeroconf
if avahi.found()
have_zeroconf = true
cdata.set('USE_ZEROCONF', 1)
cdata.set('HAVE_AVAHI', 1)
if avahi.version() >= '0.6.4'
cdata.set('HAVE_AVAHI_THREADED_POLL', 1)
endif
cdata.set('freebsd_zeroconf', 'avahi_daemon')
zeroconf_provider += 'Avahi'
elif have_dns
have_zeroconf = true
cdata.set('USE_ZEROCONF', 1)
cdata.set('HAVE_MDNS', 1)
cdata.set('freebsd_zeroconf', 'mdnsd')
zeroconf_provider += 'mDNS'
else
have_zeroconf = avahi.found()
if avahi.found()
cdata.set('USE_ZEROCONF', 1)
cdata.set('HAVE_AVAHI', 1)
if avahi.version() >= '0.6.4'
cdata.set('HAVE_AVAHI_THREADED_POLL', 1)
endif
cdata.set('freebsd_zeroconf', 'avahi_daemon')
zeroconf_provider += 'Avahi'
else
have_zeroconf = false
endif
endif
endif

Expand Down

0 comments on commit 94d57ed

Please sign in to comment.