[collectd] Compiling collectd-4.6.2 / collectd-git-repo on Solaris 10 Update 6

Florian Forster octo at verplant.org
Thu May 14 11:30:20 CEST 2009


Hi Peter,

On Thu, May 14, 2009 at 04:02:51PM +1000, Peter Bray wrote:
>    I have tried collectd-4.7.0 and required just the one alteration for
> Solaris 10 Update 6 / GCC 4.1.2 / 32-bit & 64-bit / SPARC & X86:

> -#define _XOPEN_SOURCE 600 /* glibc2 needs this for strptime */

> If glibc2 really does need this than I think it needs to be wrapped in
> a pre-processor conditional maybe like if __GLIBC__ >= 2 (seen else
> where in the code).

unfortunately, it's not that easy. To determine whether the used libc is
the GNU libc or not, we need to include <feature.h> (included via other
headers, such as <stdlib.h>), because __GLIB__ is defined there.
However, if it really *is* the GNU libc, we need to define _XOPEN_SOURCE
*before* including <feature.h>, because later is has no effect anymore.
A typical chicken-and-egg problem. :/

So I guess the only way out is – once again – to check for the glibc
using the configure script :/

> #elif !defined(_STDC_C99) && \
>          (defined(__XOPEN_OR_POSIX) && defined(_XPG6))

Out of curiosity: Have you tried to compile with c99? I. e. configure
with something like:
  ./configure CC=c99

Regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090514/4a29e65c/attachment.pgp 


More information about the collectd mailing list