Ticket #12170: universal-noconfigure.diff
File universal-noconfigure.diff, 6.3 KB (added by jmroot (Joshua Root), 17 years ago) |
---|
-
src/port1.0/portutil.tcl
1651 1651 return $result 1652 1652 } 1653 1653 1654 proc default_universal_variant_allowed {args} { 1655 1656 if {[variant_exists universal]} { 1657 ui_debug "universal variant already exists, so not adding the default one" 1658 return no 1659 } elseif {[exists universal_variant] && ![option universal_variant]} { 1660 ui_debug "'universal_variant no' specified, so not adding the default universal variant" 1661 return no 1662 } elseif {[exists use_xmkmf] && [option use_xmkmf]} { 1663 ui_debug "using xmkmf, so not adding the default universal variant" 1664 return no 1665 } elseif {[exists use_configure] && ![option use_configure]} { 1666 ui_debug "not using configure, so not adding the default universal variant" 1667 return no 1668 } elseif {![exists os.universal_supported] || ![option os.universal_supported]} { 1669 ui_debug "OS doesn't support universal builds, so not adding the default universal variant" 1670 return no 1671 } else { 1672 ui_debug "adding the default universal variant" 1673 return yes 1674 } 1675 } 1676 1677 proc add_default_universal_variant {args} { 1678 # Declare default universal variant, on >10.3 1679 variant universal description {Build for multiple architectures} { 1680 if {![file exists ${configure.universal_sysroot}]} { 1681 return -code error "Universal SDK is not installed (are we running on 10.3? did you forget to install it?) and building with +universal will very likely fail" 1682 } 1683 eval configure.args-append ${configure.universal_args} 1684 eval configure.cflags-append ${configure.universal_cflags} 1685 eval configure.cppflags-append ${configure.universal_cppflags} 1686 eval configure.cxxflags-append ${configure.universal_cxxflags} 1687 eval configure.ldflags-append ${configure.universal_ldflags} 1688 } 1689 } 1690 1654 1691 # Target class definition. 1655 1692 1656 1693 # constructor for target object -
src/port1.0/portmain.tcl
44 44 options prefix name version revision epoch categories maintainers 45 45 options long_description description homepage 46 46 options worksrcdir filesdir distname portdbpath libpath distpath sources_conf os.platform os.version os.major os.arch os.endian platforms default_variants install.user install.group macosx_deployment_target 47 options universal_variant os.universal_supported 47 48 48 49 # Export options via PortInfo 49 50 options_export name version revision epoch categories maintainers platforms description long_description homepage … … 96 97 default os.arch {$os_arch} 97 98 # Remove trailing "Endian" 98 99 default os.endian {[string range $tcl_platform(byteOrder) 0 end-6]} 100 default os.universal_supported no 99 101 100 102 set macosx_version {} 101 103 if {$os_platform == "darwin"} { … … 105 107 106 108 default macosx_deployment_target {$macosx_version} 107 109 110 default universal_variant yes 111 108 112 # Select implicit variants 109 113 if {[info exists os.platform] && ![info exists variations(${os.platform})]} { variant_set ${os.platform}} 110 114 if {[info exists os.arch] && ![info exists variations(${os.arch})]} { variant_set ${os.arch} } 111 115 if {[info exists os.platform] && (${os.platform} == "darwin") && ![file isdirectory /System/Library/Frameworks/Carbon.framework] && ![info exists variations(puredarwin)]} { variant_set puredarwin } 112 116 if {[info exists os.platform] && (${os.platform} == "darwin") && [file isdirectory /System/Library/Frameworks/Carbon.framework] && ![info exists variations(macosx)]} { variant_set macosx } 113 117 if {[info exists variations(macosx)] && $variations(macosx) == "+"} { 114 # Declare default universal variant, on >10.3 115 variant universal description {Build for multiple architectures} { 116 if {[tbool use_xmkmf] || ![tbool use_configure]} { 117 return -code error "Default universal variant only works with ports based on configure" 118 } 119 eval configure.args-append ${configure.universal_args} 120 if {![file exists ${configure.universal_sysroot}]} { 121 return -code error "Universal SDK is not installed (are we running on 10.3? did you forget to install it?) and building with +universal will very likely fail" 122 } 123 eval configure.cflags-append ${configure.universal_cflags} 124 eval configure.cppflags-append ${configure.universal_cppflags} 125 eval configure.cxxflags-append ${configure.universal_cxxflags} 126 eval configure.ldflags-append ${configure.universal_ldflags} 127 } 118 # the universal variant itself is now created in 119 # add_default_universal_variant, which is called from mportopen 120 option os.universal_supported yes 121 128 122 if {[info exists variations(universal)] && $variations(universal) == "+"} { 129 123 # cannot go into the variant, due to the amount of ports overriding it 130 124 global configure.universal_target … … 132 126 eval macosx_deployment_target ${configure.universal_target} 133 127 } 134 128 } 135 136 # This is not a standard option, because we need to take an action when it's137 # set, in order to alter the PortInfo structure in time.138 proc universal_variant {state} {139 if {${state} == "no"} {140 variant_undef universal141 }142 }143 } else {144 proc universal_variant {state} {145 if {${state} != "no"} {146 ui_error "+universal is only available on +macosx"147 }148 }149 129 } 150 130 151 131 proc main {args} { -
src/macports1.0/macports.tcl
946 946 macports::worker_init $workername $portpath [macports::getportbuildpath $portpath] $options $variations 947 947 948 948 $workername eval source Portfile 949 950 # add the default universal variant, but only if 951 # it will work and another one isn't already present 952 if {[$workername eval default_universal_variant_allowed]} { 953 $workername eval add_default_universal_variant 954 } 949 955 950 956 # evaluate the variants 951 957 if {[$workername eval eval_variants variations] != 0} {