mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-19 20:14:18 -04:00
add --disable-mdns configure option, in prep for win32 build
This commit is contained in:
parent
099bcf911b
commit
31ff9fc39c
16
configure.in
16
configure.in
@ -14,6 +14,7 @@ AM_PROG_LEX
|
|||||||
AC_CANONICAL_HOST
|
AC_CANONICAL_HOST
|
||||||
|
|
||||||
AM_CONDITIONAL(COND_REND_OSX,false)
|
AM_CONDITIONAL(COND_REND_OSX,false)
|
||||||
|
rend_posix=true
|
||||||
|
|
||||||
STATIC_LIBS=no
|
STATIC_LIBS=no
|
||||||
CPPFLAGS="${CPPFLAGS} -g"
|
CPPFLAGS="${CPPFLAGS} -g"
|
||||||
@ -26,20 +27,27 @@ AC_ARG_ENABLE(debug,[ --enable-debug Enable debugging features],
|
|||||||
CPPFLAGS="${CPPFLAGS} -Wall")
|
CPPFLAGS="${CPPFLAGS} -Wall")
|
||||||
AC_ARG_ENABLE(debug-memory,[ --enable-debug-memory Enable mem leak debugging],
|
AC_ARG_ENABLE(debug-memory,[ --enable-debug-memory Enable mem leak debugging],
|
||||||
CPPFLAGS="${CPPFLAGS} -DDEBUG_MEMORY")
|
CPPFLAGS="${CPPFLAGS} -DDEBUG_MEMORY")
|
||||||
|
AC_ARG_ENABLE(mdns,[ --enable-mdns Enable mDNS support],
|
||||||
|
[ case "${enableval}" in
|
||||||
|
yes) ;;
|
||||||
|
no) rend_posix=false; rend_howl=false; CPPFLAGS="${CPPFLAGS} -DWITHOUT_MDNS";;
|
||||||
|
*) AC_MSG_ERROR(bad value ${enableval} for --disable-mdns);;
|
||||||
|
esac ])
|
||||||
|
|
||||||
AC_ARG_ENABLE(efence,[ --enable-efence Enable electric fence],
|
AC_ARG_ENABLE(efence,[ --enable-efence Enable electric fence],
|
||||||
LDFLAGS="${LDFLAGS} -lefence")
|
LDFLAGS="${LDFLAGS} -lefence")
|
||||||
AC_ARG_ENABLE(nslu2,[ --enable-nslu2 Build for NSLU2/uNSLUng],
|
AC_ARG_ENABLE(nslu2,[ --enable-nslu2 Build for NSLU2/uNSLUng],
|
||||||
CFLAGS="${CFLAGS} -DNSLU2")
|
CFLAGS="${CFLAGS} -DNSLU2")
|
||||||
|
|
||||||
AC_ARG_ENABLE(new-howl,[ --enable-new-howl Use howl 0.9.2 or later],
|
AC_ARG_ENABLE(howl,[ --enable-howl Use howl 0.9.2 or later],
|
||||||
[ case "${enableval}" in
|
[ case "${enableval}" in
|
||||||
yes) rend_howl=true; LDFLAGS="${LDFLAGS} -lhowl";
|
yes) rend_howl=true; rend_posix=false; LDFLAGS="${LDFLAGS} -lhowl";
|
||||||
CPPFLAGS="${CPPFLAGS} -DWITH_HOWL";;
|
CPPFLAGS="${CPPFLAGS} -DWITH_HOWL";;
|
||||||
no) rend_howl=false;;
|
no) rend_howl=false;;
|
||||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-howl);;
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-howl);;
|
||||||
esac ],[rend_howl=false])
|
esac ],[rend_howl=false])
|
||||||
|
|
||||||
AC_ARG_ENABLE(howl,[ --enable-howl Use the howl mDNS library],
|
AC_ARG_ENABLE(old-howl,[ --enable-old-howl Use the howl mDNS library (pre 0.9.2)],
|
||||||
[ case "${enableval}" in
|
[ case "${enableval}" in
|
||||||
yes) rend_howl=true; LDFLAGS="${LDFLAGS} -lrendezvous -lcorby -lsalt";
|
yes) rend_howl=true; LDFLAGS="${LDFLAGS} -lrendezvous -lcorby -lsalt";
|
||||||
CPPFLAGS="${CPPFLAGS} -DWITH_HOWL";;
|
CPPFLAGS="${CPPFLAGS} -DWITH_HOWL";;
|
||||||
@ -48,7 +56,7 @@ AC_ARG_ENABLE(howl,[ --enable-howl Use the howl mDNS library],
|
|||||||
esac ],[rend_howl=false])
|
esac ],[rend_howl=false])
|
||||||
|
|
||||||
AM_CONDITIONAL(COND_REND_HOWL, test x$rend_howl = xtrue)
|
AM_CONDITIONAL(COND_REND_HOWL, test x$rend_howl = xtrue)
|
||||||
AM_CONDITIONAL(COND_REND_POSIX, test x$rend_howl = xfalse)
|
AM_CONDITIONAL(COND_REND_POSIX, test x$rend_posix = xtrue)
|
||||||
|
|
||||||
AM_CONDITIONAL(COND_NEED_STRCASESTR,false)
|
AM_CONDITIONAL(COND_NEED_STRCASESTR,false)
|
||||||
AM_CONDITIONAL(COND_NEED_STRSEP,false)
|
AM_CONDITIONAL(COND_NEED_STRSEP,false)
|
||||||
|
@ -7,21 +7,21 @@ AM_YFLAGS=-d
|
|||||||
sbin_PROGRAMS = mt-daapd
|
sbin_PROGRAMS = mt-daapd
|
||||||
|
|
||||||
if COND_REND_POSIX
|
if COND_REND_POSIX
|
||||||
PRENDSRC=mDNS.c mDNSClientAPI.h mDNSDebug.h mDNSPosix.c mDNSUNP.c rend-posix.c mDNSPlatformFunctions.h
|
PRENDSRC=mDNS.c mDNSClientAPI.h mDNSDebug.h mDNSPosix.c mDNSUNP.c rend-posix.c mDNSPlatformFunctions.h rend-unix.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if COND_REND_HOWL
|
if COND_REND_HOWL
|
||||||
HRENDSRC=rend-howl.c
|
HRENDSRC=rend-howl.c rend-unix.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if COND_REND_OSX
|
if COND_REND_OSX
|
||||||
ORENDSRC=rend-osx.c
|
ORENDSRC=rend-osx.c rend-unix.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
mt_daapd_SOURCES = main.c daapd.h rend.h uici.c uici.h webserver.c \
|
mt_daapd_SOURCES = main.c daapd.h rend.h uici.c uici.h webserver.c \
|
||||||
webserver.h configfile.c configfile.h err.c err.h restart.c restart.h \
|
webserver.h configfile.c configfile.h err.c err.h restart.c restart.h \
|
||||||
daap-proto.c daap-proto.h daap.c daap.h db-gdbm.c db-memory.h \
|
daap-proto.c daap-proto.h daap.c daap.h db-gdbm.c db-memory.h \
|
||||||
mp3-scanner.h mp3-scanner.c playlist.c playlist.h rend-unix.c \
|
mp3-scanner.h mp3-scanner.c playlist.c playlist.h \
|
||||||
rend-unix.h lexer.l parser.y strcasestr.c strcasestr.h strsep.c \
|
rend-unix.h lexer.l parser.y strcasestr.c strcasestr.h strsep.c \
|
||||||
redblack.c redblack.h dynamic-art.c dynamic-art.h query.c query.h \
|
redblack.c redblack.h dynamic-art.c dynamic-art.h query.c query.h \
|
||||||
$(PRENDSRC) $(ORENDSRC) $(HRENDSRC)
|
$(PRENDSRC) $(ORENDSRC) $(HRENDSRC)
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <rend.h>
|
|
||||||
#include <restart.h>
|
#include <restart.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@ -43,6 +42,10 @@
|
|||||||
#include "configfile.h"
|
#include "configfile.h"
|
||||||
#include "err.h"
|
#include "err.h"
|
||||||
|
|
||||||
|
#ifndef WITHOUT_MDNS
|
||||||
|
# include "rend.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Forwards
|
* Forwards
|
||||||
@ -550,6 +553,7 @@ void config_emit_service_status(WS_CONNINFO *pwsc, void *value, char *arg) {
|
|||||||
ws_writefd(pwsc,"<TH ALIGN=LEFT>Status</TH><TH ALIGN=LEFT>Control</TH></TR>\n");
|
ws_writefd(pwsc,"<TH ALIGN=LEFT>Status</TH><TH ALIGN=LEFT>Control</TH></TR>\n");
|
||||||
|
|
||||||
ws_writefd(pwsc,"<TR><TD>Rendezvous</TD>");
|
ws_writefd(pwsc,"<TR><TD>Rendezvous</TD>");
|
||||||
|
#ifndef WITHOUT_MDNS
|
||||||
if(config.use_mdns) {
|
if(config.use_mdns) {
|
||||||
mdns_running=!rend_running();
|
mdns_running=!rend_running();
|
||||||
|
|
||||||
@ -564,6 +568,9 @@ void config_emit_service_status(WS_CONNINFO *pwsc, void *value, char *arg) {
|
|||||||
} else {
|
} else {
|
||||||
ws_writefd(pwsc,"<TD>Not configured</TD><TD> </TD></TR>\n");
|
ws_writefd(pwsc,"<TD>Not configured</TD><TD> </TD></TR>\n");
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
ws_writefd(pwsc,"<TD>No Support</TD><TD> </TD></TR>\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
ws_writefd(pwsc,"<TR><TD>DAAP Server</TD><TD>%s</TD>",config.stop ? "Stopping":"Running");
|
ws_writefd(pwsc,"<TR><TD>DAAP Server</TD><TD>%s</TD>",config.stop ? "Stopping":"Running");
|
||||||
if(config.stop) {
|
if(config.stop) {
|
||||||
|
12
src/main.c
12
src/main.c
@ -46,11 +46,15 @@
|
|||||||
#include "daap-proto.h"
|
#include "daap-proto.h"
|
||||||
#include "err.h"
|
#include "err.h"
|
||||||
#include "mp3-scanner.h"
|
#include "mp3-scanner.h"
|
||||||
#include "rend.h"
|
|
||||||
#include "webserver.h"
|
#include "webserver.h"
|
||||||
#include "playlist.h"
|
#include "playlist.h"
|
||||||
#include "dynamic-art.h"
|
#include "dynamic-art.h"
|
||||||
|
|
||||||
|
#ifndef WITHOUT_MDNS
|
||||||
|
# include "rend.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef DEFAULT_CONFIGFILE
|
#ifndef DEFAULT_CONFIGFILE
|
||||||
#ifdef NSLU2
|
#ifdef NSLU2
|
||||||
#define DEFAULT_CONFIGFILE "/opt/etc/mt-daapd.conf"
|
#define DEFAULT_CONFIGFILE "/opt/etc/mt-daapd.conf"
|
||||||
@ -652,12 +656,14 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef WITHOUT_MDNS
|
||||||
if((config.use_mdns) && (!parseonly)) {
|
if((config.use_mdns) && (!parseonly)) {
|
||||||
DPRINTF(ERR_LOG,"Starting rendezvous daemon\n");
|
DPRINTF(ERR_LOG,"Starting rendezvous daemon\n");
|
||||||
if(rend_init(config.runas)) {
|
if(rend_init(config.runas)) {
|
||||||
DPRINTF(ERR_FATAL,"Error in rend_init: %s\n",strerror(errno));
|
DPRINTF(ERR_FATAL,"Error in rend_init: %s\n",strerror(errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* DWB: we want to detach before we drop privs so the pid file can
|
/* DWB: we want to detach before we drop privs so the pid file can
|
||||||
be created with the original permissions. This has the
|
be created with the original permissions. This has the
|
||||||
@ -731,11 +737,13 @@ int main(int argc, char *argv[]) {
|
|||||||
ws_registerhandler(server,"^/logout$",daap_handler,NULL,0);
|
ws_registerhandler(server,"^/logout$",daap_handler,NULL,0);
|
||||||
ws_registerhandler(server,"^/databases/.*",daap_handler,NULL,0);
|
ws_registerhandler(server,"^/databases/.*",daap_handler,NULL,0);
|
||||||
|
|
||||||
|
#ifndef WITHOUT_MDNS
|
||||||
if(config.use_mdns) { /* register services */
|
if(config.use_mdns) { /* register services */
|
||||||
DPRINTF(ERR_LOG,"Registering rendezvous names\n");
|
DPRINTF(ERR_LOG,"Registering rendezvous names\n");
|
||||||
rend_register(config.servername,"_daap._tcp",config.port);
|
rend_register(config.servername,"_daap._tcp",config.port);
|
||||||
rend_register(config.servername,"_http._tcp",config.port);
|
rend_register(config.servername,"_http._tcp",config.port);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
end_time=time(NULL);
|
end_time=time(NULL);
|
||||||
|
|
||||||
@ -773,10 +781,12 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
DPRINTF(ERR_LOG,"Stopping gracefully\n");
|
DPRINTF(ERR_LOG,"Stopping gracefully\n");
|
||||||
|
|
||||||
|
#ifndef WITHOUT_MDNS
|
||||||
if(config.use_mdns) {
|
if(config.use_mdns) {
|
||||||
DPRINTF(ERR_LOG,"Stopping rendezvous daemon\n");
|
DPRINTF(ERR_LOG,"Stopping rendezvous daemon\n");
|
||||||
rend_stop();
|
rend_stop();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
DPRINTF(ERR_LOG,"Stopping web server\n");
|
DPRINTF(ERR_LOG,"Stopping web server\n");
|
||||||
ws_stop(server);
|
ws_stop(server);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user