xiaoxiang781216 commented on code in PR #3081: URL: https://github.com/apache/nuttx-apps/pull/3081#discussion_r2106061765
########## netutils/mdns/Kconfig: ########## @@ -0,0 +1,81 @@ +config LIB_MDNS + bool "MDNS library" + default n + ---help--- + Enable the mDNS library. This allows calls to the library to be made. + + This external library is "unlicensed" using the methodology from http://unlicense.org. + You should be sure that this license is acceptable for your usage. + + By default, the "built-in" demo is added as an application that can + ne run from nsh <mdns>. + + This is also needed for the optional daemon that allows the demo + app's mDNS functionality to be started and stopped from user + applications. There is an associated example app + (CONFIG_EXAMPLES_MDNSD) to allow the daemon to be tried from nsh. + + Ultimately, this should be used simply as a library, and neither the + demo app nor the daemon utilised. If just built as a library,the + relevant header file <mdns.h> is copied to the usual netutils + include location and can be utilised be including it: + + #include <netutils/mdns.h> + +if LIB_MDNS + +config NETUTILS_MDNS_DAEMON + tristate "Allows mdns to be run as a daemon and started/stopped" + default n + select NETUTILS_MDNS Review Comment: yes, it's better to depends on NETUTILS_MDNS ########## netutils/mdns/Makefile: ########## @@ -0,0 +1,110 @@ +############################################################################ +# netutils/mdns/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# mDNS application + +############################################################################ +# Flags +############################################################################ + +MDNS_URL ?= "https://github.com/mjansson/mdns/archive" + +MDNS_VERSION = main +MDNS_ZIP = $(MDNS_VERSION).zip + +MDNS_UNPACKNAME = mdns +UNPACK ?= unzip -q -o + +VPATH += $(MDNS_UNPACKNAME) +VPATH += $(MDNS_UNPACKNAME)$(DELIM)posix +DEPPATH += --dep-path $(MDNS_UNPACKNAME) +DEPPATH += --dep-path $(MDNS_UNPACKNAME)$(DELIM)posix + +CFLAGS += -Wno-strict-prototypes -Wno-undef -Wno-format + +APPS_INCDIR = $(APPDIR)$(DELIM)include$(DELIM)netutils + +############################################################################ +# Targets +############################################################################ + +$(MDNS_ZIP): + @echo "Downloading: $(MDNS_URL)/$(MDNS_ZIP)" + $(Q) curl -O -L $(MDNS_URL)/$(MDNS_ZIP) + +$(MDNS_UNPACKNAME): $(MDNS_ZIP) + @echo "Unpacking: $(MDNS_ZIP) -> $(MDNS_UNPACKNAME)" + $(Q) $(UNPACK) $(MDNS_ZIP) + $(Q) mv mdns-$(MDNS_VERSION) $(MDNS_UNPACKNAME) +ifeq ($(CONFIG_NETUTILS_MDNS),) Review Comment: yes, I think either always copy the header file or add mdns to the search patch at the user site. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org