[rrd-developers] [PATCH] rrdtool 1.0.47 breakage for older perls

Blair Zajac blair at orcaware.com
Tue Apr 6 01:52:07 MEST 2004


Hi Tobi,

Two issues in 1.0.47 break rrdtool on Perl's older than 5.6.x.
I still find Orca users with 5.005 perls, so I have an interest
in getting this fixed.

The addition of the CCFLAGS line in perl-shared/Makefile.PL.in
in 1.0.47 causes RRDs.so to not compile on older Perls because
by default CCFLAGS is set to '-Dbool=char -DHAS_BOOL' and the
new CCFLAGS setting overrides this:

diff -ru rrdtool-1.0.46/perl-shared/Makefile.PL.in rrdtool-1.0.47/perl-shared/Makefile.PL.in
--- rrdtool-1.0.46/perl-shared/Makefile.PL.in   2003-08-12 14:50:06.000000000 -0700
+++ rrdtool-1.0.47/perl-shared/Makefile.PL.in   2004-04-03 06:33:13.000000000 -0800
@@ -10,10 +10,11 @@
     'NAME'         => 'RRDs',
     'VERSION_FROM' => '@top_srcdir@/perl-shared/RRDs.pm', # finds $VERSION
     'DEFINE'      => "-DPERLPATCHLEVEL=$Config{PATCHLEVEL}",
-    'INC'          => '-I at top_srcdir@/src -I at top_srcdir@/gd1.3',
+    'INC'          => '-I at top_srcdir@ -I at top_srcdir@/src -I at top_srcdir@/gd1.3',
+    'CCFLAGS'      => '-DHAVE_CONFIG_H',
     # where to look for the necessary libraries
     # Perl will figure out which one is valid
-    'depend'      => {'RRDs.c' => "../src/.libs/librrd_private.a"},
+    'depend'      => {'RRDs.c' => "@top_srcdir@/src/.libs/librrd_private.a"},
     'dynamic_lib'  => {'OTHERLDFLAGS' => "$librrd -lm"},
     'realclean'    => {FILES => 't/demo?.rrd t/demo?.gif' }
 );

make[5]: Entering directory `/tmp/rrdtool-1.0.47/perl-shared'
cp ntmake.pl blib/lib/ntmake.pl
cp RRDs.pm blib/lib/RRDs.pm
/opt/i386-linux/installed/perl-5.005_03/bin/perl /opt/i386-linux/installed/perl-
5.005_03/lib/5.00503/ExtUtils/xsubpp  -typemap /opt/i386-linux/installed/perl-5.
005_03/lib/5.00503/ExtUtils/typemap  RRDs.xs > RRDs.xsc && mv RRDs.xsc RRDs.c
/opt/i386-linux/gcc/bin/gcc -c  -I.. -I../src -I../gd1.3 -DHAVE_CONFIG_H -O3   -
DVERSION=\"1.000471\" -DXS_VERSION=\"1.000471\" -fpic "-I/opt/i386-linux/install
ed/perl-5.005_03/lib/5.00503/i686-linux/CORE"  -DPERLPATCHLEVEL=5 RRDs.c
In file included from /opt/i386-linux/installed/perl-5.005_03/lib/5.00503/i686-l
inux/CORE/perl.h:1276,
                 from RRDs.xs:6:
/opt/i386-linux/installed/perl-5.005_03/lib/5.00503/i686-linux/CORE/cop.h:217: e
rror: parse error before "bool"

Here's a patch to fix the problem:

% diff -ru ../rrdtool-1.0.47-orig .
diff -ru ../rrdtool-1.0.47-orig/perl-shared/Makefile.PL.in ./perl-shared/Makefile.PL.in
--- ../rrdtool-1.0.47-orig/perl-shared/Makefile.PL.in   2004-04-03 06:33:13.000000000 -0800
+++ ./perl-shared/Makefile.PL.in        2004-04-05 11:28:15.000000000 -0700
@@ -11,7 +11,7 @@
     'VERSION_FROM' => '@top_srcdir@/perl-shared/RRDs.pm', # finds $VERSION
     'DEFINE'      => "-DPERLPATCHLEVEL=$Config{PATCHLEVEL}",
     'INC'          => '-I at top_srcdir@ -I at top_srcdir@/src -I at top_srcdir@/gd1.3',
-    'CCFLAGS'      => '-DHAVE_CONFIG_H',
+    'CCFLAGS'      => "$Config{ccflags} -DHAVE_CONFIG_H",
     # where to look for the necessary libraries
     # Perl will figure out which one is valid
     'depend'      => {'RRDs.c' => "@top_srcdir@/src/.libs/librrd_private.a"},

The second issue is that the new rrd_times() function in RRDs.xs uses
newSVuv:

+               PUSHs(sv_2mortal(newSVuv(start_tmp)));
+               PUSHs(sv_2mortal(newSVuv(end_tmp)));

which gets an unresolved link error when make test is run.  Greping
through various perl versions, it appears that newSVuv was only added
in Perl 5.6.x and later.

Is there anything this can be safely changed to to work with older
Perls?

Best,
Blair

-- 
Blair Zajac <blair at orcaware.com>
Plots of your system's performance - http://www.orcaware.com/orca/

--
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://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-developers mailing list