texlive[43846] Master/tlpkg/TeXLive/TLUtils.pm: (platform_name): more

commits+karl at tug.org commits+karl at tug.org
Sun Apr 16 20:23:31 CEST 2017


Revision: 43846
          http://tug.org/svn/texlive?view=revision&revision=43846
Author:   karl
Date:     2017-04-16 20:23:30 +0200 (Sun, 16 Apr 2017)
Log Message:
-----------
(platform_name): more and different mac binary sets.
(platform_desc) <darwin>: add "legacy" in all but the current.

Modified Paths:
--------------
    trunk/Master/tlpkg/TeXLive/TLUtils.pm

Modified: trunk/Master/tlpkg/TeXLive/TLUtils.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLUtils.pm	2017-04-16 17:39:12 UTC (rev 43845)
+++ trunk/Master/tlpkg/TeXLive/TLUtils.pm	2017-04-16 18:23:30 UTC (rev 43846)
@@ -287,17 +287,41 @@
   }
   
   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).
+    # 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
+    #
+    my $mactex_version = 10;  # this will change in the future.
+    #
+    # 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);
-    #
-    chomp (my $sysctl = `PATH=/usr/sbin:\$PATH 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";
+    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 @@
     '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,7 +363,7 @@
     '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',
@@ -346,7 +370,8 @@
     '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',
   );



More information about the tex-live-commits mailing list