find $(distdir) -type d -name '.svn' | xargs rm -rf
install-exec-hook:
++ $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run
$(mkinstalldirs) $(DESTDIR)$(localstatedir)/lib/$(PACKAGE_NAME)
- $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
fi
AM_CONDITIONAL(BUILD_MODULE_TRAFFIC, test "x$enable_traffic" = "xyes")
-AC_ARG_ENABLE(users, AC_HELP_STRING([--disable-users], [Disable user count statistics]),, [enable_users="yes"])
-if test "x$enable_users" != "xno"
-then
- if test "x$have_getutent" = "xyes"
- then
- enable_users="yes"
- else
- enable_users="no"
- fi
-fi
-if test "x$enable_users" = "xno"
-then
- AC_DEFINE(COLLECT_USERS, 0, [Wether or not to collect user count statistics])
-fi
-AM_CONDITIONAL(BUILD_MODULE_USERS, test "x$enable_users" = "xyes")
+AC_COLLECTD([users], [disable], [module], [user count statistics])
- AC_OUTPUT(Makefile src/libping/Makefile src/Makefile)
+ AC_OUTPUT(Makefile src/libconfig/Makefile src/libping/Makefile src/Makefile)
cat <<EOF;
+ SUBDIRS = libconfig
if BUILD_MODULE_PING
- SUBDIRS = libping .
+ SUBDIRS += libping
endif
-#SUBDIRS += .
sbin_PROGRAMS = collectd
collectd_CPPFLAGS = $(LTDLINCL)
collectd_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
collectd_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
+if BUILD_FEATURE_DAEMON
collectd_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
+endif
collectd_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
+if BUILD_FEATURE_DEBUG
+collectd_CPPFLAGS += -DLOGFILE='"${localstatedir}/log/${PACKAGE_NAME}/collectd.log"'
+endif
collectd_LDFLAGS = -export-dynamic
--collectd_CFLAGS = -Werror
- collectd_LDADD = $(LIBLTDL) "-dlopen" self
- collectd_DEPENDENCIES = $(LIBLTDL)
++collectd_CFLAGS = -Wall -Werror
+ collectd_LDADD = $(LIBLTDL) libconfig/libconfig.la "-dlopen" self
+ collectd_DEPENDENCIES = $(LIBLTDL) libconfig/libconfig.la
-if BUILD_WITH_RRDTOOL
-collectd_LDADD += -lrrd
-endif
pkglib_LTLIBRARIES =
pkglib_LTLIBRARIES += users.la
users_la_SOURCES = users.c users.h
users_la_LDFLAGS = -module -avoid-version
--users_la_CFLAGS = -Werror
++users_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" users.la
collectd_DEPENDENCIES += users.la
endif
case 'h':
default:
exit_usage (argv[0]);
- }
-
- }
+ } /* switch (c) */
+ } /* while (1) */
+
+ DBG_STARTFILE(logfile, "debug file opened.");
/*
- * Load plugins and change to output directory
- * Loading plugins is done first so relative paths work as expected..
+ * Read the config file. This will load any modules automagically.
*/
- if (plugin_load_all (plugindir) < 1)
+ plugin_set_dir (plugindir);
+
+ if (cf_read (configfile))
{
- fprintf (stderr, "Error: No plugins found.\n");
+ fprintf (stderr, "Error: Reading the config file failed!\n"
+ "Read the syslog for details.\n");
return (1);
}