1 From 5ec1d1009d9943f20e82ffc087deabb31d447e75 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Milan=20P=C3=A4ssler?= <me@pbb.lc>
3 Date: Fri, 3 Apr 2020 21:07:58 +0200
4 Subject: [PATCH 01/11] qtbase-mkspecs-mac
7 mkspecs/common/mac.conf | 2 +-
8 mkspecs/features/mac/default_post.prf | 206 --------------------------
9 mkspecs/features/mac/default_pre.prf | 58 --------
10 mkspecs/features/mac/sdk.mk | 25 ----
11 mkspecs/features/mac/sdk.prf | 61 --------
12 5 files changed, 1 insertion(+), 351 deletions(-)
13 delete mode 100644 mkspecs/features/mac/sdk.mk
14 delete mode 100644 mkspecs/features/mac/sdk.prf
16 diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
17 index 61bea952b2..9909dae726 100644
18 --- a/mkspecs/common/mac.conf
19 +++ b/mkspecs/common/mac.conf
20 @@ -23,7 +23,7 @@ QMAKE_INCDIR_OPENGL = \
22 QMAKE_FIX_RPATH = install_name_tool -id
24 -QMAKE_LFLAGS_RPATH = -Wl,-rpath,
26 QMAKE_LFLAGS_GCSECTIONS = -Wl,-dead_strip
28 QMAKE_LFLAGS_REL_RPATH =
29 diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
30 index abc6d82ade..59b94fe5b6 100644
31 --- a/mkspecs/features/mac/default_post.prf
32 +++ b/mkspecs/features/mac/default_post.prf
36 -# Recompute SDK version in case the user set it explicitly
37 -sdk_version = $$QMAKE_MAC_SDK_VERSION
38 -QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion)
40 contains(TEMPLATE, .*app) {
41 !macx-xcode:if(isEmpty(BUILDS)|build_pass) {
42 # Detect changes to the platform SDK
43 @@ -16,36 +12,6 @@ contains(TEMPLATE, .*app) {
44 QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/sdk.mk)
47 - # Detect incompatible SDK versions
49 - isEmpty(QT_MAC_SDK_VERSION_MIN): \
50 - QT_MAC_SDK_VERSION_MIN = $$QT_MAC_SDK_VERSION
52 - !versionAtLeast(QMAKE_MAC_SDK_VERSION, $$QT_MAC_SDK_VERSION_MIN): \
53 - warning("Qt requires at least version $$QT_MAC_SDK_VERSION_MIN of the platform SDK," \
54 - "you're building against version $${QMAKE_MAC_SDK_VERSION}. Please upgrade.")
56 - !isEmpty(QT_MAC_SDK_VERSION_MAX) {
57 - # For Qt developers only
58 - !isEmpty($$list($$(QT_MAC_SDK_NO_VERSION_CHECK))): \
59 - CONFIG += sdk_no_version_check
61 - QMAKE_MAC_SDK_MAJOR_VERSION = $$replace(QMAKE_MAC_SDK_VERSION, "(\\d+)(\\.\\d+)(\\.\\d+)?", \\1)
63 - !sdk_no_version_check:!versionAtMost(QMAKE_MAC_SDK_MAJOR_VERSION, $$QT_MAC_SDK_VERSION_MAX) {
64 - warning("Qt has only been tested with version $$QT_MAC_SDK_VERSION_MAX"\
65 - "of the platform SDK, you're using $${QMAKE_MAC_SDK_MAJOR_VERSION}.")
66 - warning("This is an unsupported configuration. You may experience build issues," \
68 - warning("the $$QMAKE_MAC_SDK_VERSION SDK you are opting in to new features" \
69 - "that Qt has not been prepared for.")
71 - warning("Please downgrade the SDK you use to build your app to version" \
72 - "$$QT_MAC_SDK_VERSION_MAX, or configure")
73 - warning("with CONFIG+=sdk_no_version_check when running qmake" \
74 - "to silence this warning.")
79 !no_objective_c:CONFIG += objective_c
80 @@ -73,230 +39,6 @@ qt {
84 -# Add the same default rpaths as Xcode does for new projects.
85 -# This is especially important for iOS/tvOS/watchOS where no other option is possible.
87 - uikit: QMAKE_RPATHDIR += @executable_path/Frameworks
88 - else: QMAKE_RPATHDIR += @executable_path/../Frameworks
89 - equals(TEMPLATE, lib):!plugin:lib_bundle: QMAKE_RPATHDIR += @loader_path/Frameworks
92 -# Don't pass -headerpad_max_install_names when using Bitcode.
93 -# In that case the linker emits a warning stating that the flag is ignored when
94 -# used with bitcode, for reasons that cannot be determined (rdar://problem/20748962).
95 -# Using this flag is also unnecessary in practice on UIKit platforms since they
96 -# are sandboxed, and only UIKit platforms support bitcode to begin with.
97 -!bitcode: QMAKE_LFLAGS += $$QMAKE_LFLAGS_HEADERPAD
99 -app_extension_api_only {
100 - QMAKE_CFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
101 - QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
102 - QMAKE_CXXFLAGS_PRECOMPILE += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
103 - QMAKE_LFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
107 - !isEmpty(QMAKE_APPLE_DEVICE_ARCHS) {
108 - # If the user has requested a specific set of architectures,
109 - # build all of those by default, but limited to only those.
110 - CONFIG -= only_active_arch
112 - # Otherwise allow building all of the architectures available
113 - # in Qt, but only build the active arch (unless the user has
114 - # manually overridden this via CONFIG -= only_active_arch).
115 - QMAKE_APPLE_DEVICE_ARCHS = $$QT_ARCHS
120 - qmake_pkginfo_typeinfo.name = QMAKE_PKGINFO_TYPEINFO
121 - !isEmpty(QMAKE_PKGINFO_TYPEINFO): \
122 - qmake_pkginfo_typeinfo.value = $$QMAKE_PKGINFO_TYPEINFO
124 - qmake_pkginfo_typeinfo.value = "????"
125 - QMAKE_MAC_XCODE_SETTINGS += qmake_pkginfo_typeinfo
127 - bundle_version = $$VERSION
128 - isEmpty(bundle_version): bundle_version = 1.0.0
130 - l = $$split(bundle_version, '.') 0 0 # make sure there are at least three
131 - VER_MAJ = $$member(l, 0, 0)
132 - VER_MIN = $$member(l, 1, 1)
133 - VER_PAT = $$member(l, 2, 2)
136 - qmake_full_version.name = QMAKE_FULL_VERSION
137 - qmake_full_version.value = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
138 - QMAKE_MAC_XCODE_SETTINGS += qmake_full_version
140 - qmake_short_version.name = QMAKE_SHORT_VERSION
141 - qmake_short_version.value = $${VER_MAJ}.$${VER_MIN}
142 - QMAKE_MAC_XCODE_SETTINGS += qmake_short_version
144 - !isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) {
145 - debug_information_format.name = DEBUG_INFORMATION_FORMAT
146 - debug_information_format.value = $$QMAKE_XCODE_DEBUG_INFORMATION_FORMAT
147 - debug_information_format.build = debug
148 - QMAKE_MAC_XCODE_SETTINGS += debug_information_format
151 - QMAKE_XCODE_ARCHS =
153 - arch_device.name = "ARCHS[sdk=$${device.sdk}*]"
154 - arch_device.value = $$QMAKE_APPLE_DEVICE_ARCHS
155 - QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_DEVICE_ARCHS
156 - QMAKE_MAC_XCODE_SETTINGS += arch_device
159 - arch_simulator.name = "ARCHS[sdk=$${simulator.sdk}*]"
160 - arch_simulator.value = $$QMAKE_APPLE_SIMULATOR_ARCHS
161 - QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_SIMULATOR_ARCHS
162 - QMAKE_MAC_XCODE_SETTINGS += arch_simulator
165 - only_active_arch.name = ONLY_ACTIVE_ARCH
166 - only_active_arch.value = YES
167 - only_active_arch.build = debug
168 - QMAKE_MAC_XCODE_SETTINGS += only_active_arch
170 - device|!simulator: VALID_DEVICE_ARCHS = $$QMAKE_APPLE_DEVICE_ARCHS
171 - simulator: VALID_SIMULATOR_ARCHS = $$QMAKE_APPLE_SIMULATOR_ARCHS
172 - VALID_ARCHS = $$VALID_DEVICE_ARCHS $$VALID_SIMULATOR_ARCHS
174 - single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
177 - only_active_arch: DEFAULT_ARCHS = $$system("uname -m")
178 - else: DEFAULT_ARCHS = $$VALID_ARCHS
181 - ARCHS = $(filter $(EXPORT_VALID_ARCHS), \
182 - $(if $(ARCHS), $(ARCHS), \
183 - $(if $(EXPORT_DEFAULT_ARCHS), $(EXPORT_DEFAULT_ARCHS), \
184 - $(EXPORT_VALID_ARCHS))))
185 - ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ARCHS), $(EXPORT_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch))
187 - QMAKE_EXTRA_VARIABLES += VALID_ARCHS DEFAULT_ARCHS ARCHS ARCH_ARGS
189 - arch_flags = $(EXPORT_ARCH_ARGS)
191 - QMAKE_CFLAGS += $$arch_flags
192 - QMAKE_CXXFLAGS += $$arch_flags
193 - QMAKE_LFLAGS += $$arch_flags
195 - QMAKE_PCH_ARCHS = $$VALID_ARCHS
197 - macos: deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET
198 - ios: deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET
199 - tvos: deployment_target = $$QMAKE_TVOS_DEPLOYMENT_TARGET
200 - watchos: deployment_target = $$QMAKE_WATCHOS_DEPLOYMENT_TARGET
202 - # If we're doing a simulator and device build, device and simulator
203 - # architectures use different paths and flags for the sysroot and
204 - # deployment target switch, so we must multiplex them across multiple
205 - # architectures using -Xarch. Otherwise we fall back to the simple path.
206 - # This is not strictly necessary, but results in cleaner command lines
207 - # and makes it easier for people to override EXPORT_VALID_ARCHS to limit
208 - # individual rules to a different set of architecture(s) from the overall
209 - # build (such as machtest in QtCore).
211 - QMAKE_XARCH_CFLAGS =
212 - QMAKE_XARCH_LFLAGS =
213 - QMAKE_EXTRA_VARIABLES += QMAKE_XARCH_CFLAGS QMAKE_XARCH_LFLAGS
215 - for (arch, VALID_ARCHS) {
216 - contains(VALID_SIMULATOR_ARCHS, $$arch) {
217 - sdk = $$simulator.sdk
218 - version_identifier = $$simulator.deployment_identifier
221 - version_identifier = $$device.deployment_identifier
224 - version_min_flags = \
226 - -m$${version_identifier}-version-min=$$deployment_target
227 - QMAKE_XARCH_CFLAGS_$${arch} = $$version_min_flags \
229 - -isysroot$$xcodeSDKInfo(Path, $$sdk)
230 - QMAKE_XARCH_LFLAGS_$${arch} = $$version_min_flags \
232 - -isysroot$$xcodeSDKInfo(Path, $$sdk)
234 - QMAKE_XARCH_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch})
235 - QMAKE_XARCH_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS_$${arch})
237 - QMAKE_EXTRA_VARIABLES += \
238 - QMAKE_XARCH_CFLAGS_$${arch} \
239 - QMAKE_XARCH_LFLAGS_$${arch}
242 - QMAKE_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
243 - QMAKE_CXXFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
244 - QMAKE_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS)
247 - version_identifier = $$simulator.deployment_identifier
248 - sysroot_path = $$xcodeSDKInfo(Path, $$simulator.sdk)
250 - version_identifier = $$device.deployment_identifier
251 - sysroot_path = $$xcodeSDKInfo(Path, $$device.sdk)
253 - version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
254 - QMAKE_CFLAGS += -isysroot $$sysroot_path $$version_min_flag
255 - QMAKE_CXXFLAGS += -isysroot $$sysroot_path $$version_min_flag
256 - QMAKE_LFLAGS += -isysroot $$sysroot_path $$version_min_flag
259 - # Enable precompiled headers for multiple architectures
260 - QMAKE_CFLAGS_USE_PRECOMPILE =
261 - for (arch, VALID_ARCHS) {
263 - use_flag = "-pch-use "
265 - use_flag = -include
267 - # Only use Xarch with multi-arch, as the option confuses ccache
268 - count(VALID_ARCHS, 1, greaterThan): \
269 - QMAKE_CFLAGS_USE_PRECOMPILE += \
272 - QMAKE_CFLAGS_USE_PRECOMPILE += \
273 - $${use_flag}${QMAKE_PCH_OUTPUT_$${arch}}
276 - QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE -include ${QMAKE_PCH_INPUT}
277 - QMAKE_CFLAGS_USE_PRECOMPILE =
279 - QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
280 - QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
281 - QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
284 - QMAKE_PCH_OUTPUT_EXT = _${QMAKE_PCH_ARCH}$${QMAKE_PCH_OUTPUT_EXT}
287 -!equals(sdk_version, $$QMAKE_MAC_SDK_VERSION) {
288 - # Explicit SDK version has been set, respect that
289 - QMAKE_LFLAGS += -Wl,-sdk_version -Wl,$$sdk_version
292 -cache(QMAKE_XCODE_DEVELOPER_PATH, stash)
293 -!isEmpty(QMAKE_XCODE_VERSION): \
294 - cache(QMAKE_XCODE_VERSION, stash)
296 -QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix()
298 -xcode_product_bundle_identifier_setting.name = PRODUCT_BUNDLE_IDENTIFIER
299 -xcode_product_bundle_identifier_setting.value = $$QMAKE_TARGET_BUNDLE_PREFIX
300 -isEmpty(xcode_product_bundle_identifier_setting.value): \
301 - xcode_product_bundle_identifier_setting.value = "com.yourcompany"
302 -xcode_product_bundle_target = $$QMAKE_BUNDLE
303 -isEmpty(xcode_product_bundle_target): \
304 - xcode_product_bundle_target = ${PRODUCT_NAME:rfc1034identifier}
305 -xcode_product_bundle_identifier_setting.value = "$${xcode_product_bundle_identifier_setting.value}.$${xcode_product_bundle_target}"
306 -QMAKE_MAC_XCODE_SETTINGS += xcode_product_bundle_identifier_setting
309 generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode \"$(EXPORT__PRO_FILE_)\" $$QMAKE_ARGS
310 generate_xcode_project.target = xcodeproj
311 diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
312 index 2c91ba6679..a6ab233825 100644
313 --- a/mkspecs/features/mac/default_pre.prf
314 +++ b/mkspecs/features/mac/default_pre.prf
315 @@ -21,61 +21,3 @@ macos {
320 -isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
321 - # Get path of Xcode's Developer directory
322 - QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path 2>/dev/null")
323 - isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \
324 - error("Xcode path is not set. Please use xcode-select to choose Xcode installation path.")
326 - # Make sure Xcode path is valid
327 - !exists($$QMAKE_XCODE_DEVELOPER_PATH): \
328 - error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.")
331 -isEmpty(QMAKE_XCODEBUILD_PATH): \
332 - QMAKE_XCODEBUILD_PATH = $$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null")
334 -!isEmpty(QMAKE_XCODEBUILD_PATH) {
335 - # Make sure Xcode is set up properly
336 - !system("/usr/bin/xcrun xcodebuild -license check 2>/dev/null"): \
337 - error("Xcode not set up properly. You need to confirm the license agreement by running 'sudo xcrun xcodebuild -license accept'.")
339 - isEmpty(QMAKE_XCODE_VERSION) {
340 - # Extract Xcode version using xcodebuild
341 - xcode_version = $$system("/usr/bin/xcrun xcodebuild -version")
342 - QMAKE_XCODE_VERSION = $$member(xcode_version, 1)
343 - isEmpty(QMAKE_XCODE_VERSION): error("Could not resolve Xcode version.")
344 - unset(xcode_version)
348 -isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) {
349 - QMAKE_XCODE_PREFERENCES_FILE = $$(HOME)/Library/Preferences/com.apple.dt.Xcode.plist
350 - exists($$QMAKE_XCODE_PREFERENCES_FILE): \
351 - QMAKE_TARGET_BUNDLE_PREFIX = $$system("/usr/libexec/PlistBuddy -c 'print IDETemplateOptions:bundleIdentifierPrefix' $$QMAKE_XCODE_PREFERENCES_FILE 2>/dev/null")
353 - !isEmpty(_QMAKE_CACHE_):!isEmpty(QMAKE_TARGET_BUNDLE_PREFIX): \
354 - cache(QMAKE_TARGET_BUNDLE_PREFIX)
357 -QMAKE_ASSET_CATALOGS_APP_ICON = AppIcon
359 -# Make the default debug info format for static debug builds
360 -# DWARF instead of DWARF with dSYM. This cuts down build times
361 -# for application debug builds significantly, as Xcode doesn't
362 -# have to pull out all the DWARF info from the Qt static libs
363 -# and put it into a dSYM file. We don't need that dSYM file in
364 -# the first place, since the information is available in the
365 -# object files inside the archives (static libraries).
366 -macx-xcode:qtConfig(static): \
367 - QMAKE_XCODE_DEBUG_INFORMATION_FORMAT = dwarf
369 -# This variable is used by the xcode_dynamic_library_suffix
370 -# feature, which allows Xcode to choose the Qt libraries to link to
371 -# at build time, depending on the current Xcode SDK and configuration.
372 -QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX
374 -xcode_copy_phase_strip_setting.name = COPY_PHASE_STRIP
375 -xcode_copy_phase_strip_setting.value = NO
376 -QMAKE_MAC_XCODE_SETTINGS += xcode_copy_phase_strip_setting
377 diff --git a/mkspecs/features/mac/sdk.mk b/mkspecs/features/mac/sdk.mk
378 --- a/mkspecs/features/mac/sdk.mk
379 +++ b/mkspecs/features/mac/sdk.mk
382 -ifeq ($(QT_MAC_SDK_NO_VERSION_CHECK),)
383 - CHECK_SDK_COMMAND = /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version 2>/dev/null
384 - CURRENT_MAC_SDK_VERSION := $(shell DEVELOPER_DIR=$(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) $(CHECK_SDK_COMMAND))
385 - ifneq ($(CURRENT_MAC_SDK_VERSION),$(EXPORT_QMAKE_MAC_SDK_VERSION))
386 - # We don't want to complain about out of date SDK unless the target needs to be remade.
387 - # This covers use-cases such as running 'make check' after moving the build to a
388 - # computer without Xcode or with a different Xcode version.
389 - TARGET_UP_TO_DATE := $(shell QT_MAC_SDK_NO_VERSION_CHECK=1 $(MAKE) --question $(QMAKE_TARGET) && echo 1 || echo 0)
390 - ifeq ($(TARGET_UP_TO_DATE),0)
391 - ifneq ($(findstring missing DEVELOPER_DIR path,$(CURRENT_MAC_SDK_VERSION)),)
392 - $(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) is no longer valid.)
393 - else ifneq ($(findstring SDK "$(EXPORT_QMAKE_MAC_SDK)" cannot be located,$(CURRENT_MAC_SDK_VERSION)),)
394 - $(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) no longer contains the $(EXPORT_QMAKE_MAC_SDK_VERSION) platform SDK.)
395 - else ifneq ($(CURRENT_MAC_SDK_VERSION),)
396 - $(info The $(EXPORT_QMAKE_MAC_SDK) platform SDK has been changed from version $(EXPORT_QMAKE_MAC_SDK_VERSION) to version $(CURRENT_MAC_SDK_VERSION).)
398 - $(info Unknown error resolving current platform SDK version.)
400 - $(info This requires a fresh build of your project. Please wipe the build directory)
401 - ifneq ($(EXPORT__QMAKE_STASH_),)
402 - $(info including the qmake cache in $(EXPORT__QMAKE_STASH_))
408 diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
409 deleted file mode 100644
410 index 3a9c2778bb..0000000000
411 --- a/mkspecs/features/mac/sdk.prf
415 -isEmpty(QMAKE_MAC_SDK): \
416 - error("QMAKE_MAC_SDK must be set when using CONFIG += sdk.")
418 -contains(QMAKE_MAC_SDK, .*/.*): \
419 - error("QMAKE_MAC_SDK can only contain short-form SDK names (eg. macosx, iphoneos)")
421 -defineReplace(xcodeSDKInfo) {
423 - equals(info, "Path"): \
424 - infoarg = --show-sdk-path
425 - equals(info, "PlatformPath"): \
426 - infoarg = --show-sdk-platform-path
427 - equals(info, "SDKVersion"): \
428 - infoarg = --show-sdk-version
431 - sdk = $$QMAKE_MAC_SDK
433 - isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}) {
434 - QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcrun --sdk $$sdk $$infoarg 2>/dev/null")
435 - # --show-sdk-platform-path won't work for Command Line Tools; this is fine
436 - # only used by the XCTest backend to testlib
437 - isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}):if(!isEmpty(QMAKE_XCODEBUILD_PATH)|!equals(infoarg, "--show-sdk-platform-path")): \
438 - error("Could not resolve SDK $$info for \'$$sdk\' using $$infoarg")
439 - cache(QMAKE_MAC_SDK.$${sdk}.$${info}, set stash, QMAKE_MAC_SDK.$${sdk}.$${info})
442 - return($$eval(QMAKE_MAC_SDK.$${sdk}.$${info}))
445 -QMAKE_MAC_SDK_PATH = $$xcodeSDKInfo(Path)
446 -QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath)
447 -QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion)
449 -isEmpty(QMAKE_EXPORT_INCDIR_OPENGL) {
450 - QMAKE_EXPORT_INCDIR_OPENGL = $$QMAKE_INCDIR_OPENGL
452 - for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val
453 - QMAKE_INCDIR_OPENGL = $$sysrootified
456 -QMAKESPEC_NAME = $$basename(QMAKESPEC)
458 -# Resolve SDK version of various tools
459 -for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_LINK QMAKE_LINK_SHLIB QMAKE_ACTOOL QMAKE_LINK_C QMAKE_LINK_C_SHLIB)) {
460 - tool_variable = QMAKE_MAC_SDK.$${QMAKESPEC_NAME}.$${QMAKE_MAC_SDK}.$${tool}
461 - !isEmpty($$tool_variable) {
462 - $$tool = $$eval($$tool_variable)
466 - value = $$eval($$tool)
467 - isEmpty(value): next()
469 - sysrooted = $$system("/usr/bin/xcrun -sdk $$QMAKE_MAC_SDK -find $$first(value) 2>/dev/null")
470 - isEmpty(sysrooted): next()
472 - $$tool = $$sysrooted $$member(value, 1, -1)
473 - cache($$tool_variable, set stash, $$tool)
475 diff --git a/mkspecs/features/mac/toolchain.prf b/mkspecs/features/mac/toolchain.prf
476 deleted file mode 100644
477 index df191eb13c..0000000000
478 --- a/mkspecs/features/mac/toolchain.prf
481 -# Ensure that we process sdk.prf first, as it will update QMAKE_CXX,
482 -# which the default path determination uses.