summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1fab972)
raw | patch | inline | side by side (parent: 1fab972)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 12 Jun 2007 16:47:53 +0000 (18:47 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Tue, 12 Jun 2007 22:01:41 +0000 (00:01 +0200) |
For this purpose LOCALSTATEDIR is defined to $localstatedir during
compilation.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
compilation.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/Makefile.am | patch | blob | history | |
src/collectd.h | patch | blob | history | |
src/unixsock.c | patch | blob | history |
diff --git a/src/Makefile.am b/src/Makefile.am
index 1007dbc5a92c6746b28b694b2d9db889ea3edd2e..f7168a99e874eba59c4f965beabb3fedcf4a8d0a 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
collectd_CPPFLAGS = $(LTDLINCL)
collectd_CPPFLAGS += -DPREFIX='"${prefix}"'
collectd_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
+collectd_CPPFLAGS += -DLOCALSTATEDIR='"${localstatedir}"'
collectd_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
if BUILD_FEATURE_DAEMON
collectd_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
if BUILD_MODULE_UNIXSOCK
pkglib_LTLIBRARIES += unixsock.la
unixsock_la_SOURCES = unixsock.c
-unixsock_la_CPPFLAGS = -DPREFIX='"${prefix}"'
+unixsock_la_CPPFLAGS = -DLOCALSTATEDIR='"${localstatedir}"'
unixsock_la_LDFLAGS = -module -avoid-version -lpthread
collectd_LDADD += "-dlopen" unixsock.la
collectd_DEPENDENCIES += unixsock.la
diff --git a/src/collectd.h b/src/collectd.h
index ac755161d360308b258886ed0352c547226522ff..282e632520ce08cb1a755588c251a10f53aa4e24 100644 (file)
--- a/src/collectd.h
+++ b/src/collectd.h
#define CONFIGFILE SYSCONFDIR"/collectd.conf"
#endif
+#ifndef LOCALSTATEDIR
+#define LOCALSTATEDIR PREFIX "/var"
+#endif
+
#ifndef PKGLOCALSTATEDIR
#define PKGLOCALSTATEDIR PREFIX "/var/lib/" PACKAGE_NAME
#endif
diff --git a/src/unixsock.c b/src/unixsock.c
index 215abdd01ec1daeaf8819781bbdd79cac5cc4af9..6302b17f4a279283fc88294091f21d1102e07d7e 100644 (file)
--- a/src/unixsock.c
+++ b/src/unixsock.c
# define UNIX_PATH_MAX sizeof (((struct sockaddr_un *)0)->sun_path)
#endif
-#define US_DEFAULT_PATH PREFIX"/var/run/"PACKAGE_NAME"-unixsock"
+#define US_DEFAULT_PATH LOCALSTATEDIR"/run/"PACKAGE_NAME"-unixsock"
/*
* Private data structures