Changeset 54198


Ignore:
Timestamp:
Jul 23, 2009, 1:29:22 AM (10 years ago)
Author:
blb@…
Message:

Merge from trunk

Location:
branches/images-and-archives/base
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/images-and-archives/base

  • branches/images-and-archives/base/src/macports1.0/macports.tcl

    r53746 r54198  
    10971097    $workername eval source Portfile
    10981098
    1099     # add the default universal variant, but only if
    1100     # it will work and another one isn't already present
    1101     if {[$workername eval default_universal_variant_allowed]} {
    1102         $workername eval add_default_universal_variant
    1103     }
     1099    # add the default universal variant if appropriate, and set up flags that
     1100    # are conditional on whether universal is set
     1101    $workername eval universal_setup
    11041102
    11051103    # evaluate the variants
  • branches/images-and-archives/base/src/port1.0/portconfigure.tcl

    r53504 r54198  
    140140
    141141proc portconfigure::configure_start {args} {
    142     global UI_PREFIX configure.compiler configure.optflags configure.archflags
    143     global configure.march configure.mtune configure.universal_cflags
    144     global configure.universal_cxxflags configure.universal_cppflags
    145     global configure.universal_ldflags configure.universal_args
     142    global UI_PREFIX configure.compiler
    146143   
    147144    ui_msg "$UI_PREFIX [format [msgcat::mc "Configuring %s"] [option name]]"
     
    168165    }
    169166    ui_debug "Using compiler '$name'"
    170    
    171     # add in extra CFLAGS etc
    172     if {[variant_exists universal] && [variant_isset universal]} {
    173         foreach flag {cflags objcflags fflags f90flags fcflags} {
    174             eval configure.${flag}-append ${configure.universal_cflags}
    175         }
    176         eval configure.cxxflags-append ${configure.universal_cxxflags}
    177         eval configure.cppflags-append ${configure.universal_cppflags}
    178         eval configure.ldflags-append ${configure.universal_ldflags}
    179         eval configure.pre_args-append ${configure.universal_args}
    180     } else {
    181         foreach flag {cflags cxxflags objcflags fflags f90flags fcflags} {
    182             eval configure.${flag}-append ${configure.archflags}
    183             if {${configure.march} != {}} {
    184                 configure.${flag}-append "-march=${configure.march}"
    185             }
    186             if {${configure.mtune} != {}} {
    187                 configure.${flag}-append "-mtune=${configure.mtune}"
    188             }
    189         }
    190         eval configure.ldflags-append ${configure.archflags}
    191     }
    192167}
    193168
  • branches/images-and-archives/base/src/port1.0/portutil.tcl

    r53715 r54198  
    16311631}
    16321632
    1633 # check_statefile_variants
     1633##
    16341634# Check that recorded selection of variants match the current selection
    1635 proc check_statefile_variants {variations fd} {
     1635#
     1636# @param variations input array name of new variants
     1637# @param oldvariations output array name of old variants
     1638# @param fd file descriptor of the state file
     1639# @return 0 if variants match, 1 otherwise
     1640proc check_statefile_variants {variations oldvariations fd} {
    16361641    upvar $variations upvariations
     1642    upvar $oldvariations upoldvariations
     1643
     1644    array set upoldvariations {}
     1645
     1646    seek $fd 0 end
     1647    if {[tell $fd] == 0} {
     1648        # Statefile is empty, skipping further tests
     1649        return 0
     1650    }
    16371651
    16381652    seek $fd 0
    16391653    while {[gets $fd line] >= 0} {
    16401654        if {[regexp "variant: (.*)" $line match name]} {
    1641             set oldvariations([string range $name 1 end]) [string range $name 0 0]
     1655            set upoldvariations([string range $name 1 end]) [string range $name 0 0]
    16421656        }
    16431657    }
    16441658
    16451659    set mismatch 0
    1646     if {[array size oldvariations] > 0} {
    1647         if {[array size oldvariations] != [array size upvariations]} {
    1648             set mismatch 1
    1649         } else {
    1650             foreach key [array names upvariations *] {
    1651                 if {![info exists oldvariations($key)] || $upvariations($key) != $oldvariations($key)} {
     1660    if {[array size upoldvariations] != [array size upvariations]} {
     1661        set mismatch 1
     1662    } else {
     1663        foreach key [array names upvariations *] {
     1664            if {![info exists upoldvariations($key)] || $upvariations($key) != $upoldvariations($key)} {
    16521665                set mismatch 1
    16531666                break
    1654                 }
    16551667            }
    16561668        }
     
    18391851        set state_fd [open_statefile]
    18401852
    1841         if {[check_statefile_variants upvariations $state_fd]} {
    1842             ui_error "Requested variants do not match original selection.\nPlease perform 'port clean $portname' or specify the force option."
     1853        array set oldvariations {}
     1854        if {[check_statefile_variants upvariations oldvariations $state_fd]} {
     1855            ui_error "Requested variants \"[canonicalize_variants [array get upvariations]]\" do not match original selection \"[canonicalize_variants [array get oldvariations]]\".\nPlease use the same variants again, perform 'port clean $portname' or specify the force option (-f)."
    18431856            set result 1
    18441857        } elseif {!([info exists ports_dryrun] && $ports_dryrun == "yes")} {
     
    18551868}
    18561869
    1857 proc default_universal_variant_allowed {args} {
    1858 
     1870# add the default universal variant if appropriate, and set up flags that are
     1871# conditional on whether universal is set
     1872proc universal_setup {args} {
     1873    global configure.archflags
     1874    global configure.march configure.mtune configure.universal_cflags
     1875    global configure.universal_cxxflags configure.universal_cppflags
     1876    global configure.universal_ldflags configure.universal_args
     1877   
    18591878    if {[variant_exists universal]} {
    18601879        ui_debug "universal variant already exists, so not adding the default one"
    1861         return no
    18621880    } elseif {[exists universal_variant] && ![option universal_variant]} {
    18631881        ui_debug "'universal_variant no' specified, so not adding the default universal variant"
    1864         return no
    18651882    } elseif {[exists use_xmkmf] && [option use_xmkmf]} {
    18661883        ui_debug "using xmkmf, so not adding the default universal variant"
    1867         return no
    18681884    } elseif {[exists use_configure] && ![option use_configure] && ![exists xcode.project]} {
    18691885        # Allow +universal if port uses xcode portgroup.
    18701886        ui_debug "not using configure, so not adding the default universal variant"
    1871         return no
    18721887    } elseif {![exists os.universal_supported] || ![option os.universal_supported]} {
    18731888        ui_debug "OS doesn't support universal builds, so not adding the default universal variant"
    1874         return no
    18751889    } else {
    18761890        ui_debug "adding the default universal variant"
    1877         return yes
    1878     }
    1879 }
    1880 
    1881 proc add_default_universal_variant {args} {
    1882     # Declare default universal variant (all the magic happens in portconfigure now)
    1883     variant universal {}
     1891        variant universal {}
     1892    }
     1893
     1894    # add in extra CFLAGS etc
     1895    if {[variant_exists universal] && [variant_isset universal]} {
     1896        foreach flag {cflags objcflags fflags f90flags fcflags} {
     1897            eval configure.${flag}-append ${configure.universal_cflags}
     1898        }
     1899        eval configure.cxxflags-append ${configure.universal_cxxflags}
     1900        eval configure.cppflags-append ${configure.universal_cppflags}
     1901        eval configure.ldflags-append ${configure.universal_ldflags}
     1902        eval configure.pre_args-append ${configure.universal_args}
     1903    } else {
     1904        foreach flag {cflags cxxflags objcflags fflags f90flags fcflags} {
     1905            eval configure.${flag}-append ${configure.archflags}
     1906            if {${configure.march} != {}} {
     1907                configure.${flag}-append "-march=${configure.march}"
     1908            }
     1909            if {${configure.mtune} != {}} {
     1910                configure.${flag}-append "-mtune=${configure.mtune}"
     1911            }
     1912        }
     1913        eval configure.ldflags-append ${configure.archflags}
     1914    }
    18841915}
    18851916
Note: See TracChangeset for help on using the changeset viewer.