kresd/FreeBSDについて、ここに記述してください。

https://www.freshports.org/dns/knot-resolver/

knot-resolver Caching full resolver implementation 2.3.0_2

%gmake info                                         ~/knot-resolver-2.4.0
objdump: '/libknot.so': No such file
Makefile:52: *** "Unable to resolve libknot_SONAME, update find_soname in platform.mk". 

/Makefile-patch

1. find_lib

platform.mk中のfind_libが機能しなくて、ライブラリが見つからない。

# Find library alternative (pkg-config)
define find_alt
        ifeq ($$(strip $$($(1)_LIBS)),)
                ifneq ($(strip $(3)),)
                        $(1)_VER := $(shell pkg-config --atleast-version=$(3) $(2) && echo $(3))
                endif
                ifeq ($(strip $(3)),$$($(1)_VER))
                        $(1)_CFLAGS := $(shell pkg-config --cflags $(2) --silence-errors)
                        $(1)_LIBS := $(shell pkg-config --libs $(2)  --silence-errors)
                endif
        endif
        ifeq ($$(strip $$($(1)_LIBS)),)
                HAS_$(1) := no
        else
                HAS_$(1) := yes
        endif
endef

2. find_soname

define find_soname
# Use objdump -p on Linux and BSDs
ifeq ($(PLATFORM),POSIX)
ifeq ($(UNAME),OpenBSD)
        $(1)_SONAME = $$(shell basename $$$$(readlink -f $$$$(pkg-config --variable=libdir $(1))/$(1)$(LIBEXT)) | cut -f 1-3 -d .)
else
        $(1)_SONAME = $$(shell objdump -p $$$$(pkg-config --variable=libdir $(1))/$(1)$(LIBEXT) | sed -ne 's/[[:space:]]*SONAME[[:space:]]*\($(1)\.so\.[0-4]*\)/\1/p')
endif
endif

???  ifeq ($(PLATFORM),POSIX) : fail だとどうなるのか。

3. Makefile

$ grep libknot Makefile 
$(eval $(call find_lib,libknot,$(KNOT_MINVER),yes))
$(eval $(call find_soname,libknot))
ifeq ($(libknot_SONAME),)
  $(error "Unable to resolve libknot_SONAME, update find_soname in platform.mk")
        $(info [$(HAS_libknot)] libknot (lib))
ifeq ($(HAS_libknot),no)
        $(error libknot >= $(KNOT_MINVER) required)
BUILD_CFLAGS += $(libknot_CFLAGS) $(libuv_CFLAGS) $(nettle_CFLAGS) $(cmocka_CFLAGS) $(lua_CFLAGS) $(libdnssec_CFLAGS) $(libsystemd_CFLAGS)