don't crash if builddir is suffix of sourcedir (or vice-versa)

Change-Id: I97a6e2ebd51350cbf39c86efa5c26a376c49da95
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/b30273ec4a4ce65794fd402c6e3eb21de7bae1b9)
don't unnecessarily use QFileInfo::filePath()

just directly use the filename we constructed it from.

Change-Id: Ia428a2cb4b192fea6bde62dfbf35361bcfc4b21e
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
(cherry picked from qtcreator/571234786a3ff7e8e3a9220f12d22a9f74f7a53c)
implement simple VFS to support caching during project parsing

sync up with qt creator.
this counts as a bugfix, because it makes write_file() and cache() do
something remotely useful.

Change-Id: I833253f81c3159056fab2ff888f293b36cc2ef56
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/b215176da34661969015e4950815fe8297885163)
(cherry picked from qtcreator/66802ef8bf7989dc025e34bf91d93576189c483c)
minor optimization: don't concatenate strings needlessly

Change-Id: Iddec1a818ff9f3ad8b12491100883e433e4b8246
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
(cherry picked from qtcreator/12652c20711fd29dcba62b8d5ba71c077d8bd06c)
cache results of feature search

looking up the same files in the same locations over and over again
is a rather significant waste. in particular, looking up the CONFIG
flags that don't correspond with features has a measurable impact on qt
creator's project loading time.

Task-number: QTCREATORBUG-9154
Change-Id: Ibae3d8b7797e706a6416a7d45c77734ab1281b51
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
(cherry picked from qtcreator/fa27cd79e05aed4ebd16d5648480cc7d48fefd43)
update m_featureRoots less aggressively

it's not necessary to immediately re-calculate the roots after assigning
QMAKE_PLATFORM - it's sufficient to do it on-demand, so merely
invalidate them. this avoids that we re-calculate them multiple times
without ever using them in between while processing specs with
distributed platform assignments.

Change-Id: If508594764811b96a577fc81c5ded34ab0453148
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
(cherry picked from qtcreator/28df27d924bb407791a76de8159c9ffa6efde283)
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
make Makefiles not depend on .qmake.super

sync with qmake. this is a no-op in lupdate.

Change-Id: Id5158d7e272fdee4f4a041fb7c828295a0a86684
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/d135a311a34e693d761a3607663b0879be9bbf65)
find features/ under mkspecs/ of source & build root

we were finding features/ directly in the source & build root, and we
were finding features/ under mkspecs/ from $QMAKEPATH and other mkspecs
locations, but we omitted the "transitive hull". this was
counterintuitive.

Change-Id: I9823e6606467c98f264c81385250da92311f51ca
(cherry picked from qtbase/0bf65180b8710e4516496d0bc53a265ff0dd6a01)
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
make .qmake.{super,cache,conf} find "anchored" features

these files function as "anchors" for mkspecs/ and features/ directories
used by projects which load these files. ironically, these files didn't
see these feature files themselves.

Change-Id: I590855eb4a9d2c72b9abfcaa431d2f85a719c6e2
(cherry picked from qtbase/7456dfb4552c4e4f900af9fa8923828a23737280)
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
remove pointless string conversion

Change-Id: I1640083007ed0c428dfb8ab5ce8b68a7d7e2a749
(cherry picked from qtbase/d1b1b31c9237e0bd11c61fc54ad45551b7d862da)
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
introduce /src qmake property variants

this is for shadow builds during build time, where the respective files
are expected in the source dir.

Change-Id: I18dcfbdef99e1562a51dacac333642cae8105ebd
(cherry picked from qtbase/4531c83376c1a3546305a9fa5203e0a885e8860d)
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
find qmakespecs in source directory of shadow built qt

qt 5.2 does not copy the qmakespecs to the build directory any more.
a fallback to the /get property variant ensures that other build types
continue to work. consequently, this has no effect whatsoever on
installed qt versions.

(based on qtbase/214b55d5d4c8fdf975b3c36f69bac4b07d8d39d0)

Task-number: QTCREATORBUG-9572
Change-Id: I9edac11f8997fcb0594d0a67419d4733dd4ed86b
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
(cherry picked from qtcreator/958672e4607acf654b0fe5f35a385e95a3042f23)
Fix incorrect uname usage.

The POSIX function uname() can return any non-negative value for success.
- Example: Solaris 10 returns 1 on success.
See: http://pubs.opengroup.org/onlinepubs/009695399/functions/uname.html

Change-Id: Ic3d51f94a31d8b562b28a2d09df3d31b04c77dc8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
(cherry picked from qtbase/e97c37a37ac27f9ab901e974f0a882e81ffd571d)
always check for baseEnv init failure

sync up; doesn't do anything in lupdate.

creator's file watcher can trigger many parallel, entirely
non-hierarchical project reloads. if there is enough of them to exceed
the thread pool size, some will be serialized already by qtconcurrent,
not by our wait condition. these should notice a faulty spec, too.

Change-Id: I8ce40cb90fbc28045127881d57ec94e125df79af
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtcreator/759d0a69dd3973b4785b6f9412f46666a05cdf85)
lock baseEnv in cache()

sync up; doesn't do anything in lupdate.

as we modify the environment, it must be properly locked.
this implies that initFrom() also needs to be called with a lock.

Change-Id: I48bae9af9adaa0518e5a9db0ba08ff057ae14f9f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtcreator/d022a2d19cecb00397c2a215fc4e3bf64b1e627b)
avoid deadlock in cache() during spec/cache loading

sync up; doesn't do anything in lupdate.

if we end up calling cache() from within the initialization of the base
context, we cannot wait for for the completion of that initialization
before we proceed, obviously.

Change-Id: If30c6f3665fe423e767373a8821c406b2f5e0eca
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
(cherry picked from qtcreator/b64b4431c20afd9e39c1463e736f998ef450688f)
make split_value_list() even less sane again

contrary to what one may expect, it's actually *not* supposed to remove
the meta-characters it interprets.

luckily, this function is not used much any more ...

Change-Id: I2b60f9b173140da78db2b07b596cc2e5f6e6d555
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/783181cfc11e995ad678237ebc0025a2a023c88c)
fix setting the output directory for the qmake evaluator

not so wise to use the project file instead of its parent directory ...

amends f51f7b7b95

Change-Id: I35b18f81a86d097b82b8184669b0231810c66f73
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>