summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
Commit message (Collapse)AuthorAgeFilesLines
* Check for existence of QML import paths.Morten Johan Sørvig2013-11-141-1/+1
| | | | | | | | Filter out module QML import paths that point to nonexistent file system paths. Change-Id: I897ef50593eeb46c6c9eaec27313ec12e6113cb6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Android: Allow modules to specify permissions/featuresEskil Abrahamsen Blomfeldt2013-11-071-0/+13
| | | | | | | | | | | | Some modules, such as Qt Multimedia, needs special permissions to avoid getting exceptions at run-time. We should apply these by default to the AndroidManifest.xml so that an application using e.g. the camera will work out of the box. Task-number: QTBUG-33953 Change-Id: Ibc1f086d249197b63e7ed1075ae7d54bdd1212f2 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Resolve Qt module deps before determining if QML import scanner is neededTor Arne Vestbø2013-11-051-1/+4
| | | | | | | | | | The qtAddModules functions resolves deps internally, but doesn't affect the original QT and QT_PRIVATE variables. We need to pick up situations such as the user adding QT += quick, which implies QT += qml through the QtQuick module's dependecies. Change-Id: I14411dbea3e4f7402be404073a3fe8f18dbb165f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* qt.prf: add correct library version when using qmlimportscannerRichard Moe Gustavsen2013-11-041-1/+1
| | | | | | | | | | | | We need to add the correct suffix to the libs we add when running qmlimportscanner. Otherwise we will always add release versions of the libs instead of debug versions when generating debug builds. This in turn will confuse the xcode generator that will try to convert the libs in LIBS to native Xcode build variables. Change-Id: I4d9fab49ad9e644e9bfd06caf79fc084bde2a3b7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Remove android specific qmake variables.BogDan Vatra2013-10-311-12/+0
| | | | | Change-Id: Iba2b929ba70588ffcbcc9395501753521cfe5154 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* export QT_NO_<foo> equivalents to the build systemOswald Buddenhagen2013-10-311-0/+4
| | | | | | | | | | | | | | | | | | | | | this makes it possible to properly exclude entire subprojects based on the availability of features, rather than stuffing every single source file with #ifdefs. the defines are aggregated from the -qconfig <profile>, -no-feature-<foo> and some other configure flags. usage: load(qfeatures) !contains(QT_DISABLED_FEATURES, textarea): SUBDIRS += textstuff Task-number: QTBUG-28102 Change-Id: I83400632d64312fa4b907e1318dddfe27c432387 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Peter Hartmann <phartmann@blackberry.com> Reviewed-by: Tasuku Suzuki <stasuku@gmail.com>
* qmake: Pick up default bundle prefix from Xcode preferencesTor Arne Vestbø2013-10-311-0/+9
| | | | | | | | | But still fall back to 'com.yourcompany', just like Xcode does for the initial launch. Change-Id: I89afadefafc254a0014aca197741d42a0199943e Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* dbuscommon.pri: Fix source file dependencyMichael Krasnyk2013-10-301-0/+1
| | | | | | | | | Make already the creation of the generated cpp file depend on the creation of the generated h file, which transitively ensures that the cpp won't be compiled before the h is there. Change-Id: Idd3aec8d72dac341e835a3d1ef8f2986dbc1ab9f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* iOS: Build simulator libraries with suffixTor Arne Vestbø2013-10-301-3/+8
| | | | | | | | Makes it possible to join two separate builds, and opens up for using exclusive builds to do this. Change-Id: I87ccbdd55511fdfbef3fe8b581f40525ebf077ed Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Rewrite qmake's exclusive-build featureTor Arne Vestbø2013-10-257-98/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to compute the default exclusive build directory, eg 'debug', at configure time, and then set OBJECTS_DIR, MOC_DIR, etc to include this hard-coded default exclusive build directory. We then had to run a post- process step where we replaced the 'debug' part with the current actual exclusive build pass, eg 'release', resulting in long-standing bugs such as QTBUG-491 where we end up replacing parts of the build output dirs that were not part of the original exclusive build directory. We now set the OBJECTS_DIR, MOC_DIR, etc defaults in configure like before, but they do not include any exclusive-build information. The exclusive build directory is handled as a separate step in default_post where we adjust all entries in QMAKE_DIR_REPLACE to be exclusive directories. For backwards compatibility the new exclusive build behavior is only enabled for variables named by QMAKE_DIR_REPLACE_SANE, which for Qt itself applies globally to everything but DESTDIR, and for libs and tools also applies to DESTDIR. The reason for leaving out DESTDIR in the general case is because many tests and examples assume the old behavior for DESTDIR. A side effect of including all the other variables for Qt libs and tools is that the PCH output dir will be uniformly set, which has been an issue on Windows in the past. The addExclusiveBuilds function now takes two or more arguments, each argument being the key for an exclusive build, which can be customized eg. using $$key.{name,target,dir_affix}. Passing more than two arguments results in three/four/etc-way exclusive builds, eg debug/release/profile. Exclusive builds can also be combined, eg static/shared + debug/release by making two calls to the function. We also handle individual targets of combined exclusive builds, eg static/shared + debug/release, meaning it is possible to run 'make debug' to build both static-debug and shared-debug. Task-number: QTBUG-491 Change-Id: I02841dbbd065ac07d413dfb45cfcfe4c013674ac Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* xcode: Set QMAKE_XCODE_LIBRARY_SUFFIX from default_postTor Arne Vestbø2013-10-252-2/+3
| | | | | | | | | Otherwise we won't pick up CONFIG+= changes on the command line or from the project file. Change-Id: I6f7e9380f971e6271de5659534e9565024fe041d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* support cleanly querying private modules in qtHaveModule()Oswald Buddenhagen2013-10-251-1/+1
| | | | | | | | module names use dashes, but the internal module representation uses underscores, so we must translate. Change-Id: Ib6983d3731e7dae2a4d6232f8a5202390fd425e9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* iOS (OSX): rework how to bundle QML import foldersRichard Moe Gustavsen2013-10-251-24/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, we would copy "$QTDIR/qml" directly into the bundle as "qml". This would cause problems if the user also tried to deploy qml files to a "qml" folder, or if any other file in the bundle ended up with the name "qml" (which is the case for QtDeclarative/tools/qml, where the executable is called "qml"). This patch will instead copy the contents of each import folder into QMAKE_QML_BUNDLE_PATH, which will default to "qt_qml" on iOS and "Resources/qt_qml" on OSX. We also change the implementation to use a post script rather then QMAKE_BUNDLE_DATA for two reasons: 1. Xcode does not like "copy build phases" to copy folders, only files (You cannot even create such a phase from Xcode, although it is possible to force it the way we create project.pbx. But this was error prone) 2. We need to strip away unneeded files from the bundle, like archives (which are linked in statically, not dlopened run-time). Using rsync lets us copy and strip in one operation. Change-Id: I7c2117f6cfbe11efdc272dff71adb0b1e619a5ff Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* make better use of $$MODULE_PLUGIN_TYPESOswald Buddenhagen2013-10-242-10/+11
| | | | | | | | | | | | | | | | | | the module project files declare what plugins they need, as that is necessary for automatic android deployment. enable wider usage of this by making the information available from the module .pri files. caveat: the variable is called "types", but is in fact paths, so there can be particular plugins named. use this new facility to replace the egregious hard-coded list of plugin-to-module mappings from create_cmake. possible todo: automate populating DEPLOYMENT (for wince, and whatever else). Change-Id: Ibb9c07cfe2b0008905204cbeb81e9c8e2ae4dc69 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* rewrite handling of private modulesOswald Buddenhagen2013-10-246-123/+143
| | | | | | | | | | | | | | | | instead of being magic attributes of the main modules, the privates are now proper modules of their own. this cleans up some code paths, is more mappable to other build tools, and enables private modules to depend on other private modules. note that the library path is needed even in the "empty" private modules, as in the framework case that's where headers are found. consequently, the modules need to be explicitly marked with the new "no_link" flag. this required some reorganization of qtAddModule(). Change-Id: I8e4f44a609f8d639cc01bcb658256870a627eb63 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* CMake: Ensure that the EXECUTABLE_COMPILE_FLAGS list existsStephen Kelly2013-10-241-3/+3
| | | | | | | This is needed to ensure that list(REMOVE_DUPLICATES) can work. Change-Id: I3d992aa244fcdfbda7e3b48ce416e0ba5ffcde96 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Set PRIVATE includes variable to empty, not undefined.Stephen Kelly2013-10-241-5/+5
| | | | | | | This is necessary so that list(REMOVE_DUPLICATES) works properly. Change-Id: Id268637d76b1a8785c9ff0c6e09e9ad8a62bbfb6 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* purge auto_use_privates module optionOswald Buddenhagen2013-10-242-5/+4
| | | | | | | | it was introduced as a hack to simplify writing tests, but the change to make use of it was backed out of testlib and nobody seems to care. Change-Id: Icc86621b865276e86593afdb923247bbdca19d49 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* de-duplicate QT_MODULESOswald Buddenhagen2013-10-231-0/+1
| | | | | Change-Id: I8f1bf08070abb1ba05a4fdb14e7de9e7da5b3ec7 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* return()-related break() insanity is not necessary in qt5Oswald Buddenhagen2013-10-231-1/+1
| | | | | Change-Id: I593c7160e44d51d25dee76c56c2e5580345ab42a Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* don't suggest to use qtAddModule(), it's internal APIOswald Buddenhagen2013-10-231-1/+1
| | | | | | Change-Id: Idf01d0dd74a0708014b7fca33611535c604a75f9 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* don't load wayland-scanner for all projects on linuxOswald Buddenhagen2013-10-221-4/+0
| | | | | | | | | | | it's wasteful, given that exactly one add-on module (and most probably nobody else) needs it. i'd do the same with yacc and lex, but i suspect this would cause quite an uproar. Change-Id: Ic2a6ca19e829393835f824e31cd0893e78c3fd39 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* remove broken validation of QMLIMPORTSCANNEROswald Buddenhagen2013-10-181-14/+9
| | | | | | | | | | | | the variable may contain a complex command, so an exists() check is doomed to failure if the tool is built dynamically. also, the check is not really necessary: it failing indicates a bug in the qt build system, and we don't really need to complicate the code to deal with such corner cases. Change-Id: I2e6087dcc6dd4a4f70bdf739550276f364c880dd Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* make it possible to explicitly suppress the qml import scanOswald Buddenhagen2013-10-181-1/+2
| | | | | | | | | | if the user knows that no additional imports need to be linked, this can be used to optimize the build time. as it happens, it can also be used to fix the build of the qml tools themselves ... Change-Id: Id77aea1f20cabdc2e831540c61d8a4b8e85c040b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Android: Remove support for QMAKE_SUPPORTED_ORIENTATIONSEskil Abrahamsen Blomfeldt2013-10-181-3/+0
| | | | | | | | | | | | | This was created for the iOS port and intended to be cross-platform, but since then they got cold feet and never added the support. It makes no sense to only support this on Android. We need to remove it again and hold off until we can find a proper solution. Editing the AndroidManifest.xml is the non-cross-platform solution for this. Task-number: QTBUG-34166 Change-Id: I51d53b82a3412a9016de01612dd8df9ae12c6633 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Static builds: Link QML plugins.Morten Johan Sørvig2013-10-171-0/+86
| | | | | | | | | Run qmlimportscanner, add found plugins to the LIBS line, generate qml_plugin_import.cpp. Change-Id: I6c6b927cceb36fa2dc405ad698f26d20398b33c8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Xcode: Dynamically choose release/debug libs based on current configurationTor Arne Vestbø2013-10-162-7/+36
| | | | | | | | | | | | | | Non-framework builds would automatically link to whatever Qt library matched the config at the time of running qmake, eg hard-coded to libQtCore_debug, while Xcode itself allowed the user to switch between release and debug configurations. We now append an Xcode settings variable to the library path, which gets resolved at build time depending on the current config in Xcode. Change-Id: I12873e38a28d9595ef3fd0ae0ad849e6744833a9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* use pkg-config supplied CFLAGS when building with EGLOswald Buddenhagen2013-10-161-0/+2
| | | | | | | | | e.g., -DEGL_API_FB=1 is required for freescale's gpu-viv-bin-imx6 fb driver. Initial-patch-by: Fatih Aşıcı <fatih.asici@gmail.com> Change-Id: I8c8cd60591605e0bc33fcf9de3bfb6ea0d86a570 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use the cmakeTargetPaths function to process multiple paths.Stephen Kelly2013-10-161-4/+3
| | | | | | Change-Id: I2e874af4f5bf22a3028b7099c39436c400136386 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Output prefix for tools on x86Eskil Abrahamsen Blomfeldt2013-10-161-0/+1
| | | | | | | | | | When building for x86, the prefix for the tools is not equal to the prefix for the toolchain directory, so we need a separate option for this. Task-number: QTBUG-34110 Change-Id: Iefe8c37892eb6c31fc8762bfb7bc7c6c23cd8b1e Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Generate source includes in a separate file, if needed.Stephen Kelly2013-10-163-6/+17
| | | | | | | | | | | | The source includes shouldn't be used by installations, so don't install the extra file, but only use it if the package is used from the build-dir. Task-number: QTBUG-33970 Change-Id: I08f91b8a716e935cb04d1233d44cf5c092e240ce Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Don't test DLLDESTDIR when calculating dll location.Stephen Kelly2013-10-161-1/+1
| | | | | | | | | | | The DLLDESTDIR is not related to the install location and is not populated for prefix_build configurations. That resulted in the CMake files attempting to find the dlls in the lib/ directory instead of the bin/ directory. Change-Id: Iec6a7c9b6dd656278b70ab128f3df9e8c45bbe4a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* iOS: Move qmake features out of the generic features and into the makespecTor Arne Vestbø2013-10-143-169/+0
| | | | | | | As they are closely tied to the macx-ios-clang mkspec and can't be shared. Change-Id: Icb59304cc1e4be12732f50175f3f84be289300c2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* qml_plugin.prf: moc plugin with -Muri=$$TARGETPATHRichard Moe Gustavsen2013-10-111-0/+5
| | | | | | | | | | | | | | | | When we build qml plugins, we now depend on embedding the uri of the plugin into its meta-data using the new -M switch to moc for static builds. This patch will let this happen automatically whenever you call load(qml_plugin) from your pro file. With this patch, you only need to rebuild your plugin to support static applications. Task-number: QTBUG-28357 Change-Id: I99e2fc80688fa43cf734551553f4fa0cb5ed47ed Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* qmake: Centralize TARGET sanitization in default_post.prfTor Arne Vestbø2013-10-112-22/+35
| | | | | | | | | | | | | | | Shared between UNIX and Win generators, and allows prfs after default_post to rely on sane TARGET and DESTDIR values. This allows us to clean up the DESTDIR logic in testcase.prf, which was completely busted. Doing the two in separate commits is unfortunately not possible as the old testcase.prf logic was so broken it would barf if only looked at. Change-Id: Ibf21216195c760ee46ae679c162b207b77a9d813 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Android: Correctly escape backslashes in deployment settingsEskil Abrahamsen Blomfeldt2013-10-091-17/+21
| | | | | | | | | | | | When outputting the deployment settings on Windows, the paths might have backslashes. These need to be escaped, otherwise they will simply be removed by the JSON parser (or converted into whatever they happen to represent given the neighbouring character.) Task-number: QTBUG-33926 Change-Id: I11f1bc7d1f8082c73329bdc02fb8d653a0b5c0ee Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* iOS: Update Xcode check to include Xcode 5.0Tor Arne Vestbø2013-10-091-2/+3
| | | | | | Change-Id: Icfd3a47c8bac91e66625cbeb6dd9b56a0d5f5e79 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Android: Build against new build tools revisionsEskil Abrahamsen Blomfeldt2013-10-041-1/+7
| | | | | | | | | | | | Whenever the SDK updates the build tools it's put inside a new subdirectory with the version number, so with every new version we would have to update the java.prf feature. Instead, we iterate over the available revisions and pick the lexicographically highest one (which is sufficient as long as the major version is double digits.) Change-Id: I2392ef6261ef36ed741c80fa6f981486e7844e0a Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* move android-specific feature files to android/Oswald Buddenhagen2013-10-032-0/+0
| | | | | Change-Id: I1f2b345b1dfad544d53dbf7e17b12c75a2cc7668 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* iOS: Always use application bundle when building Qt applicationsTor Arne Vestbø2013-09-272-1/+13
| | | | | Change-Id: I8fd0f7b43bdcbff0bff2de890fe421eb51233192 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* iOS: Propagate xcodebuild exit-code from makefile wrapperTor Arne Vestbø2013-09-261-1/+1
| | | | | | | | | Without bash's pipefail option we would end up with the exit code of grep. Since we don't know which shell the user is running, we have to explicitly call bash. Change-Id: Ic3f6db0af9bb90a58001ccfbf9d6d21b6c9c9634 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Remove logic which changes install rules inside Qt dirEskil Abrahamsen Blomfeldt2013-09-261-8/+5
| | | | | | | | | | | | | | A common problem is that examples and other apps are unusable on Android when they are inside the Qt directory. There doesn't really seem to be any good reason for having a special case in place, since this will only affect applications which are not built with the host toolchain, and we aren't building any command line apps for the target devices. So the only thing this will affect are the examples and we want those to be installed into the correct path. Change-Id: Ibae365e06eb77944f11e596c16c3c5baf798848c Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Fix setting android minimum/target versionEskil Abrahamsen Blomfeldt2013-09-261-2/+2
| | | | | | | | We need to output integers here, since these are interpreted as integers when reading the json. Change-Id: I4206b3ac347b61a357bd2658f146979e06690141 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* iOS: Resolve location of crt.o at build time, not qmake timeTor Arne Vestbø2013-09-241-6/+2
| | | | | | | | By referring to crt.o by $(SDK) we allow Xcode to switch between the iPhoneSimulator and the iPhoneOS SDKs. Change-Id: I33d9f30b2f5a8f085dc4ddfc6e2ef228d02d639c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Android: Never error out on literal-suffix warningEskil Abrahamsen Blomfeldt2013-09-201-0/+4
| | | | | | | | | When warnings are treated as errors, no Android code will compile, since one of the platform headers in the NDK triggers the literal-suffix warning. So we need to mark this as no-error. Change-Id: Icabf1c2f2d32f76ee157d04e62a28f83abeed8f1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Let ANDROID_API_VERSION env var take precedenceEskil Abrahamsen Blomfeldt2013-09-201-5/+5
| | | | | | | | | | | | | If you specify ANDROID_API_VERSION to override the default API versions used for building the jar files, this should take precedence even when the .pro files specify a different default API version (like QtAccessibility does when it sets the default to android-16.) Otherwise it's impossible to override these defaults. Change-Id: Idef98aaf3b51490bd7ced8c53770ee2f5680b1db Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* WinRT: Basic global supportAndrew Knight2013-09-202-2/+2
| | | | | | | | Various global changes, primarily preprocessor flow, to support the WinRT platform. Change-Id: I3fa9cf91d5fb24019362e88fcf205e31b4f810b5 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Add qmake generation of Android deployment settingsEskil Abrahamsen Blomfeldt2013-09-191-0/+70
| | | | | | | | | | | | This outputs a json file with the necessary settings from qmake so that an external build tool can easily get the settings without having to parse the entire .pro source. Used by the androiddeployqt tool. Task-number: QTBUG-32856 Change-Id: I5d3ac0ab6a0350162d06b0a0bf0c9bcbd90d8b5a Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix extension of static pluginsStephen Kelly2013-09-171-6/+15
| | | | | Change-Id: I2656746cbc93a0912bb844fab7d466da39997867 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* iOS: Change main-wrapper logic to not require changing the user's mainTor Arne Vestbø2013-09-111-2/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using a define to rename the user's main() function during compilation, we leave the user code alone, and inject our wrapper one step earlier in the process, at the application entry point 'start'. This entry point is provided by crt1.o, which is normally linked into the application automatically. The start() function sets up some state and then calls main(), but we change the start() function to instead call our main wrapper. Instead of shipping our own crt1 binary/sources, we make a copy of the appropriate crt1.o at build time, and modify its symbol table in place. This is unproblematic as long as we keep the same length for the wrapper function name, as the symbol names are just entries in the global string table of the object file. The result is that for the regular Qt use-case the user won't see any changes to their main function, and we have more control over the startup sequence. For the hybrid use-case, we no longer rely on the fragile solution of having our back-up 'main' symbol in a single translation unit, which would break eg with --load_all, and we don't need to provide a dummy 'qt_user_main' symbol. OSX 10.8 and iOS 6.0 introduced a new load command called LC_MAIN, which places the state setup in the shared dyld, and then just calls main() directly. Once we bump the minimum deployment target to iOS 6.0 we can start using this loader instead of LC_UNIXTHREAD, but for now we force the classic loader using the -no_new_main flag. There's also a bug in the ld64 linker provided by the current Xcode toolchains that results in the -e linker flag (to set the entry point) having no effect, but hopefully this bug has been fixed (or Apple has switched to the LLVM lld linker) by the time we bump our deployment target. Change-Id: Ie0ba869c13ddc5277dc95c539aebaeb60e949dc2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>