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

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


Revision: 142893
          https://trac.macports.org/changeset/142893
Author:   mcalhoun at macports.org
Date:     2015-11-26 08:04:36 -0800 (Thu, 26 Nov 2015)
Log Message:
-----------
gmp: add variant to build for a specific CPU

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

Modified: trunk/dports/devel/gmp/Portfile
===================================================================
--- trunk/dports/devel/gmp/Portfile	2015-11-26 15:03:12 UTC (rev 142892)
+++ trunk/dports/devel/gmp/Portfile	2015-11-26 16:04:36 UTC (rev 142893)
@@ -45,6 +45,8 @@
 
 # Prevent precompiled binaries.
 # See #41614.
+# might not be needed if we decice to add:
+#default_variants +core2
 archive_sites
 
 configure.universal_args-delete --disable-dependency-tracking
@@ -87,6 +89,32 @@
 test.run        yes
 test.target     check
 
+# see configure.ac for possible CPU values and what each does
+set processors {core2}
+
+foreach processor ${processors} {
+
+    # only one processor variant can be used, so create a list of every other processor variant to conflict with
+    set conflicts_list ""
+    foreach processor_conflict ${processors} {
+        if { ${processor_conflict} ne ${processor} } {
+            lappend conflicts_list ${processor_conflict}
+        }
+    }
+
+    # use eval to ensure a list of conflicts works properly
+    eval "variant ${processor} conflicts ${conflicts_list} description {do not let ${name} determine CPU type; build for ${processor}} { }"
+}
+
+# if any of the processor variants are active, CPU is not auto-detected
+set auto_cpu true
+foreach processor ${processors} {
+    if { [variant_isset ${processor}] } {
+        configure.args-append --build=${processor}-apple-${os.platform}${os.version}
+        set auto_cpu false
+    }
+}
+
 # config.guess: "Print the host system CPU-VENDOR-OS."
 # config.guess calls configfsf.guess and then tries to improve the result
 #
@@ -109,6 +137,7 @@
 # in an attempt to accommodate all situations,
 #    test if the CPU was improved and warn if it was not
 #
+if { ${auto_cpu} } {
 pre-configure {
     set build_triplet [split [exec -ignorestderr /usr/bin/env CC=${configure.cc} ${worksrcpath}/config.guess] -]
     set build_cpu     [lindex $build_triplet 0]
@@ -118,6 +147,7 @@
         #configure.args-append --build=core2-[join [lrange $build_triplet 1 end] -]
     }
 }
+}
 
 if {![variant_isset universal]} {
     if {${build_arch} eq "x86_64"} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151212/6c86731c/attachment.html>


More information about the macports-changes mailing list