From 2c029ddd1516a168faa679846d72422bc2d9f6d1 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Mon, 1 Dec 2003 15:27:40 +0000 Subject: [PATCH] Small linux fixes --- configure.in | 6 +++++- src/err.c | 2 ++ src/err.h | 5 +++-- src/main.c | 3 ++- src/mt-daapd.conf | 1 + 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 22f58cee..a09c93a2 100644 --- a/configure.in +++ b/configure.in @@ -11,7 +11,11 @@ AC_PROG_CC AC_CANONICAL_HOST +AM_CONDITIONAL(COND_REND_OSX,false) + AC_ARG_ENABLE(debug,Enable debugging features,CPPFLAGS="$CPPFLAGS -DDEBUG -g") +AC_ARG_ENABLE(efence,Enable electric fence,LDFLAGS="$LDFLAGS -lefence") + AC_ARG_ENABLE(howl,[ --enable-howl Use the howl mDNS library], [ case "${enableval}" in yes) rend_howl=true; LDFLAGS="${LDFLAGS} -lrendezvous -lcorby -lsalt";; @@ -26,7 +30,7 @@ dnl Darwin's stupid cpp preprocessor.... echo Host type is $host case $host in *linux*) - CPPFLAGS="$CPPFLAGS -DHAVE_SOCKLEN_T"; LDFLAGS="$LDFLAGS -lefence";; + CPPFLAGS="$CPPFLAGS -DHAVE_SOCKLEN_T";; *darwin*) CPPFLAGS="$CPPFLAGS -no-cpp-precomp -DHAVE_SOCKADDR_SA_LEN -DHAVE_SOCKLEN_T" LDFLAGS="$LDFLAGS -framework CoreFoundation" diff --git a/src/err.c b/src/err.c index 4f6677ef..fdce9080 100644 --- a/src/err.c +++ b/src/err.c @@ -41,8 +41,10 @@ typedef struct tag_err_leak { int err_debuglevel=0; int err_logdestination=LOGDEST_STDERR; +#ifdef DEBUG pthread_mutex_t err_mutex=PTHREAD_MUTEX_INITIALIZER; ERR_LEAK err_leak = { NULL, NULL, 0, 0, NULL }; +#endif /* * Forwards diff --git a/src/err.h b/src/err.h index a29921e1..eeddd343 100644 --- a/src/err.h +++ b/src/err.h @@ -48,9 +48,9 @@ extern void log_setdest(char *app, int destination); # define malloc(x) err_malloc(__FILE__,__LINE__,x) # define strdup(x) err_strdup(__FILE__,__LINE__,x) # define free(x) err_free(__FILE__,__LINE__,x) -# define MEMNOTIFY(x) err_notify(__FILE__,__LINE__,x) # endif /* __IN_ERR__ */ +# define MEMNOTIFY(x) err_notify(__FILE__,__LINE__,x) extern void *err_malloc(char *file, int line, size_t size); extern char *err_strdup(char *file, int line, const char *str); @@ -58,6 +58,7 @@ extern void err_free(char *file, int line, void *ptr); extern void err_notify(char *file, int line, void *ptr); extern void err_leakcheck(void); +#else +# define MEMNOTIFY(x) #endif /* DEBUG */ - #endif /* __ERR_H__ */ diff --git a/src/main.c b/src/main.c index 2859209a..9fc20583 100644 --- a/src/main.c +++ b/src/main.c @@ -26,10 +26,11 @@ #include #include #include +#include +#include #include #include #include -#include #include #include diff --git a/src/mt-daapd.conf b/src/mt-daapd.conf index f5aeea2a..d23f73fa 100644 --- a/src/mt-daapd.conf +++ b/src/mt-daapd.conf @@ -3,3 +3,4 @@ port 3689 admin_pw secret mp3_dir mp3 servername Ron's Secret Stash +