Changeset 23968


Ignore:
Timestamp:
Apr 14, 2007, 3:34:33 AM (14 years ago)
Author:
pguyot@…
Message:

New option universal_variant to disable the automatic addition of the universal variant on MacOS X, with new tests to test this behavior.

Location:
trunk/base
Files:
8 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/doc/portfile.7

    r23890 r23968  
    13321332.Sy Example:
    13331333.Dl default_variants +ssl +tcpd
     1334.It Ic unversal_variant
     1335When using MacPorts on MacOS X, a universal variant is defined and
     1336the default behavior is to configure ports with universal flags
     1337(see the
     1338.Ic UNIVERSAL TARGET HOOKS
     1339section above). The variant can be
     1340overridden if the default code does not work. It can also be
     1341suppressed if having a universal variant for the port does not make
     1342sense. To suppress it, use the
     1343.Ic universal_variant
     1344option.
     1345.br
     1346.Sy Type:
     1347.Em optional
     1348.br
     1349.Sy Default:
     1350.Em yes
     1351.br
     1352.Sy Example:
     1353.Dl universal_variant no
    13341354.El
    13351355.Sh PLATFORM OPTIONS
  • trunk/base/src/port1.0/portmain.tcl

    r23098 r23968  
    111111                configure.ldflags-append ${configure.universal_ldflags}
    112112        }
     113
     114        # This is not a standard option, because we need to take an action when it's
     115        # set, in order to alter the PortInfo structure in time.
     116        proc universal_variant {state} {
     117                if {${state} == "no"} {
     118                        variant_undef universal
     119                }
     120        }
    113121}
    114122
  • trunk/base/src/port1.0/portutil.tcl

    r23700 r23968  
    402402   
    403403    set variations($name) -
     404}
     405
     406# variant_undef name
     407# Undefine a variant for the current portfile.
     408proc variant_undef {name} {
     409    global variations PortInfo
     410   
     411    # Remove it from the list of selected variations.
     412    array unset variations $name
     413
     414        # Remove the variant from the portinfo.
     415        if {[info exists PortInfo(variants)]} {
     416                set variant_index [lsearch -exact $PortInfo(variants) $name]
     417                if {$variant_index >= 0} {
     418                        set new_list [lreplace $PortInfo(variants) $variant_index $variant_index]
     419                        if {"$new_list" == {}} {
     420                                unset PortInfo(variants)
     421                        } else {
     422                                set PortInfo(variants) $new_list
     423                        }
     424                }
     425        }
    404426}
    405427
  • trunk/base/tests/Makefile

    r23701 r23968  
    11include ../Mk/dports.autoconf.mk
    22
    3 TESTS?=checksums-1 cvs-and-patchsites envvariables site-tags trace xcodeversion dependencies-c
     3TESTS?=checksums-1 cvs-and-patchsites envvariables site-tags trace universal universal-2 xcodeversion dependencies-c
    44
    55.PHONY: test clean PortIndex
Note: See TracChangeset for help on using the changeset viewer.