[rrd-developers] [PATCH] rrdtool 1.0.50 build on Ubuntu Breezy Badger

Blair Zajac blair at orcaware.com
Mon Nov 28 08:29:56 MET 2005


I'm still supporting rrdtool 1.0.50 on Ubuntu Breezy Badger with gcc 4.0.2 for 
my Orca data graphing package and needed the below patch to get it to compile. 
I'm sending this here for future reference in case anybody has trouble compiling 
it.  Without the patch, I received these compile errors.

     $ cc -c -I.. -I../src -I../gd1.3 -D_REENTRANT -D_GNU_SOURCE
     -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe
     -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
     -DHAVE_CONFIG_H -O2 -DVERSION=\"1.000503\"
     -DXS_VERSION=\"1.000503\" -fPIC "-I/usr/lib/perl/5.8/CORE"
     In file included from ../src/rrd_tool.h:25,
                      from RRDs.xs:13:
     ../src/config_aux.h:8:1: warning: "strchr" redefined
     In file included from /usr/include/string.h:417,
                      from /usr/lib/perl/5.8/CORE/perl.h:731,
                      from RRDs.xs:6:
     /usr/include/bits/string2.h:396:1: warning: this is the location
     of the previous definition
     In file included from ../src/rrd_tool.h:25,
                      from RRDs.xs:13:
     ../src/config_aux.h:80:2: error: #error "Can't compile without
     finite function"
     ../src/config_aux.h:84:2: error: #error "Can't compile without
     isinf function"

Here's the patch:

--- packages/rrdtool-1.0.50/perl-shared/RRDs.xs (revision 514)
+++ packages/rrdtool-1.0.50/perl-shared/RRDs.xs (revision 515)
@@ -10,8 +10,28 @@

+ * rrd_tool.h includes config.h, but at least on Ubuntu Breezy Badger
+ * 5.10 with gcc 4.0.2, the C preprocessor picks up Perl's config.h
+ * which is included from the Perl includes and never reads rrdtool's
+ * config.h.  Without including rrdtool's config.h, this module does
+ * not compile, so include it here with an explicit path.
+ *
+ * Because rrdtool's config.h redefines VERSION which is originally
+ * set via Perl's Makefile.PL and passed down to the C compiler's
+ * command line, save the original value and reset it after the
+ * includes.
+ */
+#undef VERSION
+#include "../config.h"
  #include "../src/rrd_tool.h"

+#undef VERSION
  /* perl 5.004 compatibility */
  #define PL_sv_undef sv_undef


Blair Zajac, Ph.D.
<blair at orcaware.com>
Subversion and Orca training and consulting

Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-developers
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

More information about the rrd-developers mailing list