Fix CreateFileMapping() error handling

CreateFileMapping() returns NULL in case of an error.
The patch corrects the wrong testing on INVALID_HANDLE_VALUE, and sets
NULL for invalid handles.

Change-Id: Iaab4945ed88ee92bbf9a0871e95a5820dd1a56ed
(cherry-picked from qtbase/1a8f67938c4146614fec3788c7868dc1a314cc84)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Introduce compileTest function.

This avoids the enormous duplication of identical command line
arguments passed down to compile.test.
This necessitates the addition of a -config parameter to compile.test,
as QMAKE_CONFIG needs to be extended in some cases.

Backport of qtbase commit ca4823505bee3674a8d65cd1bdd45ea93546114b.

Change-Id: I22aa0336443d330e49e674e5484f08c43c913d31
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Fix generation of XCode projects for XCode 4.6

When a framework is referenced in the XCode project then it is known as
a framework by the lastKnownFileType and not the reference type. This
ensures it works in both XCode 3 and XCode 4.

Task-number: QTBUG-29371
Change-Id: I434246a46d6c5bfd50ba7de1a7c710c0caf0bc0a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
(cherry picked from qtbase/4a6a066df2f104763c35eaaaf8dc7b1366d483b2)