[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problems building modules from cpan



On Sun, Apr 04, 2004 at 01:19:26AM +0200, Sven Wilhelm wrote:
>anyone an idea where the problem could be when building modules from 
>cpan that use shared libraries (eg. Compress::Bzip2).
[...]
>Manifying blib/man3/Compress::Bzip2.3pm
>  /usr/bin/make  -- OK
>Running make test
>PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" 
>"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
>t/test....Can't load 
>'/var/cache/cpan/build/Compress-Bzip2-1.00/blib/arch/auto/Compress/Bzip2/Bzip2.so' 
>for module Compress::Bzip2: 
>/var/cache/cpan/build/Compress-Bzip2-1.00/blib/arch/auto/Compress/Bzip2/Bzip2.so: 
>undefined symbol: bzBuffToBuffCompress at /usr/lib/perl/5.8/DynaLoader.pm 
>line 225.
> at t/test.t line 8

It would appear that the module was written for a different bzip2 API
than provided by libbz2-dev (1.0.2-1).

Making the appended changes to the module appears to fix the problem.
Note however that the test script doesn't produce typical test output,
so "make test" will still fail.

In short, this is a problem with the module.  Contact the author.

--bod

--- Bzip2.xs.orig	2004-04-05 09:00:42.000000000 +1000
+++ Bzip2.xs	2004-04-05 08:55:22.000000000 +1000
@@ -41,8 +41,8 @@
 PROTOTYPES:	ENABLE
 
 BOOT:
-	if (bzlibVersion() == NULL)
-		croak("Compress::Bzip2 cannot load bzip-libraray %s\n",bzlibVersion()) ;
+	if (BZ2_bzlibVersion() == NULL)
+		croak("Compress::Bzip2 cannot load bzip-libraray %s\n",BZ2_bzlibVersion()) ;
 
 double
 constant(name, arg)
@@ -76,7 +76,7 @@
 		new_len = out_len;
 
 		out[0] = 0xf0;
-		err = bzBuffToBuffCompress(out+5,&new_len,in,in_len,6,0,240);
+		err = BZ2_bzBuffToBuffCompress(out+5,&new_len,in,in_len,6,0,240);
 
 		if (err != BZ_OK || new_len > out_len)
 		{
@@ -113,7 +113,7 @@
 		SvPOK_only(RETVAL);
 		out = SvPVX(RETVAL);
 		new_len = out_len;
-		err = bzBuffToBuffDecompress(out,&new_len,in+5,in_len,0,0);
+		err = BZ2_bzBuffToBuffDecompress(out,&new_len,in+5,in_len,0,0);
 		if (err != BZ_OK || new_len != out_len)
 		{
 			SvREFCNT_dec(RETVAL);



Reply to: