Intent was to generate a valid $_rootdir and keep the rest (although I  
am uncertain of its relevance). The second thing a patch should do is  
check if *any* typemap is found and warn (or die?) if not.

Christian

On 15/09/2009, at 1:04 PM, Chris Marshall wrote:

> Christian Soeller wrote:
>> I have assembled a bit of code that tries to determine the location  
>> of  'typemap' in a more robust way, see below. Only tested on OS X  
>> 10.5.8  so far. Would this be a viable replacement for the current  
>> logic in  PP.pm (or does anybody know of a better way)? If so it  
>> needs testing  on a bunch of platforms.
>
> Looks reasonable to me.  Does this replace the entire hierarchy
> of directories searched for typemap or is the intent to generate
> a valid $_rootdir?
>
> At any rate, with a modified PP.pm, we could easily release
> a developers snapshot of PDL to let the automated testers
> kick the tires a bit to see what breaks.
>
> --Chris
>
>> Christian
>> use File::Basename;
>> use File::Spec;
>> # so we get the system to pick up the path to the ExtUtils folder
>> require ExtUtils::MakeMaker;
>> my @res = grep /ExtUtils.*MakeMaker.pm/, keys %INC;
>> my $dir;
>> if (@res == 1) {
>>     $dir = dirname($INC{$res[0]});
>> } else {
>>     die "couldn't find ExtUtils::MakeMaker in %INC hash";
>> }
>> $tmloc = File::Spec->catfile($dir,'typemap');
>> if (-f $tmloc) {
>>     print "found typemap at $tmloc\n";
>> } else {
>>     die "no typemap at $tmloc";
>> }
>> On 5/09/2009, at 10:13 PM, Benjamin Schuster-Boeckler wrote:
>>> Yes, that did it! Thanks a lot, I don't think I'd have spotted that.
>>>
>>> Ben
>>>
>>> On 5 Sep 2009, at 11:46, Christian Soeller wrote:
>>>
>>>> For what it's worth, I came across a similar problem the other  
>>>> day.  Basically, the (probably flaky) way that PP.pm guesses at  
>>>> the  location of typemap files seems to fail on OS X.
>>>>
>>>> The line
>>>>
>>>> my $_rootdir=$Config{installprivlib}."/ExtUtils/";
>>>>
>>>> is *not* finding typemap in any of the subdirs.
>>>>
>>>> I ended up hardcoding the location to the correct ExtUtils dir   
>>>> after finding it eventually:
>>>>
>>>> # try hardcoding for the moment
>>>> my $_rootdir="/System/Library/Perl/5.8.8/ExtUtils/";
>>>>
>>>> There should be a better (fully platform independent) way using  
>>>> one  of the Config vars or using the value of @INC or some such,  
>>>> maybe  somebody skilled in the art can enlighten us.
>>>>
>>>> Hope that helps,
>>>>
>>>> Christian

--
Christian Soeller PhD   Dept. of Physiology  +64 9 3737599 x82770
University of Auckland  Auckland, New Zealand  fax +64 9 3737499



_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to