Subject: | Cannot build File::FnMatch on perls older than 5.6.1 |
Hello,
I'm working on upgrading my Apache::ConfigParser module in CPAN to use
your module to find Apache configuration files that are specified by
an fnmatch regex.. Apache::ConfigParser supports Perl 5.005_03 and
5.005_04, but these versions cannot build File::FnMatch.
I was able to get it going with the following steps.
1) cd into File-FnMatch-0.01.
2) Generate a newer ppport.h using the latest version of Perl you can find
and the latest version of Devel::PPPort. On my system, I have a self
compiled version of 5.8.6 with the latest Devel::PPPort installed from
CPAN.
$ /opt/i386-linux/installed/perl-5.8.6/bin/perl -MDevel::PPPort \
-e 'Devel::PPPort::WriteFile()'
This replaces ppport.h with a newer version.
3) Then run
perl ppport.h
and follow it's advice.
$ perl ppport.h
Scanning ./FnMatch.xs ...
=== Analyzing ./FnMatch.xs ===
Uses SvPV_nolen, which depends on sv_2pv_nolen
Uses gv_stashpvn
Show quoted text
--- hint for gv_stashpvn ---
This function's backport doesn't support the length parameter, but
rather ignores it. Portability can only be ensured if the length
parameter is used for speed reasons, but the length can always be
correctly computed from the string argument.
Uses newCONSTSUB
--- hint for newCONSTSUB ---
Returns a CV* as of perl-5.7.1. This return value is not supported
by Devel::PPPort.
File needs newCONSTSUB, adding static request
File needs sv_2pv_nolen, adding static request
Suggested changes:
--- ./FnMatch.xs 2005-03-25 14:18:23.204706019 -0800
+++ ./FnMatch.xs.patched 2005-03-25 14:18:26.613067270 -0800
@@ -2,6 +2,8 @@
#include "perl.h"
#include "XSUB.h"
+#define NEED_newCONSTSUB
+#define NEED_sv_2pv_nolen
#include "ppport.h"
#include <fnmatch.h>
When I add the
+#define NEED_newCONSTSUB
+#define NEED_sv_2pv_nolen
to FnMatch.xs, then it compiles just fine even with Perl 5.004_05. I
don't know if the other advice ppport.h mentions should be followed or
not, as I'm not an XS expert.
Regards,
Blair