On Mon, Jul 28, 2003 at 07:08:51PM +0200, Stas Bekman wrote:
> The latest MakeMaker's xsubpp_version (from MM_Unix.pm) fails with the
> latest maint perl-5.8.1 (works with 5.8.0). It generates a test .xs files
> which the latest maint perl doesn't like. Here is the generated file:
>
> temp000
> -------
>
> MODULE = fred PACKAGE = fred
>
> int
> fred(a)
> int a;
>
> Here is the error:
>
> perl -le 'qx[perl5.8.1
> /home/stas/perl/5.8.1-ithread/lib/5.8.1/ExtUtils/xsubpp temp000]; print
> "failed" if $?'
> Error: No INPUT definition for type 'int', typekind 'T_IV' found in
> temp000, line 5
> Error: No OUTPUT definition for type 'int', typekind 'T_IV' found in
> temp000, line 5
> Please specify prototyping behavior for temp000 (see perlxs manual)
> failed
>
> adding '-typemap
> /home/stas/perl/5.8.1-ithread/lib/5.8.1/ExtUtils/typemap'
> solves the problem, however I'll leave to Michael to decide how the
> best to code that.
What directory did you run this from? xsubpp doesn't know the real location
of your installed typemap file, it just fumbles around in directories above
it looking around. Its MakeMaker that figures that bit out.
So no, the above won't work unless you happen to be running xsubpp from
a directory where there's also a typemap file, or one nearby. It could
be argued that since xsubpp and typemap are installed in the same
directory, FindBin could help here. Something like the patch below?
Its left as an exercise for the mailing list to determine where in
that odd search list $Bin/typemap should go. I put it last so that
searches for the typemap while installing a new Perl won't find previously
installed versions before it finds the new one.
--- lib/ExtUtils/xsubpp 2003/07/28 22:59:13 1.1
+++ lib/ExtUtils/xsubpp 2003/07/28 23:01:33
@@ -103,6 +103,7 @@
=cut
require 5.002;
+use FindBin qw($Bin);
use Cwd;
use vars qw($cplusplus $hiertype);
use vars '%v';
@@ -215,8 +216,10 @@
die "Can't find $typemap in $pwd\n" unless -r $typemap;
}
unshift @tm, qw(../../../../lib/ExtUtils/typemap ../../../lib/ExtUtils/typemap
- ../../lib/ExtUtils/typemap ../../../typemap ../../typemap
- ../typemap typemap);
+ ../../lib/ExtUtils/typemap
+ ../../../typemap ../../typemap ../typemap typemap
+ $Bin/typemap
+ );
foreach $typemap (@tm) {
next unless -f $typemap ;
# skip directories, binary files etc.
--
How can you get very far,
If you don't know Who You Are?
How can you do what you ought,
If you don't know What You've Got?