From d28073d9eb0f35bae534470970e693a94463c549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sat, 2 Mar 2013 15:46:37 +0100 Subject: Distinguish between 'mac' and 'macx' qmake scopes The former applies both on Mac OS X and iOS, but 'macx' is specific to Mac OS X. ios.conf and macx.conf now share most of their settings in the common mac.conf. We set the default QMAKE_MAC_SDK before loading mac.conf, so that any overrides in the device config will apply afterwards. This means configure's mkspec parsing will be able to read the QMAKE_MAC_SDK. Change-Id: I0c7e26a6a0103e19b23ef152aa9e4ab461cee632 Reviewed-by: Oswald Buddenhagen Reviewed-by: Richard Moe Gustavsen --- mkspecs/common/ios.conf | 23 ++-------------- mkspecs/common/mac.conf | 29 ++++++++++++++++++++ mkspecs/common/macx.conf | 32 ++-------------------- mkspecs/features/create_cmake.prf | 2 +- mkspecs/features/qmltestcase.prf | 2 +- mkspecs/features/resolve_target.prf | 2 +- mkspecs/features/testcase.prf | 2 +- mkspecs/unsupported/macx-ios-clang/qmake.conf | 24 ++++++++-------- src/corelib/io/io.pri | 8 +++--- src/corelib/thread/thread.pri | 2 +- src/plugins/bearer/bearer.pro | 4 +-- .../platforminputcontexts.pro | 2 +- src/sql/drivers/oci/qsql_oci.pri | 2 +- src/tools/bootstrap/bootstrap.pro | 2 +- src/widgets/styles/styles.pri | 2 +- src/widgets/util/util.pri | 2 +- .../corelib/kernel/qmetamethod/qmetamethod.pro | 2 +- .../qmetaobjectbuilder/qmetaobjectbuilder.pro | 2 +- .../corelib/plugin/qpluginloader/qpluginloader.pro | 2 +- 19 files changed, 67 insertions(+), 79 deletions(-) create mode 100644 mkspecs/common/mac.conf diff --git a/mkspecs/common/ios.conf b/mkspecs/common/ios.conf index 5ff2f9b416..b7d2b84ec9 100644 --- a/mkspecs/common/ios.conf +++ b/mkspecs/common/ios.conf @@ -2,24 +2,7 @@ # qmake common configuration for iOS # -MAKEFILE_GENERATOR = UNIX -CONFIG += app_bundle reduce_exports incremental global_init_link_order lib_version_first plugin_no_soname sdk -QMAKE_INCREMENTAL_STYLE = sublib +QMAKE_PLATFORM += ios +QMAKE_MAC_SDK = iphoneos -# FIXME: Transform ios.conf to follow the same inheritance pattern as eg mac.conf and unix.conf -QMAKE_PLATFORM = ios $$QMAKE_PLATFORM - -# Not deploying to Mac OSX -QMAKE_MACOSX_DEPLOYMENT_TARGET = - -# But to iOS -QMAKE_IOS_DEPLOYMENT_TARGET = 4.3 - -# Add iOS common folder to include path -INCLUDEPATH += $$PWD/ios - -# iOS defines -DEFINES += DARWIN_NO_CARBON QT_NO_CORESERVICES QT_NO_PRINTER QT_NO_PRINTDIALOG - -# Universal target (iPhone and iPad) -QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2 +include(mac.conf) diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf new file mode 100644 index 0000000000..5d7cb1a91b --- /dev/null +++ b/mkspecs/common/mac.conf @@ -0,0 +1,29 @@ +# +# qmake configuration for common Mac OS (OSX and iOS) +# + +!load(device_config): error(Could not successfully load device configuration) + +QMAKE_PLATFORM += mac + +QMAKE_RESOURCE = /Developer/Tools/Rez +QMAKE_EXTENSION_SHLIB = dylib +QMAKE_LIBDIR = + +# sdk.prf will prefix the proper SDK sysroot +QMAKE_INCDIR_OPENGL = \ + /System/Library/Frameworks/OpenGL.framework/Headers \ + /System/Library/Frameworks/AGL.framework/Headers/ + +QMAKE_FIX_RPATH = install_name_tool -id + +QMAKE_LFLAGS_RPATH = + +QMAKE_LIBS_DYNLOAD = +QMAKE_LIBS_OPENGL = -framework OpenGL -framework AGL +QMAKE_LIBS_THREAD = + +QMAKE_AR = ar cq +QMAKE_RANLIB = ranlib -s + +include(unix.conf) diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf index 5f5ed80e4d..eb39d1cf8d 100644 --- a/mkspecs/common/macx.conf +++ b/mkspecs/common/macx.conf @@ -1,34 +1,8 @@ # # qmake configuration for common Mac OS X # -!load(device_config) { - error(Could not successfully load device configuration) -} -QMAKE_PLATFORM += macx mac +QMAKE_PLATFORM += macx +QMAKE_MAC_SDK = macosx -isEmpty(QMAKE_MAC_SDK): QMAKE_MAC_SDK = macosx - -QMAKE_RESOURCE = /Developer/Tools/Rez - -QMAKE_EXTENSION_SHLIB = dylib - -QMAKE_LIBDIR = - -# sdk.prf will prefix the proper SDK sysroot -QMAKE_INCDIR_OPENGL = \ - /System/Library/Frameworks/OpenGL.framework/Headers \ - /System/Library/Frameworks/AGL.framework/Headers/ - -QMAKE_FIX_RPATH = install_name_tool -id - -QMAKE_LFLAGS_RPATH = - -QMAKE_LIBS_DYNLOAD = -QMAKE_LIBS_OPENGL = -framework OpenGL -framework AGL -QMAKE_LIBS_THREAD = - -QMAKE_AR = ar cq -QMAKE_RANLIB = ranlib -s - -include(unix.conf) +include(mac.conf) diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index 43dca4cd70..6b15236246 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -83,7 +83,7 @@ CMAKE_MKSPEC = $$[QMAKE_XSPEC] CMAKE_QT_STEM = Qt$$eval(QT.$${MODULE}.MAJOR_VERSION)$${CMAKE_MODULE_NAME}$${QT_LIBINFIX} -macx { +mac { !isEmpty(CMAKE_STATIC_TYPE) { CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.a CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a diff --git a/mkspecs/features/qmltestcase.prf b/mkspecs/features/qmltestcase.prf index 71e70e06a4..335ba90009 100644 --- a/mkspecs/features/qmltestcase.prf +++ b/mkspecs/features/qmltestcase.prf @@ -2,7 +2,7 @@ CONFIG += testcase QT += qml qmltest -macx: CONFIG -= app_bundle +mac: CONFIG -= app_bundle # If the .pro file specified an IMPORTPATH, then add that to # the command-line when the test is run. diff --git a/mkspecs/features/resolve_target.prf b/mkspecs/features/resolve_target.prf index 8cd12b2a00..22d7722ce3 100644 --- a/mkspecs/features/resolve_target.prf +++ b/mkspecs/features/resolve_target.prf @@ -28,7 +28,7 @@ win32 { } else { contains(TEMPLATE, .*lib):LIBPREFIX = lib - macx { + mac { equals(TEMPLATE, lib) { lib_bundle { QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${TARGET}.framework/$${TARGET} diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index faf4eeb124..15febe2dd5 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -32,7 +32,7 @@ contains(MUNGED_TARGET,.*/.*):check.commands = cd $(DESTDIR) && # Allow for a custom test runner script check.commands += $(TESTRUNNER) -macx { +mac { app_bundle: check.commands += ./$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET) else: check.commands += ./$(QMAKE_TARGET) } diff --git a/mkspecs/unsupported/macx-ios-clang/qmake.conf b/mkspecs/unsupported/macx-ios-clang/qmake.conf index 47aeff8139..7805c079bb 100644 --- a/mkspecs/unsupported/macx-ios-clang/qmake.conf +++ b/mkspecs/unsupported/macx-ios-clang/qmake.conf @@ -2,24 +2,26 @@ # qmake configuration for macx-ios-clang # -!load(device_config): error("Could not successfully load device configuration.") +MAKEFILE_GENERATOR = UNIX +CONFIG += app_bundle reduce_exports incremental global_init_link_order lib_version_first plugin_no_soname sdk +QMAKE_INCREMENTAL_STYLE = sublib -isEmpty(QMAKE_MAC_SDK): QMAKE_MAC_SDK = iphoneos +QMAKE_MACOSX_DEPLOYMENT_TARGET = +QMAKE_IOS_DEPLOYMENT_TARGET = 4.3 -# iOS is considered a variant of MacOS by Apple. We follow this to -# keep things simple, e.g. by defining Q_OS_MAC _and_ Q_OS_IOS. -include(../../common/macx.conf) - -include(../../common/gcc-base-mac.conf) -include(../../common/xcode.conf) -include(../../common/clang.conf) -include(../../common/clang-mac.conf) +INCLUDEPATH += $$PWD/ios +DEFINES += DARWIN_NO_CARBON QT_NO_CORESERVICES QT_NO_PRINTER QT_NO_PRINTDIALOG +# Universal target (iPhone and iPad) +QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2 -# Version check +include(../../common/xcode.conf) lessThan(QMAKE_XCODE_VERSION, "4.3"): error("This mkspec requires Xcode 4.3 or later") include(../../common/ios.conf) +include(../../common/gcc-base-mac.conf) +include(../../common/clang.conf) +include(../../common/clang-mac.conf) include(../../common/ios/clang.conf) include(../../common/ios/qmake.conf) diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index a52386def1..3f100593bb 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -117,12 +117,12 @@ win32 { io/qprocess_unix.cpp \ io/qfilesystemiterator_unix.cpp \ - !nacl:macx-*: { + !nacl:mac: { SOURCES += io/qfilesystemengine_mac.cpp SOURCES += io/qsettings_mac.cpp } - macx-*: { - !ios { + mac { + macx { SOURCES += io/qstandardpaths_mac.cpp } else { SOURCES += io/qstandardpaths_unix.cpp @@ -139,7 +139,7 @@ win32 { } !nacl { - freebsd-*|macx-*|darwin-*|openbsd-*:{ + freebsd-*|mac|darwin-*|openbsd-*:{ SOURCES += io/qfilesystemwatcher_kqueue.cpp HEADERS += io/qfilesystemwatcher_kqueue_p.h } diff --git a/src/corelib/thread/thread.pri b/src/corelib/thread/thread.pri index 7247f2984e..13f0502b62 100644 --- a/src/corelib/thread/thread.pri +++ b/src/corelib/thread/thread.pri @@ -56,7 +56,7 @@ integrity:SOURCES += thread/qmutex_unix.cpp \ thread/qwaitcondition_unix.cpp unix: { - macx-* { + mac { SOURCES += thread/qmutex_mac.cpp } else:linux-*:!linux-lsb-* { SOURCES += thread/qmutex_linux.cpp diff --git a/src/plugins/bearer/bearer.pro b/src/plugins/bearer/bearer.pro index 0375500306..42f039b19b 100644 --- a/src/plugins/bearer/bearer.pro +++ b/src/plugins/bearer/bearer.pro @@ -9,7 +9,7 @@ linux*:qtHaveModule(dbus) { win32:SUBDIRS += generic blackberry:SUBDIRS += blackberry win32:!wince*:SUBDIRS += nativewifi -macx:contains(QT_CONFIG, corewlan):SUBDIRS += corewlan -macx:SUBDIRS += generic +mac:contains(QT_CONFIG, corewlan):SUBDIRS += corewlan +mac:SUBDIRS += generic isEmpty(SUBDIRS):SUBDIRS = generic diff --git a/src/plugins/platforminputcontexts/platforminputcontexts.pro b/src/plugins/platforminputcontexts/platforminputcontexts.pro index c8449e7e44..7b3c6e9c36 100644 --- a/src/plugins/platforminputcontexts/platforminputcontexts.pro +++ b/src/plugins/platforminputcontexts/platforminputcontexts.pro @@ -1,4 +1,4 @@ TEMPLATE = subdirs qtHaveModule(dbus) { -!macx:!win32:SUBDIRS += ibus maliit +!mac:!win32:SUBDIRS += ibus maliit } diff --git a/src/sql/drivers/oci/qsql_oci.pri b/src/sql/drivers/oci/qsql_oci.pri index 9108dbaa3c..66ccdb1abb 100644 --- a/src/sql/drivers/oci/qsql_oci.pri +++ b/src/sql/drivers/oci/qsql_oci.pri @@ -6,4 +6,4 @@ unix { } else { LIBS *= -loci } -macx:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environ +mac:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environ diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index 0d4b62fd16..cc7d40c43e 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -113,7 +113,7 @@ win32:SOURCES += ../../corelib/io/qfilesystemengine_win.cpp \ ../../corelib/io/qsettings_win.cpp \ ../../corelib/plugin/qsystemlibrary.cpp \ -macx: { +mac { SOURCES += ../../corelib/io/qfilesystemengine_mac.cpp \ ../../corelib/io/qsettings_mac.cpp \ ../../corelib/kernel/qcore_mac.cpp diff --git a/src/widgets/styles/styles.pri b/src/widgets/styles/styles.pri index 9f23fb30cc..a207cd2761 100644 --- a/src/widgets/styles/styles.pri +++ b/src/widgets/styles/styles.pri @@ -40,7 +40,7 @@ contains( styles, all ) { styles = fusion mac windows windowsxp windowsvista } -!macx-*|ios:styles -= mac +!mac:styles -= mac contains(QT_CONFIG, gtkstyle) { QMAKE_CXXFLAGS += $$QT_CFLAGS_QGTKSTYLE diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri index 5847b12166..598a3082c0 100644 --- a/src/widgets/util/util.pri +++ b/src/widgets/util/util.pri @@ -36,6 +36,6 @@ win32:!wince* { SOURCES += util/qsystemtrayicon_qpa.cpp } -macx { +mac { OBJECTIVE_SOURCES += util/qscroller_mac.mm } diff --git a/tests/auto/corelib/kernel/qmetamethod/qmetamethod.pro b/tests/auto/corelib/kernel/qmetamethod/qmetamethod.pro index e253702d56..8340bc06e3 100644 --- a/tests/auto/corelib/kernel/qmetamethod/qmetamethod.pro +++ b/tests/auto/corelib/kernel/qmetamethod/qmetamethod.pro @@ -3,5 +3,5 @@ CONFIG += parallel_test TARGET = tst_qmetamethod QT = core testlib SOURCES = tst_qmetamethod.cpp -macx:CONFIG -= app_bundle +mac:CONFIG -= app_bundle DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qmetaobjectbuilder/qmetaobjectbuilder.pro b/tests/auto/corelib/kernel/qmetaobjectbuilder/qmetaobjectbuilder.pro index 008b596b72..9e2d3519e6 100644 --- a/tests/auto/corelib/kernel/qmetaobjectbuilder/qmetaobjectbuilder.pro +++ b/tests/auto/corelib/kernel/qmetaobjectbuilder/qmetaobjectbuilder.pro @@ -2,5 +2,5 @@ CONFIG += testcase parallel_test TARGET = tst_qmetaobjectbuilder QT = core-private gui-private testlib SOURCES = tst_qmetaobjectbuilder.cpp -macx:CONFIG -= app_bundle +mac:CONFIG -= app_bundle DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro b/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro index 5aa7b4805b..0cba19887e 100644 --- a/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro +++ b/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro @@ -4,7 +4,7 @@ CONFIG += ordered SUBDIRS = lib \ theplugin \ tst -!win32: !macx-*: SUBDIRS += almostplugin +!win32: !mac: SUBDIRS += almostplugin TARGET = tst_qpluginloader # no special install rule for subdir -- cgit v1.2.3