Ignore:
Timestamp:
Feb 25, 2012, 6:34:45 AM (6 years ago)
Author:
jeremyhu@…
Message:

merge r89537-89539 from trunk:

Fix use_xmkmf to honor xmkmf.env for its make Makefiles phase, required for the workaround for #31504
Set IMAKECPP for use_xmkmf

Location:
branches/release_2_0/base
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/release_2_0/base

  • branches/release_2_0/base/src/port1.0/portconfigure.tcl

    r90170 r90175  
    596596
    597597    if {[tbool use_xmkmf]} {
     598        parse_environment xmkmf
     599        append_list_to_environment_value xmkmf "IMAKECPP" ${configure.cpp}
    598600        if {[catch {command_exec xmkmf} result]} {
    599601            return -code error "[format [msgcat::mc "%s failure: %s"] xmkmf $result]"
    600         } else {
    601             # XXX should probably use make command abstraction but we know that
    602             # X11 will already set things up so that "make Makefiles" always works.
    603             system "cd ${worksrcpath} && make Makefiles"
     602        }
     603
     604        parse_environment xmkmf
     605        append_list_to_environment_value xmkmf "IMAKECPP" ${configure.cpp}
     606        if {[catch {command_exec "cd ${worksrcpath} && make Makefiles" -varprefix xmkmf} result]} {
     607            return -code error "[format [msgcat::mc "%s failure: %s"] "make Makefiles" $result]"
    604608        }
    605609    } elseif {[tbool use_configure]} {
  • branches/release_2_0/base/src/port1.0/portutil.tcl

    r90174 r90175  
    325325
    326326# Given a command name, execute it with the options.
    327 # command_exec command [-notty] [command_prefix [command_suffix]]
     327# command_exec command [-notty] [-varprefix variable_prefix] [command_prefix [command_suffix]]
    328328# command           name of the command
     329# variable_prefix   name of the variable prefix to use (defaults to command)
    329330# command_prefix    additional command prefix (typically pipe command)
    330331# command_suffix    additional command suffix (typically redirection)
    331332proc command_exec {command args} {
    332     global ${command}.env ${command}.env_array ${command}.nice env macosx_version
     333    set varprefix "${command}"
    333334    set notty ""
    334335    set command_prefix ""
     
    341342        }
    342343
     344        if {[lindex $args 0] == "-varprefix"} {
     345            set varprefix [lindex $args 1]
     346            set args [lrange $args 2 end]
     347        }
     348
    343349        if {[llength $args] > 0} {
    344350            set command_prefix [lindex $args 0]
     
    349355    }
    350356
     357    global ${varprefix}.env ${varprefix}.env_array ${varprefix}.nice env macosx_version
     358
    351359    # Set the environment.
    352360    # If the array doesn't exist, we create it with the value
    353     # coming from ${command}.env
     361    # coming from ${varprefix}.env
    354362    # Otherwise, it means the caller actually played with the environment
    355363    # array already (e.g. configure flags).
    356     if {![array exists ${command}.env_array]} {
    357         parse_environment ${command}
     364    if {![array exists ${varprefix}.env_array]} {
     365        parse_environment ${varprefix}
    358366    }
    359367    if {[option macosx_deployment_target] ne ""} {
    360         set ${command}.env_array(MACOSX_DEPLOYMENT_TARGET) [option macosx_deployment_target]
    361     }
    362     set ${command}.env_array(CC_PRINT_OPTIONS) "YES"
    363     set ${command}.env_array(CC_PRINT_OPTIONS_FILE) [file join [option workpath] ".CC_PRINT_OPTIONS"]
     368        set ${varprefix}.env_array(MACOSX_DEPLOYMENT_TARGET) [option macosx_deployment_target]
     369    }
     370    set ${varprefix}.env_array(CC_PRINT_OPTIONS) "YES"
     371    set ${varprefix}.env_array(CC_PRINT_OPTIONS_FILE) [file join [option workpath] ".CC_PRINT_OPTIONS"]
    364372    if {[option compiler.cpath] ne ""} {
    365         set ${command}.env_array(CPATH) [join [option compiler.cpath] :]
     373        set ${varprefix}.env_array(CPATH) [join [option compiler.cpath] :]
    366374    }
    367375    if {[option compiler.library_path] ne ""} {
    368         set ${command}.env_array(LIBRARY_PATH) [join [option compiler.library_path] :]
    369     }
     376        set ${varprefix}.env_array(LIBRARY_PATH) [join [option compiler.library_path] :]
     377    }
     378
     379    # When building, g-ir-scanner should not save its cache to $HOME
     380    # See: https://trac.macports.org/ticket/26783
     381    set ${varprefix}.env_array(GI_SCANNER_DISABLE_CACHE) "1"
    370382
    371383    # Debug that.
    372     ui_debug "Environment: [environment_array_to_string ${command}.env_array]"
     384    ui_debug "Environment: [environment_array_to_string ${varprefix}.env_array]"
    373385
    374386    # Prepare nice value change
    375387    set nice ""
    376     if {[info exists ${command}.nice] && [set ${command}.nice] != ""} {
    377         set nice "-nice [set ${command}.nice]"
     388    if {[info exists ${varprefix}.nice] && [set ${varprefix}.nice] != ""} {
     389        set nice "-nice [set ${varprefix}.nice]"
    378390    }
    379391
     
    386398    array set saved_env [array get env]
    387399    # Set the overriden variables from the portfile.
    388     array set env [array get ${command}.env_array]
     400    array set env [array get ${varprefix}.env_array]
    389401    # Call the command.
    390402    set fullcmdstring "$command_prefix $cmdstring $command_suffix"
     
    393405
    394406    # Unset the command array until next time.
    395     array unset ${command}.env_array
     407    array unset ${varprefix}.env_array
    396408
    397409    # Restore the environment.
Note: See TracChangeset for help on using the changeset viewer.