add --disable-mdns configure option, in prep for win32 build

This commit is contained in:
Ron Pedde 2004-10-30 16:42:20 +00:00
parent 099bcf911b
commit 31ff9fc39c
4 changed files with 35 additions and 10 deletions

View File

@ -14,6 +14,7 @@ AM_PROG_LEX
AC_CANONICAL_HOST
AM_CONDITIONAL(COND_REND_OSX,false)
rend_posix=true
STATIC_LIBS=no
CPPFLAGS="${CPPFLAGS} -g"
@ -26,20 +27,27 @@ AC_ARG_ENABLE(debug,[ --enable-debug Enable debugging features],
CPPFLAGS="${CPPFLAGS} -Wall")
AC_ARG_ENABLE(debug-memory,[ --enable-debug-memory Enable mem leak debugging],
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],
LDFLAGS="${LDFLAGS} -lefence")
AC_ARG_ENABLE(nslu2,[ --enable-nslu2 Build for NSLU2/uNSLUng],
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
yes) rend_howl=true; LDFLAGS="${LDFLAGS} -lhowl";
yes) rend_howl=true; rend_posix=false; LDFLAGS="${LDFLAGS} -lhowl";
CPPFLAGS="${CPPFLAGS} -DWITH_HOWL";;
no) rend_howl=false;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-howl);;
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
yes) rend_howl=true; LDFLAGS="${LDFLAGS} -lrendezvous -lcorby -lsalt";
CPPFLAGS="${CPPFLAGS} -DWITH_HOWL";;
@ -48,7 +56,7 @@ AC_ARG_ENABLE(howl,[ --enable-howl Use the howl mDNS library],
esac ],[rend_howl=false])
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_STRSEP,false)

View File

@ -7,21 +7,21 @@ AM_YFLAGS=-d
sbin_PROGRAMS = mt-daapd
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
if COND_REND_HOWL
HRENDSRC=rend-howl.c
HRENDSRC=rend-howl.c rend-unix.c
endif
if COND_REND_OSX
ORENDSRC=rend-osx.c
ORENDSRC=rend-osx.c rend-unix.c
endif
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 \
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 \
redblack.c redblack.h dynamic-art.c dynamic-art.h query.c query.h \
$(PRENDSRC) $(ORENDSRC) $(HRENDSRC)

View File

@ -28,7 +28,6 @@
#include <fcntl.h>
#include <limits.h>
#include <pthread.h>
#include <rend.h>
#include <restart.h>
#include <signal.h>
#include <stdarg.h>
@ -43,6 +42,10 @@
#include "configfile.h"
#include "err.h"
#ifndef WITHOUT_MDNS
# include "rend.h"
#endif
/*
* 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,"<TR><TD>Rendezvous</TD>");
#ifndef WITHOUT_MDNS
if(config.use_mdns) {
mdns_running=!rend_running();
@ -564,6 +568,9 @@ void config_emit_service_status(WS_CONNINFO *pwsc, void *value, char *arg) {
} else {
ws_writefd(pwsc,"<TD>Not configured</TD><TD>&nbsp;</TD></TR>\n");
}
#else
ws_writefd(pwsc,"<TD>No Support</TD><TD>&nbsp;</TD></TR>\n");
#endif
ws_writefd(pwsc,"<TR><TD>DAAP Server</TD><TD>%s</TD>",config.stop ? "Stopping":"Running");
if(config.stop) {

View File

@ -46,11 +46,15 @@
#include "daap-proto.h"
#include "err.h"
#include "mp3-scanner.h"
#include "rend.h"
#include "webserver.h"
#include "playlist.h"
#include "dynamic-art.h"
#ifndef WITHOUT_MDNS
# include "rend.h"
#endif
#ifndef DEFAULT_CONFIGFILE
#ifdef NSLU2
#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)) {
DPRINTF(ERR_LOG,"Starting rendezvous daemon\n");
if(rend_init(config.runas)) {
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
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,"^/databases/.*",daap_handler,NULL,0);
#ifndef WITHOUT_MDNS
if(config.use_mdns) { /* register services */
DPRINTF(ERR_LOG,"Registering rendezvous names\n");
rend_register(config.servername,"_daap._tcp",config.port);
rend_register(config.servername,"_http._tcp",config.port);
}
#endif
end_time=time(NULL);
@ -773,10 +781,12 @@ int main(int argc, char *argv[]) {
DPRINTF(ERR_LOG,"Stopping gracefully\n");
#ifndef WITHOUT_MDNS
if(config.use_mdns) {
DPRINTF(ERR_LOG,"Stopping rendezvous daemon\n");
rend_stop();
}
#endif
DPRINTF(ERR_LOG,"Stopping web server\n");
ws_stop(server);