[142890] trunk/dports/devel/gmp/Portfile

mcalhoun at macports.org mcalhoun at macports.org
Sat Dec 12 07:40:11 PST 2015


Revision: 142890
          https://trac.macports.org/changeset/142890
Author:   mcalhoun at macports.org
Date:     2015-11-26 06:31:05 -0800 (Thu, 26 Nov 2015)
Log Message:
-----------
gmp: attempt to future-proof and fully document CPU detection

Modified Paths:
--------------
    trunk/dports/devel/gmp/Portfile

Modified: trunk/dports/devel/gmp/Portfile
===================================================================
--- trunk/dports/devel/gmp/Portfile	2015-11-26 12:19:46 UTC (rev 142889)
+++ trunk/dports/devel/gmp/Portfile	2015-11-26 14:31:05 UTC (rev 142890)
@@ -87,18 +87,41 @@
 test.run        yes
 test.target     check
 
+# config.guess: "Print the host system CPU-VENDOR-OS."
+# config.guess calls configfsf.guess and then tries to improve the result
+#
+# prior to 5.0.2, configfsf.guess returned
+#   i386-apple-darwinX.X.X or powerpc-apple-darwinX.X.X
+#    even on 64-bit processors
+# if config.guess were unable to improve on the result
+#    (e.g. a new unrecognized processor), then the configure script
+#    used i386 or powerpc as the CPU type and a 64-bit build attempt
+#    resulted in an error (see #28892)
+# as of 5.0.2, configfsf.guess can return
+#    x86_64-apple-darwinX.X.X and powerpc64-apple-darwinX.X.X, which,
+#    if not improved, would at least produce a (slow) 64-bit build
+#
+# up to 6.0.0a, all improved CPU types on x86 macs were of the form
+#    core2 or corei* (coreisbr for Sandy Bridge, coreihwl for Haswell, etc.)
+# starting with 6.1.0, improved CPU types on x86 macs have less uniform
+#    names (sandybridge for Sandy Bridge, haswell for Haswell, etc.)
+#
+# in an attempt to accommodate all situations,
+#    test if the CPU was improved and warn if it was not
+#
+pre-configure {
+    set build_triplet [split [exec -ignorestderr /usr/bin/env CC=${configure.cc} ${worksrcpath}/config.guess] -]
+    set build_cpu     [lindex $build_triplet 0]
+    if { ${build_cpu} eq "x86_64" || ${build_cpu} eq "i386" || ${build_cpu} eq "powerpc64" || ${build_cpu} eq "powerpc" } {
+        ui_warn "No processor dependent assembly code being used. gmp might be slower."
+        # version 5.0.2 should make the following unnecessary
+        #configure.args-append --build=core2-[join [lrange $build_triplet 1 end] -]
+    }
+}
+
 if {![variant_isset universal]} {
     if {${build_arch} eq "x86_64"} {
         configure.env-append   ABI=64
-        # Newer processors may not be detected correctly.
-        pre-configure {
-            set build_triplet [split [exec -ignorestderr /usr/bin/env CC=${configure.cc} ${worksrcpath}/config.guess] -]
-            set build_cpu [lindex $build_triplet 0]
-            if { ${build_cpu} ne "core2" && ![string match "corei*" ${build_cpu}] } {
-                ui_warn "No processor dependent assembly code being used. gmp might be slower."
-                configure.args-append --build=core2-[join [lrange $build_triplet 1 end] -]
-            }
-        }
     } elseif {${build_arch} eq "ppc64"} {
         configure.env-append   ABI=mode64
     } else {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151212/718b8c3e/attachment.html>


More information about the macports-changes mailing list