On Tue, Jul 08, 2008 at 10:03:11AM +0100, [EMAIL PROTECTED] wrote:
> 
> I'm now trying to integrate a new module with the build system, so that
> it builds when the other modules are built.
> 
> I've implemented for Linux and Solaris.  I've put the OS-specific code
> in files names io_helper_linux.c and io_helper_solaris.c respectively.
> 
> I wanted to use something like this as my Makefile.am, but I'm not sure
> how to make @OS@ work the way it does for libmetric:

It won't, @OS@ is only valid inside libmetrics and your module is managed by
the top level configure instead.

adding "OS" to the main configure.in would be simple though if you just mimic
the way it is done in libmetrics configure.in by adding an OS variable inside
the case for all platforms, add the file you want to update to the AC_OUTPUT
macro and add an AC_SUBST(OS) call.

but you are going to need to create at least stub files for all supported
architectures or break while building there and if that is the case would be
probably simpler to just #ifdef in one file to include each supported
platform code using the per platform #define in config.h (SOLARIS, LINUX,
CYGWIN ...)

> Also, are there any recommendations/examples for building C modules
> outside the Ganglia source tree so that they can be built without the
> presence of the Ganglia source?

you shouldn't need the ganglia source but only the ganglia public headers (the
ones installed in /usr/include) and the libganglia library.

you will need the APR headers/library as well and link with them an libganglia
using something like (for mod_example.c)

  $ gcc -std=gnu99 -D_LARGEFILE64_SOURCE -fpic -shared -lapr-1 -lganglia 
-I/usr/include/apr-1 -o modexample.so mod_example.c

Carlo

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to