Subject: | Mmap version 0.10 failed to install under Linux 2.6.18.3 (Debian Etch) and Perl 5.8.8 built for i486-linux-gnu-thread-multi from CPAN shell |
CPAN module Mmap version 0.10 failed to install from CPAN shell
because of the following two reasons:
1. When CPAN shell unpacks distribution into a new directory,
folder is named as Mmap-Y1g24t or something like that, not
Mmap, so MakeMaker couldn't guess the real name of module.
2. In the Mmap.xs sv_undef and sv_yes are used instead of
PL_sv_undef and PL_sv_yes.
Also, no MANIFEST is present in the distribution so 'make dist'
doesn't work correctly.
I've fixed all these errors and patch for the distribution is
attached. Please, place the patched version on the
cpan.org, also it will be nice for my name to appear at the
page of Mmap module :-)
Regards,
Vitaliy Filippov <vitalif@mail.ru>
Subject: | Mmap-0.10.diff |
diff -urN Mmap-JG03Fb/Makefile.PL Mmap/Makefile.PL
--- Mmap-JG03Fb/Makefile.PL 1996-06-21 16:03:38.000000000 +0400
+++ Mmap/Makefile.PL 2007-09-05 19:27:01.000000000 +0400
@@ -1,3 +1,13 @@
use ExtUtils::MakeMaker;
-WriteMakefile();
+WriteMakefile(
+ 'NAME' => 'Mmap',
+ 'VERSION_FROM' => 'Mmap.pm', # finds $VERSION
+ 'LIBS' => [''], # e.g., '-lm'
+ 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
+ 'INC' => '', # e.g., '-I/usr/include/other'
+ 'OBJECT' => 'Mmap.o',
+ 'dist' => {
+ COMPRESS => 'gzip', SUFFIX => 'gz',
+ },
+);
diff -urN Mmap-JG03Fb/MANIFEST Mmap/MANIFEST
--- Mmap-JG03Fb/MANIFEST 1970-01-01 03:00:00.000000000 +0300
+++ Mmap/MANIFEST 2007-09-05 19:31:15.000000000 +0400
@@ -0,0 +1,9 @@
+Artistic
+Copying
+MANIFEST
+README
+Makefile.PL
+Mmap.pm
+Mmap.xs
+typemap
+t/mmap.t
diff -urN Mmap-JG03Fb/Mmap.xs Mmap/Mmap.xs
--- Mmap-JG03Fb/Mmap.xs 1996-06-21 19:41:11.000000000 +0400
+++ Mmap/Mmap.xs 2007-09-05 19:25:47.000000000 +0400
@@ -18,6 +18,11 @@
#endif
#endif
+#ifndef PL_sv_undef
+ #define PL_sv_undef sv_undef
+ #define PL_sv_yes sv_yes
+#endif
+
#ifndef MMAP_RETTYPE
#define MMAP_RETTYPE caddr_t
#endif
@@ -131,7 +136,7 @@
PROTOTYPE: $$$$*;$
CODE:
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
fd = fileno(fh);
if (fd < 0)
return;
@@ -155,14 +160,14 @@
SvCUR_set(var, len);
SvLEN_set(var, 0);
SvPOK_only(var);
- ST(0) = &sv_yes;
+ ST(0) = &PL_sv_yes;
void
munmap(var)
SV * var
PROTOTYPE: $
CODE:
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
if (munmap((MMAP_RETTYPE) SvPVX(var), SvCUR(var)) == -1)
return;
SvREADONLY_off(var);
@@ -170,4 +175,4 @@
SvCUR_set(var, 0);
SvLEN_set(var, 0);
SvOK_off(var);
- ST(0) = &sv_yes;
+ ST(0) = &PL_sv_yes;