diff -Nurd -x'*~' Mac-Glue-1.30.orig/make_glues Mac-Glue-1.30/make_glues --- Mac-Glue-1.30.orig/make_glues 2004-05-19 11:58:41.000000000 -0400 +++ Mac-Glue-1.30/make_glues 2010-08-14 13:32:21.000000000 -0400 @@ -1,6 +1,7 @@ #!perl -w use strict; use Mac::MoreFiles; +use Config; my($lib, $script) = @ARGV; my @apps = 'MACS'; # Finder @@ -9,9 +10,24 @@ push @apps, 'sevs', 'imev' if $^O ne 'MacOS'; my @paths = map { $Application{$_} } @apps; -system($^X, $lib, "$script/gluedialect", '-I'); +my @command; +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. + push @command, '/usr/bin/arch'; + if ( $Config{"longsize"} == 4 ) { + push @command, '-i386'; # 32-bit + } else { + push @command, '-x86_64'; # 64-bit + } +} +push @command, $^X; +system(@command, $lib, "$script/gluedialect", '-I'); -my $aout = `$^X $lib $script/gluescriptadds -I 2>&1`; +my $aout = `@command $lib $script/gluescriptadds -I 2>&1`; while ($aout =~ s!(?:^|\n).+does not appear to be an addition.+?\n Try: blib/script/gluemac '(.+?)'\n!\n!) { push @paths, $1; }