Files
mcde/lib/McdeSys/Makefile.am
T
lotherk 8ee96c2063 mcde: add DNS-SD announce and watch for dtchat's local mode (T5.2)
McdeSys.h: mcde_sys_net_announce()/poll/ready/stop and mcde_sys_net_watch()/poll/next/close with McdeSysService (name, type, host, TXT, port, gone). mdns_avahi.c uses avahi-client with an own AvahiSimplePoll per handle (no thread; the poll call runs one iteration), publishes an entry group while the daemon runs, frees it for the goodbye, browses and resolves NEW services, queues REMOVE, and survives a missing daemon (AVAHI_CLIENT_NO_FAIL, CONNECTING). mdns_netbsd.c does the same with libdns_sd (DNSServiceRegister with a TXTRecordRef, DNSServiceBrowse, DNSServiceResolve per NEW service, poll on DNSServiceRefSockFD then DNSServiceProcessResult); it compiles against the sysroot with -ldns_sd and has not run on NetBSD. mdns_stub.c answers ENOTSUP when the build has no client. configure checks avahi-client/avahi-common on non-NetBSD with AM_CONDITIONAL MCDE_AVAHI. test_netwatch announces _mcde-test._tcp on 4711 with a TXT record, sees it through its own watch (name, TXT, port, address) and stops the announce; against the running avahi-daemon it reports 'announced and seen' and 'goodbye seen', all ok. test_netwatch is a noinst program and a harness entry. In-tree build pending: a foreign release chain holds the lock (pid 141722).
2026-11-17 07:36:03 +00:00

70 lines
3.0 KiB
Makefile

MAINTAINERCLEANFILES = Makefile.in
# McdeSys, MCDE's layer between the desktop and the operating system
# (include/Mcde/McdeSys.h): common.c is POSIX, one backend per system.
lib_LTLIBRARIES = libMcdeSys.la
# where pkgsrc installs what McdeSys runs, from configure (--with-pkg-prefix,
# --with-pkg-sysconfdir): the sources write MCDE_PKG_PREFIX "/bin/borg"
libMcdeSys_la_CPPFLAGS = -I$(top_srcdir)/include \
-DMCDE_PKG_PREFIX='"$(MCDE_PKG_PREFIX)"' \
-DMCDE_PKG_SYSCONFDIR='"$(MCDE_PKG_SYSCONFDIR)"' \
-DMCDE_DT_TOP='"$(prefix)"' $(ALSA_CPPFLAGS)
libMcdeSys_la_SOURCES = common.c text.c net.c sound.c audio.c audio_null.c \
users.c share.c netmount.c backup.c printers.c logs.c events.c mount.c \
private.h
if NETBSD
libMcdeSys_la_SOURCES += netbsd.c disk_netbsd.c mount_netbsd.c audio_netbsd.c \
mdns_netbsd.c
# crypt(3), for the password hash; proplib(3), for the battery; libdns_sd
# (base), for the computers on the network (netbsd.c) and the services
libMcdeSys_la_LIBADD = -lcrypt -lprop -ldns_sd
else
libMcdeSys_la_SOURCES += linux.c disk_linux.c mount_linux.c audio_linux.c
# ALSA, when configure found it (audio_linux.c); empty otherwise
libMcdeSys_la_LIBADD = $(ALSALIB)
if MCDE_AVAHI
libMcdeSys_la_SOURCES += mdns_avahi.c
libMcdeSys_la_LIBADD += $(AVAHILIB)
else
libMcdeSys_la_SOURCES += mdns_stub.c
endif
endif
libMcdeSys_la_LDFLAGS = -version-info 1:0:0
# what the system tells about itself, for a look by hand: make check runs it
check_PROGRAMS = test_sysinfo test_netmount test_updatesource test_processes test_job test_netinput test_sysload test_disk_events
# built by make mcde-host as well, so tools/mcde-tests.sh finds it there
noinst_PROGRAMS = test_audio test_netwatch
test_sysinfo_SOURCES = test_sysinfo.c
test_sysinfo_CPPFLAGS = -I$(top_srcdir)/include
test_sysinfo_LDADD = libMcdeSys.la
test_netmount_SOURCES = test_netmount.c
test_netmount_CPPFLAGS = -I$(top_srcdir)/include
test_netmount_LDADD = libMcdeSys.la
test_updatesource_SOURCES = test_updatesource.c
test_updatesource_CPPFLAGS = -I$(top_srcdir)/include
test_updatesource_LDADD = libMcdeSys.la
test_processes_SOURCES = test_processes.c
test_processes_CPPFLAGS = -I$(top_srcdir)/include
test_processes_LDADD = libMcdeSys.la
test_job_SOURCES = test_job.c
test_job_CPPFLAGS = -I$(top_srcdir)/include
test_job_LDADD = libMcdeSys.la
test_netinput_SOURCES = test_netinput.c
test_netinput_CPPFLAGS = -I$(top_srcdir)/include
test_netinput_LDADD = libMcdeSys.la
test_sysload_SOURCES = test_sysload.c
test_sysload_CPPFLAGS = -I$(top_srcdir)/include
test_sysload_LDADD = libMcdeSys.la
test_disk_events_SOURCES = test_disk_events.c
test_disk_events_CPPFLAGS = -I$(top_srcdir)/include
test_disk_events_LDADD = libMcdeSys.la
test_audio_SOURCES = test_audio.c
test_audio_CPPFLAGS = -I$(top_srcdir)/include
test_audio_LDADD = libMcdeSys.la -lm
test_netwatch_SOURCES = test_netwatch.c
test_netwatch_CPPFLAGS = -I$(top_srcdir)/include
test_netwatch_LDADD = libMcdeSys.la
TESTS = test_sysinfo test_netmount test_updatesource test_processes test_job test_netinput test_sysload test_disk_events test_audio test_netwatch