Mailing List Archive

Multiple typemap files with MakeMaker
A co-worker just came and asked me how to specify that you want to use
multiple typemap files in an extension (he wanted to use the default plus
Tk's typemap file).

I dug around in MakeMaker.pm and found you can do this by simply rewriting
the MY::tool_xsubpp subroutine, but I also noticed that the code in that
routine seems incorrect.

The pod file for xsubpp seems to say you need to say:

-typemap file1 -typemap file2 -typemap file3

However, the code in MakeMaker (4.16) says:

my(@tmargs) = map("-typemap $_", @tmdeps);
"...
XSUBPPARGS = @tmargs
";

Thus if @tmdeps ever contains three values, then won't the args to xsubpp be:

-typemap file1 file2 file3

I can't seem to find the map function defined anywhere....

Can someone who knows more than me help explain this to me?

Thanks,
Jeff
Re: Multiple typemap files with MakeMaker [ In reply to ]
jeff> A co-worker just came and asked me how to specify that you want to use
jeff> multiple typemap files in an extension (he wanted to use the default plus
jeff> Tk's typemap file).

Dean sent me a patch recently that fixes that. Current MM supports
multiple typemaps. Grab it from CPAN/authors/id/ANDK.

jeff> [...]


jeff> I can't seem to find the map function defined anywhere....

That's in the regular perlfunc manpage:)

jeff> Can someone who knows more than me help explain this to me?

jeff> Thanks,
jeff> Jeff


Regards,
andreas
Re: Multiple typemap files with MakeMaker [ In reply to ]
> From: Jeff Okamoto <okamoto@hpcc123.corp.hp.com>
>
> I dug around in MakeMaker.pm and found you can do this by simply rewriting
> the MY::tool_xsubpp subroutine, but I also noticed that the code in that
> routine seems incorrect.
>
> The pod file for xsubpp seems to say you need to say:
>
> -typemap file1 -typemap file2 -typemap file3
>
> However, the code in MakeMaker (4.16) says:
>
> my(@tmargs) = map("-typemap $_", @tmdeps);
> "...
> XSUBPPARGS = @tmargs
> ";
>
> Thus if @tmdeps ever contains three values, then won't the args to xsubpp be:
>
> -typemap file1 file2 file3

No. The code is fine.

> I can't seem to find the map function defined anywhere....

man perlfunc

Tim.