Make default config to respect sysconfdir

Instead of hardcode default config to /etc/clixon.xml, make it to
respect sysconfdir variable. Since autoconf doesn't expand variables on
header substitution it would end up being defined on clixon_config.h as
"${prefix}/etc/clixon.xml" what makes no sense for the header file.

Use eval to expand ${sysconfdir} and make .h file to be defined with
final directory name.
This commit is contained in:
Renato Botelho do Couto 2018-02-06 05:54:05 -06:00
parent eea8cd7660
commit d670b6af8a
2 changed files with 2 additions and 2 deletions

2
configure vendored
View file

@ -4053,7 +4053,7 @@ fi
if test "${with_configfile+set}" = set; then : if test "${with_configfile+set}" = set; then :
withval=$with_configfile; DEFAULT_CONFIG="$withval" withval=$with_configfile; DEFAULT_CONFIG="$withval"
else else
DEFAULT_CONFIG="/etc/clixon.xml" DEFAULT_CONFIG="$(eval echo ${sysconfdir}/clixon.xml)"
fi fi

View file

@ -165,7 +165,7 @@ fi
AC_ARG_WITH([configfile], AC_ARG_WITH([configfile],
[AS_HELP_STRING([--with-configfile=FILE],[set default path to config file])], [AS_HELP_STRING([--with-configfile=FILE],[set default path to config file])],
[DEFAULT_CONFIG="$withval"], [DEFAULT_CONFIG="$withval"],
[DEFAULT_CONFIG="/etc/clixon.xml"]) [DEFAULT_CONFIG="$(eval echo ${sysconfdir}/clixon.xml)"])
AC_CHECK_LIB(crypt, crypt) AC_CHECK_LIB(crypt, crypt)
AC_CHECK_HEADERS(crypt.h) AC_CHECK_HEADERS(crypt.h)