qmake: Update Xcode generator to produce project files similar to Xcode

There was quite a bit of cruft left over from older Xcode version. We
now produce Xcode 3.2 compatible files, similar to what Xcode would do
when asked to upgrade one of our generated files. In particular:

 - Removed refType
 - Set more lastKnownFileTypes
 - Renamed defaultConfigurationIsName to defaultConfigurationName
 - Add runOnlyForDeploymentPostprocessing = 0 to build phases
 - Don't put buildSettings directly into PBXNativeTarget
 - Don't write productSettingsXML
 - Don't write startupPath
 - Don't write name when path is the exact same
 - Write empty buildSetting lists as empty string
 - Don't write empty PBXBuildFile settings
 - Don't write generated/neede filenames for PBXShellScriptBuildPhase
 - Use PBXFileReference instad of PBXFrameworkReference
 - Prune deprecated buildSetting variables
 - Remove deprecated PBXBuildStyle sections
 - Resolve correct CC/CPLUSPLUS/LDPLUSPLUS
 - Write IPHONEOS_DEPLOYMENT_TARGET

Change-Id: Ia2365c2623fe898878bd10636c3b85145c1cff04
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
qmake: Don't generate Xcode project bundle identifiers with spaces

Replace them with dashes, like Xcode itself does.

Change-Id: I302425363a2eef13394025cd4a9e414048ce55ce
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
qmake: Prevent duplicate libaries from being added to the link phase

Change-Id: I5ec7acb8f060e9d9bbd8cdb95d40ace03cffe9c7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
qmake: Don't treat .xcodeproj directories as OUT_PWD when passed with -o

The Xcode generator creates a makefile for running 'make qmake', and the
makefile passes -o to ensure it writes to the same Xcode project. This
fails when qmake then treats -o foo.xcodeproj/project.xcproj as not only
setting the output filename, but also the output directory to foo.xcodeproj,
which results in the Xcode project trying to reference files relative
to this directory, such as '../main.cpp'.

Unfortunatly the output filename parsing happens too early for us to know
whether or not the generator is Xcode, so we just have to assume that
a certain combination of output filename and directories means we are
generating an Xcode project.

Change-Id: I0901d4db995f287c35cbbbd015683d5abda6d0f5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
qmake: Use PBXResourcesBuildPhase for QMAKE_BUNDLE_DATA without a path

The PBXResourcesBuildPhase will optimize resources, such as turning XIB
files into NIB files, running pngcrush on images, turning string files
into binary plists, etc, so we prefer that if possible.

Unfortunatly this phase does not support custom paths, so whenever we
encounter bundle data with a custom path we fall back to the regular
PBXCopyFilesBuildPhase.

Change-Id: I539db03dd7982fd37293123b6428cdb695f64d2b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
qmake: Prevent Obj-C sources from building both as extra compiler and in Xcode

We already assume that if a source is buildable and should end up in OBJECTS we
can let Xcode build it, so we skip this input for the extra compiler.

Change-Id: I17b2408925b8e6513f0fa0d2459ec539bf7381d3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
qmake: Fix file paths in Xcode projects when shadow-building

The Xcode generator seems to have been written with the assumption that
writeMakeParts() would be called with the output directory as the current
directory, but that's not the case when shadow-building. Perhaps this
was changed in qmake at some point, and the Xcode generator was not
updated to reflect that.

Instead of replacing every occurance of fileFixify and other logic to
deal with paths, we just chdir into the output_dir for the duration
of the function (except when writing the 'make qmake' makefile, as
the regular makefile generator works as expected with the current
directory set to the input directory).

Change-Id: I6ba492036d73f29f4adbd7cd554db9504050629e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
qmake: Resolve QMAKE_INFO_PLIST against current working dir

We're not in the output directory yet, so resolving using vanilla
fileFixify will end up failing when we check if the file exists, since
QFileInfo resolves relative paths against the current directory.

Change-Id: I414c6a2e83b49e3fb30e6153a49f7a90a8e528a0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
iOS: Remove hard-coding of Xcode /Developer path in common/ios mkspecs

We can use xcode-select -print-path to get the /Developer directory.

This also removes the need for the "legacy" makespecs, which only
differ from their non-legacy counterparts in the location of the
Xcode developer directory.

Change-Id: Ia9245033a4b82cc3933226bf998f07177b60871f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
iOS: Get rid of GCC/LLVM makespecs for iOS

We only want to support Clang.

Change-Id: Id0558df905106158f4c25ca10462bf4ca41e1e45
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
iOS: copy brute-force port of Qt4 uikit plugin into Qt5.

The plugin has been renamed from uikit to ios.
Other than that, the plugin will now build, but do nothing. Most of
the Qt4 code is preserved, with a rough translation
into the Qt5 qpa API. A lot of code has simply been commented
out so far, and most lacking at the moment is the event dispatcher
which will need to be rewritten, and the opengl paint device
implementation. But it should suffice as a starting ground.

Also: The plugin will currently not automatically build when
building Qt, this needs to be enabled from configure first.

Change-Id: I0d229a453a8477618e06554655bffc5505203b44
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: fix build issue, dont link against cocoa

Make sure the libraries dont depend on Cocoa. This will be
picked up by libtool, and make all apps and examples link
against cocoa too (which will ofcourse fail)

Change-Id: I5654bb08c4ed376fc7ee74da422d903270a8af38
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
iOS: Don't reference QMacStyle from QStyleOption as we don't build it

QMacStyle is not buildt as a part of iOS. So make sure we dont
reference it from QStyleOption

Change-Id: I98e779c576d0607402e45a19b457144a6bdfc73b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: Move Q_OS_IOS out of makesespec to qsystemdetection.h

We treat iOS as a variant of Mac OS, so for iOS both Q_OS_MAC and
Q_OS_IOS will be defined. This matches what Apple assumes in the
header file TargetConditionals.h

Change-Id: I55cc851401b748297478e4c32e84e0f6e1fdfc28
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
iOS: Simplify SDK resolving in mkspec

There's no need to duplicate the logic for device vs simulator. The only
difference is the iPhoneOS/iPhoneSimulator name.

Change-Id: I87c57fa785279a3ee258b76fdac8317e52e7daa2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
iOS: Bump arch and iOS SDK, now that we require GLES 2.x

We now require SDK version 4.3 or above, and armv7.

Change-Id: I4766e277a3a4a32712bf2ec27fede694e8316c95
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
iOS: Force static builds so that apps can be submitted to the App Store

Change-Id: I66c917e98e40c07ae9532c106ee1c47caa61abd5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
iOS: Simplify arch detection/configuration in mkspec

NEON detection is handled by configure's arch test, and THUMB2 is the
default for ARMv7.

Change-Id: I8ec3ce0ec6af9ad8d9509890aa1f8c87e18364d5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
iOS: Disable NEON until LLVM handles the GAS syntax of the draw-helpers

The LLVM version in Xcode 4.5 and below does not handle the GNU
assembler syntax in the pixman assembly file.

A possible alternative workaround is to include a preprocessed assembly
file using https://github.com/hollylee/gas-preprocessor.

Change-Id: Id95add669c60d3a7da823e5975afdd1f88f71977
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
iOS: Move device/simulator conditionals out of common mkspecs

Instead we deal with any differenced by setting variables in the top
level makespecs, that are used by the common makespec configs.

Change-Id: Iae1fb5fef8c95778511ed400008731989b446f3c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>