diff -Nurd -x'*~' Inline-C-0.78.orig/lib/Inline/C.pm Inline-C-0.78/lib/Inline/C.pm --- Inline-C-0.78.orig/lib/Inline/C.pm 2017-05-30 16:58:53.000000000 -0400 +++ Inline-C-0.78/lib/Inline/C.pm 2018-01-16 13:17:41.000000000 -0500 @@ -873,10 +873,22 @@ sub makefile_pl { my ($o) = @_; my $perl; - -f ($perl = $Config::Config{perlpath}) - or ($perl = $^X) - or croak "Can't locate your perl binary"; - $perl = qq{"$perl"} if $perl =~ m/\s/; + $perl = $^X; + if ($] >= 5.010 && $Config{"byteorder"} =~ /^1/) { + # little-endian means intel (not powerpc), for which fink has + # multiple single-arch distros that are seen by a single (fat) + # perl interp from apple for a perl version supported by fink + # (i.e., starting with 5.10.0). This is the logic taken from + # Fink::PkgVersion as of fink-0.29.13. + if ( $Config{"longsize"} == 4 ) { + $perl = "/usr/bin/arch -i386 $^X"; # 32-bit + } else { + $perl = "/usr/bin/arch -x86_64 $^X"; # 64-bit + } + } elsif ($perl !~ /^\//) { + $perl = "/usr/bin/env $^X"; + } + $perl = "ARCHFLAGS=\"\" $perl"; # more unfattening $o->system_call("$perl Makefile.PL", 'out.Makefile_PL'); $o->fix_make; }