1174 | | } |
1175 | | |
1176 | | if { ${os.platform} eq "darwin" } { |
1177 | | # qt calls xcrun to find the SDK to use, so make sure this call will succeed |
1178 | | |
1179 | | ui_debug "qt5 Portfile: the initial SDK value is: macosx${configure.sdk_version}" |
1180 | | # first try for a system-specific SDK |
1181 | | if {[string first . ${configure.sdk_version}] == -1 && ${configure.sdkroot} ne ""} { |
1182 | | # xcrun doesn't like major version only (e.g. macosx11), try to find a full version |
1183 | | set sdks [lsort -command vercmp -decreasing [glob -nocomplain [file rootname ${configure.sdkroot}]*.sdk]] |
1184 | | configure.sdk_version [string map {MacOSX ""} [file rootname [file tail [lindex $sdks 0]]]] |
1185 | | ui_debug "using possibly more specific SDK version: ${configure.sdk_version}" |
1186 | | } |
1187 | | ui_debug "qt5 Portfile: testing for system-specific SDK:" |
1188 | | if {[catch {exec -ignorestderr env DEVELOPER_DIR=${configure.developer_dir} /usr/bin/xcrun --sdk macosx${configure.sdk_version} --find ld > /dev/null 2>@1}]} { |
1189 | | |
1190 | | ui_debug "qt5 Portfile: system-specific SDK was not found, looking for generic SDK." |
1191 | | # if no specific sdk found, check for a generic macosx sdk |
1192 | | if {[catch {exec -ignorestderr env DEVELOPER_DIR=${configure.developer_dir} /usr/bin/xcrun --sdk macosx --find ld > /dev/null 2>@1}]} { |
1193 | | pre-fetch { |
1194 | | ui_error "${subport}: no usable SDK can be found" |
1195 | | return -code error "no usable SDK can be found" |
1196 | | } |
1197 | | } else { |
1198 | | ui_debug "${subport}: using generic macosx SDK as macosx${configure.sdk_version} was not found" |
1199 | | configure.sdk_version |
1200 | | } |
1201 | | } else { |
1202 | | ui_debug "qt5 Portfile: system-specific SDK was found." |
1203 | | } |
1204 | | ui_debug "qt5 Portfile: the final SDK value is: macosx${configure.sdk_version}" |
1205 | | } |