[collectd] [PATCH] Allow out-of-tree builds

Florian Forster octo at collectd.org
Sun Feb 3 13:17:24 CET 2013


Hi Dan,

On Sat, Feb 02, 2013 at 01:26:43AM +0100, Dan Fandrich wrote:
> The generated header file lcc_features.h and collectd.h cause problems
> otherwise.

thanks a lot for your patch!

> +AM_CPPFLAGS += -I$(top_builddir)/src/libcollectdclient/collectd

Since binaries using the library need to get linked to it, and not all
binaries are, I think I'd rather add this to the binary specific CPP
flags, i.e.:

collectd{_nagios,ctl,_tg}_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_builddir)/src/libcollectdclient/collectd

I was wondering why we don't run into the same problem with the
autogenerated "src/config.h". I believe the reason is the
AC_CONFIG_HEADERS() macro which, I believe, adds $(top_builddir)/src to
the include list. My attempts to solving this problem using this macro
failed, however, because it seems that the semantic of
AC_CONFIG_HEADERS() and AC_CONFIG_FILES() differ quite dramatically: The
former doesn't expand the @FOO@ placeholders, making the macro unusable
for the use-case of "lcc_features.h".

"It seems", because I fail to parse the documentation. It reads:

"Make AC_OUTPUT create the file(s) in the blank-or-newline-separated
list header containing C preprocessor #define statements, and replace
‘@DEFS@’ in generated files with -DHAVE_CONFIG_H instead of the value of
DEFS."

Do you happen to have an idea if I'm doing something wrong here? I think
adding the builddir to the include paths is probably going to be the
easiest and most straight forward solution and I'll do that for now.

Thanks and best regards,
—octo
-- 
collectd – The system statistics collection daemon
Website: http://collectd.org
Google+: http://collectd.org/+
GitHub:  https://github.com/collectd
Twitter: http://twitter.com/collectd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20130203/202529c1/attachment.pgp>


More information about the collectd mailing list