From 92e967e78c5c5e675b2be6d5025693dda65cbf08 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Sun, 9 Apr 2006 01:35:10 +0000 Subject: [PATCH] set default config file location based on prefix --- configure.in | 9 +++++++++ src/main.c | 13 +------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/configure.in b/configure.in index 89f793ec..e9d71410 100644 --- a/configure.in +++ b/configure.in @@ -19,6 +19,15 @@ AC_CHECK_FUNCS(strptime) AC_CHECK_FUNCS(strtok_r) AM_CONDITIONAL(COND_REND_OSX,false) +if test "x$prefix" != xNONE; then + CONFFILE="$prefix/etc/mt-daapd.conf" +else + CONFFILE="/etc/mt-daapd.conf" +fi + + +AC_DEFINE_UNQUOTED(CONFFILE,"${CONFFILE}",Where the config file is) + rend_posix=true db_sqlite=false db_sqlite3=false diff --git a/src/main.c b/src/main.c index a4bc413b..a295904b 100644 --- a/src/main.c +++ b/src/main.c @@ -90,17 +90,6 @@ # include "rend.h" #endif -/** - * Where the default configfile is. On the NSLU2 running unslung, - * thats in /opt, not /etc. */ -#ifndef DEFAULT_CONFIGFILE -#ifdef NSLU2 -#define DEFAULT_CONFIGFILE "/opt/etc/mt-daapd/mt-daapd.conf" -#else -#define DEFAULT_CONFIGFILE "/etc/mt-daapd.conf" -#endif -#endif - /** Seconds to sleep before checking for a shutdown or reload */ #define MAIN_SLEEP_INTERVAL 2 @@ -186,7 +175,7 @@ void usage(char *program) { */ int main(int argc, char *argv[]) { int option; - char *configfile=DEFAULT_CONFIGFILE; + char *configfile=CONFFILE; WSCONFIG ws_config; int reload=0; int start_time;