src/Makefile.am: Add installation directory defines to AM_CPPFLAGS.
authorSebastian Harl <sh@tokkee.org>
Sat, 17 Nov 2007 19:49:19 +0000 (20:49 +0100)
committerFlorian Forster <octo@huhu.verplant.org>
Tue, 20 Nov 2007 08:04:43 +0000 (09:04 +0100)
Those definitions used to be available when compiling collectd itself only.
However, they should be available to the plugins as well - else, different
paths would be used within different parts of collectd.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/Makefile.am

index b7f343f..06f45dc 100644 (file)
@@ -10,6 +10,15 @@ if COMPILER_IS_GCC
 AM_CFLAGS = -Wall -Werror
 endif
 
+AM_CPPFLAGS = -DPREFIX='"${prefix}"'
+AM_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
+AM_CPPFLAGS += -DLOCALSTATEDIR='"${localstatedir}"'
+AM_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
+if BUILD_FEATURE_DAEMON
+AM_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
+endif
+AM_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
+
 sbin_PROGRAMS = collectd
 bin_PROGRAMS = collectd-nagios
 
@@ -25,14 +34,7 @@ collectd_SOURCES = collectd.c collectd.h \
                   utils_threshold.c utils_threshold.h \
                   types_list.c types_list.h
 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"'
-endif
-collectd_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
+collectd_CPPFLAGS += $(AM_CPPFLAGS)
 
 # Link to these libraries..
 collectd_LDFLAGS = -export-dynamic
@@ -574,7 +576,6 @@ endif
 if BUILD_PLUGIN_UNIXSOCK
 pkglib_LTLIBRARIES += unixsock.la
 unixsock_la_SOURCES = unixsock.c utils_cmd_putval.h utils_cmd_putval.c
-unixsock_la_CPPFLAGS = -DLOCALSTATEDIR='"${localstatedir}"'
 unixsock_la_LDFLAGS = -module -avoid-version -lpthread
 collectd_LDADD += "-dlopen" unixsock.la
 collectd_DEPENDENCIES += unixsock.la