[collectd] Solaris 10U4 compilation of 4.3.3

Randy Bias randyb at neotactics.com
Thu May 1 00:41:34 CEST 2008


I did not have a chance to troubleshoot all of the issues with  
building collectd, but this gave me a somewhat working version (YMMV):

make command:

make clean ; CFLAGS="-D_POSIX_C_SOURCE=199506L -D__EXTENSIONS__" ./ 
configure --prefix=/usr/local/collectd --disable-apcups --disable-csv  
--disable-mysql --disable-swap --disable-snmp; gmake -j 4

patch to collectd.h, stealing from /usr/include/firefox/dbm/mcom_db.h

--- collectd-4.3.3/src/collectd.h       Thu Apr  3 06:52:16 2008
+++ collectd-4.3.3.solaris/src/collectd.h       Wed Apr 30 15:12:43 2008
@@ -126,7 +126,42 @@
  # include <endian.h>
  #endif

+#ifdef __sun
+#define BIG_ENDIAN      4321
+#define LITTLE_ENDIAN   1234            /* LSB first: i386, vax, all  
NT risc */
+
+#ifndef __SVR4
+/* compat.h is only in 4.1.3 machines. - dp */
+#include <compat.h>
+#endif
+
+/* XXX - dp
+ * Need to find a general way of defining endian-ness in SunOS 5.3
+ * SunOS 5.4 defines _BIG_ENDIAN and _LITTLE_ENDIAN
+ * SunOS 5.3 does nothing like this.
+ */
+
  #ifndef BYTE_ORDER
+
+#if defined(_BIG_ENDIAN)
+#define BYTE_ORDER BIG_ENDIAN
+#elif defined(_LITTLE_ENDIAN)
+#define BYTE_ORDER LITTLE_ENDIAN
+#elif !defined(__SVR4)
+/* 4.1.3 is always BIG_ENDIAN as it was released only on sparc  
platforms. */
+#define BYTE_ORDER BIG_ENDIAN
+#elif !defined(vax) && !defined(ntohl) && !defined(lint) && ! 
defined(i386)
+/* 5.3 big endian. Copied this above line from sys/byteorder.h */
+/* Now we are in a 5.3 SunOS rather non 5.4 or above SunOS  */
+#define BYTE_ORDER BIG_ENDIAN
+#else
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
+
+#endif /* !BYTE_ORDER */
+#endif /* __sun */
+
+#ifndef BYTE_ORDER
  # ifdef __BYTE_ORDER
  #  define BYTE_ORDER __BYTE_ORDER
  # endif


Ps.  If someone wants to help make this cleaner I will provide a  
Solaris and a Nexenta box to make it build on.

Randy Bias, chief tactician, neoTactics, Inc.
(877) NEO-TKTX, randyb at neotactics.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.verplant.org/pipermail/collectd/attachments/20080430/6e1b6873/attachment.htm 


More information about the collectd mailing list