diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index e645cc07b12..df4624e84ef 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -287,17 +287,41 @@ sub platform_name { } if ($OS eq "darwin") { - # We want to guess x86_64-darwin on new-enough systems. - # Most robust approach is to check sw_vers (os version) - # and sysctl (processor hardware). - chomp (my $sw_vers = `sw_vers -productVersion`); - my ($os_major,$os_minor) = split (/\./, $sw_vers); + # We have a variety of Mac binary sets. + # 10.10/Yosemite and newer: + # -> x86_64-darwin [MacTeX] + # 10.6/Snow Leopard through 10.9/Mavericks: + # -> x86_64-darwinlegacy if 64-bit + # -> i386-darwin otherwise + # 10.5/Leopard and older: + # -> i386-darwin if x86 + # -> powerpc-darwin if ppc # - chomp (my $sysctl = `PATH=/usr/sbin:\$PATH sysctl hw.cpu64bit_capable`); - my (undef,$hw_64_bit) = split (" ", $sysctl); + my $mactex_version = 10; # this will change in the future. # - $CPU = ($os_major >= 10 && $os_minor >= 6 && $hw_64_bit >= 1) - ? "x86_64" : "universal"; + # Most robust approach is apparently to check sw_vers (os version, + # returns "10.x" values), and sysctl (processor hardware). + chomp (my $sw_vers = `sw_vers -productVersion`); + my ($os_major,$os_minor) = split (/\./, $sw_vers); + if ($os_major != 10) { + warn "$0: only MacOSX is supported, not $OS $os_major.$os_minor (from $sw_vers)\n"; + return "unknown-unknown"; + } + if ($os_minor >= $mactex_darwin) { + ; # current version, default is ok (x86_64-darwin). + } elsif ($os_minor >= 6 && $os_minor < $mactex_darwin) { + # in between, x86 hardware only. On 10.6 only, must check if 64-bit, + # since if later than that, always 64-bit. + my $is64 = $os_minor == 6 + ? `/usr/sbin/sysctl -n hw.cpu64bit_capable` >= 1 + : 1; + if ($is64) { + $CPU = "x86_64"; + $OS = "darwinlegacy"; + } # if not 64-bit, default is ok (i386-darwin). + } else { + ; # older version, default is ok (i386-darwin, powerpc-darwin). + } } elsif ($CPU =~ /^i.86$/) { $CPU = "i386"; # 586, 686, whatever @@ -329,7 +353,7 @@ sub platform_desc { 'armhf-linux' => 'GNU/Linux on ARMhf', 'hppa-hpux' => 'HP-UX', 'i386-cygwin' => 'Cygwin on Intel x86', - 'i386-darwin' => 'MacOSX/Darwin on Intel x86', + 'i386-darwin' => 'MacOSX/Darwin legacy, on Intel x86', 'i386-freebsd' => 'FreeBSD on Intel x86', 'i386-kfreebsd' => 'GNU/kFreeBSD on Intel x86', 'i386-openbsd' => 'OpenBSD on Intel x86', @@ -339,14 +363,15 @@ sub platform_desc { 'mips-irix' => 'SGI IRIX', 'mipsel-linux' => 'GNU/Linux on MIPSel', 'powerpc-aix' => 'AIX on PowerPC', - 'powerpc-darwin' => 'MacOSX/Darwin on PowerPC', + 'powerpc-darwin' => 'MacOSX/Darwin legacy on PowerPC', 'powerpc-linux' => 'GNU/Linux on PowerPC', 'sparc-linux' => 'GNU/Linux on Sparc', 'sparc-solaris' => 'Solaris on Sparc', 'universal-darwin' => 'MacOSX/Darwin universal binaries', 'win32' => 'Windows', 'x86_64-cygwin' => 'Cygwin on x86_64', - 'x86_64-darwin' => 'MacOSX/Darwin on x86_64', + 'x86_64-darwinlegacy' => 'MacOSX/Darwin legacy on x86_64', + 'x86_64-darwin' => 'MacOSX/Darwin current on x86_64', 'x86_64-linux' => 'GNU/Linux on x86_64', 'x86_64-solaris' => 'Solaris on x86_64', ); |