[prev in list] [next in list] [prev in thread] [next in thread] 

List:       collectd
Subject:    Re: [collectd] Documentation to write Plugins
From:       Marc Fournier <marc.fournier () camptocamp ! com>
Date:       2016-09-15 6:02:37
Message-ID: 20160915060232.xrnhzlvxukaec2fb () lonquimay ! wrk ! lsn ! camptocamp ! com
[Download RAW message or body]

On Tue, Sep 13, 2016 at 11:25:35AM +0200, Thijs Cramer wrote:
> Nice! That helps a lot!
> Is there any guide on how to compile/test properly? I couldn't find
> any guide on how the .c code is included.

Something along these lines *should* work:

gcc -DHAVE_CONFIG_H -Wall -Werror -g -O2 -shared -fPIC -Isrc/ -Isrc/daemon/ -ldl -o \
myplugin.so contrib/examples/myplugin.c

Although it seems there are a couple of issues with this myplugin.c example
(include paths are incorrect to start with).


> Can i presume that the make script will automatically compile all .c
> files in the /src directory and include them in the CollectD builtin
> plugins?
> (as in, there is no hard linking of plugin source code files)

For the "automatic" part to happen, the plugin needs to get declared in
configure.ac and src/Makefile.am, then the build.sh script ran. This will
generate the configure script, which itself will generate the Makefiles.

Take a look at a recent pull-request adding a new plugin on github.
https://github.com/collectd/collectd/pull/1805/files is a good example.

HTH,
Marc


_______________________________________________
collectd mailing list
collectd@verplant.org
https://mailman.verplant.org/listinfo/collectd


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic