@@ -154,8 +154,14 @@ fi
AC_SUBST([systemd_unitdir])
AM_CONDITIONAL([ENABLE_SYSTEMD_UNITS], [test "x$with_systemd" = "xyes"])
+ndctl_monitorconfdir=${sysconfdir}/ndctl
+ndctl_monitorconf=monitor.conf
+AC_SUBST([ndctl_monitorconfdir])
+AC_SUBST([ndctl_monitorconf])
+AC_DEFINE_UNQUOTED(NDCTL_CONF_FILE, ["$ndctl_monitorconfdir/$ndctl_monitorconf"],
+ [default ndctl monitor conf path])
+
my_CFLAGS="\
--D DEF_CONF_FILE='\"${sysconfdir}/ndctl/monitor.conf\"' \
-Wall \
-Wchar-subscripts \
-Wformat-security \
@@ -43,10 +43,8 @@ ndctl_SOURCES += ../test/libndctl.c \
test.c
endif
-monitor_config_file = monitor.conf
-monitor_configdir = $(sysconfdir)/ndctl/
-monitor_config_DATA = $(monitor_config_file)
-EXTRA_DIST += $(monitor_config_file)
+monitor_configdir = $(ndctl_monitorconfdir)
+monitor_config_DATA = $(ndctl_monitorconf)
if ENABLE_SYSTEMD_UNITS
systemd_unit_DATA = ndctl-monitor.service
@@ -503,7 +503,7 @@ static int read_config_file(struct ndctl_ctx *ctx, struct monitor *_monitor,
if (_monitor->config_file)
config_file = strdup(_monitor->config_file);
else
- config_file = strdup(DEF_CONF_FILE);
+ config_file = strdup(NDCTL_CONF_FILE);
if (!config_file) {
fail("strdup default config file failed\n");
rc = -ENOMEM;
The definition of the monitor configuration file can get out of sync with current duplication between configure.ac and ndctl/Makefile.am. Instead, define all the variables in configure.ac and just reference them in ndctl/Makefile.am. Cc: QI Fuli <qi.fuli@jp.fujitsu.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- configure.ac | 8 +++++++- ndctl/Makefile.am | 6 ++---- ndctl/monitor.c | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-)