summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-04-07 17:30:39 +0000
committerKarl Berry <karl@freefriends.org>2013-04-07 17:30:39 +0000
commit33f561b5cf55ea7f8ab75819e99741249351967e (patch)
tree8685bd871f44d76ffeff31fed18266f27d6f0a20
parentf317bfeba9575545ad21e2211b239540fb45809a (diff)
guess x86_64-darwin on new-enough systems
git-svn-id: svn://tug.org/texlive/trunk@29710 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm16
1 files changed, 12 insertions, 4 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 48c9371efa5..d79522b9b17 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -291,10 +291,18 @@ sub platform_name {
}
if ($OS eq "darwin") {
- # We never want to guess x86_64-darwin even if config.guess
- # does, because Leopard can be 64-bit but our x86_64-darwin
- # binaries will only run on Snow Leopard.
- $CPU = "universal";
+ # 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);
+ #
+ chomp (my $sysctl = `sysctl hw.cpu64bit_capable`);
+ my (undef,$hw_64_bit) = split (" ", $sysctl);
+ #
+ $CPU = ($os_major >= 10 && $os_minor >= 6 && $hw_64_bit >= 1)
+ ? "x86_64" : "universal";
+
} elsif ($CPU =~ /^i.86$/) {
$CPU = "i386"; # 586, 686, whatever
}