set default config file location based on prefix

This commit is contained in:
Ron Pedde 2006-04-09 01:35:10 +00:00
parent 6d6f2d125f
commit 92e967e78c
2 changed files with 10 additions and 12 deletions

View File

@ -19,6 +19,15 @@ AC_CHECK_FUNCS(strptime)
AC_CHECK_FUNCS(strtok_r) AC_CHECK_FUNCS(strtok_r)
AM_CONDITIONAL(COND_REND_OSX,false) 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 rend_posix=true
db_sqlite=false db_sqlite=false
db_sqlite3=false db_sqlite3=false

View File

@ -90,17 +90,6 @@
# include "rend.h" # include "rend.h"
#endif #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 */ /** Seconds to sleep before checking for a shutdown or reload */
#define MAIN_SLEEP_INTERVAL 2 #define MAIN_SLEEP_INTERVAL 2
@ -186,7 +175,7 @@ void usage(char *program) {
*/ */
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
int option; int option;
char *configfile=DEFAULT_CONFIGFILE; char *configfile=CONFFILE;
WSCONFIG ws_config; WSCONFIG ws_config;
int reload=0; int reload=0;
int start_time; int start_time;