Commit Graph

199 Commits

Author SHA1 Message Date
Oswald Buddenhagen
ed96d199f1 fix somewhat common edge case in $$shadowed()
if source and build dir are direct children of the common root and we
are shadowing the top-level source dir, there is of course no trailing
slash to match.

Change-Id: I8a34a6a72d16cb21d77d056e037235af9b32a008
Reviewed-by: Davide Pesavento <davidepesa@gmail.com>
Reviewed-by: Andreas Hartmetz <ahartmetz@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-26 08:14:17 +02:00
Simon Hausmann
03e3fa5dd1 Fix return type of isActiveConfig("host_build")
The return type of isActiveConfig is a boolean, so return that when
host_build is queried.

Change-Id: I6d1420b49b09e51442c4b2d482e2f19b165081d8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-24 21:22:51 +02:00
Bjoern Breitmeyer
00f9ac93c2 Fixed Wince Makefile environment
Integrated the checksdk tool into qmake and made
the makefiles selfcontained, so configure make, is now
enough to build qt for wince

Change-Id: I29076702eca2ec23d4d06bb3d5c5cef9d4f95161
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-19 16:46:09 +02:00
Oswald Buddenhagen
575a516630 revamp automatic makefile generation for sub-projects
instead of making the "real" targets depend on the makefiles, add
conditional makefile generation to the targets themselves.
this causes makefile generation to follow the recursion order determined
by the project, which is important when dealing with prl and module pri
files.
a side effect of this is that qmake and make calls are interleaved now,
which is entirely different from a 'qmake -r' run.

on the downside, calling make with multiple targets which operate on the
same subprojects without prior makefile generation will make a mess, as
the qmake calls will be racing. this should be no problem, as qmake does
not generate recursive targets where this would be useful - at least by
default.

it is not sufficient to just order the creation of the makefiles
non-recursively (e.g., by using gnu-specific order-only-prerequisites),
as an interrupted and subsequently resumed build would happily skip the
nested makefiles.
workable alternative approaches would be walking the entire tree in a
pre-pass to ensure makefile presence (which is incredibly slow) or
creating additional stamp files only after recursing and having the
makefiles depend on them (which is ugly).

Task-number: QTBUG-23376
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Change-Id: I88d3e7610215677d362026de316513d3bea04b06
2012-06-19 16:46:08 +02:00
Oswald Buddenhagen
5290f6df89 introduce $$QMAKE_CHK_EXISTS_GLUE
instead of hard-coding platform differences, use a variable.

Change-Id: I20e98811ad5f07429148c6f88aedbabc3ba58fff
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:46:07 +02:00
Oswald Buddenhagen
3c144b54cf normalize $$QMAKE_QMAKE
everything in the projects should be normalized. only the makefile
generators need to adjust it to the native form.

Change-Id: I06a4e997f32134d13949ec4a9dd1b44367aab7cb
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-19 16:46:07 +02:00
Oswald Buddenhagen
46d35cc566 fix in-/out-dir mixup
no point in entering the outdir and leaving the indir.
this doesn't really matter except for the obsolete borland generator,
but whatever.

Change-Id: Ieb4e4c549ebd65f99e4d00819c52822968b060a4
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:46:06 +02:00
Oswald Buddenhagen
4fdd663208 remove unnecessary conditional
the code above already deals with the differences

Change-Id: Ifb799e46f5187e7bd3d0f0169e868ad267bcfe23
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:46:06 +02:00
Oswald Buddenhagen
d83619f65f remove duplicate assignments of MKDIR & CHK_DIR_EXISTS
Change-Id: I314659a1ba25227380176dc65a9c81e3c6df28c1
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:46:06 +02:00
Oswald Buddenhagen
a40469ce57 unobfuscate makefiles re $(CHK_DIR_EXISTS)
no need to define an obscure variable for it. just inline it.
the assignments are left in for compatibility with hand-written commands.

Change-Id: I9bc3914e2c4116f3b8fe00a421ca0f036bb7e214
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:46:06 +02:00
Oswald Buddenhagen
76f0ce06e2 make 'qmake_all' targets respect .depends and CONFIG+=ordered
Change-Id: I010a9886ee0d40e4319cb6bd873b038336a42111
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-19 16:46:05 +02:00
Oswald Buddenhagen
2bbd50c6e4 make 'qmake_all' target of SUBDIRS projects properly recursive
so far it would rebuild the makefiles one level down only, which is
somewhat arbitrary and not really helpful.

Change-Id: I5fe01f379ecc4b210610a674d7df7dfc18131eef
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-19 16:46:05 +02:00
Oswald Buddenhagen
76ed07168d make 'qmake' target of SUBDIRS projects non-recursive
that's consistent with other projects. 'qmake_all' can be used for
recursion.

Change-Id: Ie6d620f7a3e0e28d3f2f82f01ca94c2f46137c68
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-19 16:46:05 +02:00
Oswald Buddenhagen
0e6ddb71cc don't use $(MAKEFILE) to refer to SUBDIRS' makefiles
$(MAKEFILE) is our own file, and using it would wreak havoc if it was
named anything but Makefile.

Change-Id: I51cae2014a85399b409f18788f864ff2a82e493e
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:46:05 +02:00
Oswald Buddenhagen
91cf67c85d do not add "/." to _PRO_FILE_PWD_
if a "subdir" project added a project file from the same directory as
itself, "/." would be appended to the path, which is obviously not useful.

Change-Id: Ia733dedb57e568c5cf9a3d5eb29727176a5142c5
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:46:04 +02:00
Oswald Buddenhagen
426d1ef0c1 allow projects to suppress qmake recursion
webkit does some unholy tricks with the ordering of qmake and make
invocations, so it does not work with qmake -r. to make it still
possible to integrate it into the qt5 aggregator project, give it a
chance to "break out" from the recursion.

Change-Id: I926836e44c0e0790cdd90e6b0c8f766dccc33c4d
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-19 16:46:04 +02:00
Oswald Buddenhagen
e78c3bb620 look for mkspecs/ even below .qmake.cache/.conf-determined root
otherwise a cache/config in an aggregator project may unduly hide the
mkspecs/ of the aggregated project from qmake's view.

Change-Id: Idb0b124de071822f8f55463d9f8a4d194ef3130e
2012-06-19 16:46:03 +02:00
Oswald Buddenhagen
1f83f0cf2a add support for a super cache
qmake will now look for .qmake.super, just like it looks for .qmake.cache,
and the cache() function has a mode to write this super cache.
this allows the creation of aggregator projects like, say, qt5.
a notable difference to the normal cache is that this file is *not* added
as a dependency of the Makefile. this means that modifications done by
later sub-projects will not cause a re-processing of earlier projects, and
consequently that one should be cautious regarding what information to
store there.
another notable difference is that this file is read *before* the spec,
so the spec can use the variables from the cache without resorting to
$$fromfile() & co.

Change-Id: I4807b6d34014261fa9eebd6f0ae128b802d86691
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:46:03 +02:00
Oswald Buddenhagen
16d5b6911f look for .qmake.conf files
this is the source dir equivalent of .qmake.cache and can be checked
into the repository. it can be used to make project-wide settings, or
just to signal the presence of an mkspecs/ directory.

Change-Id: I5f1cebad2aa2a89e78089341b2051613b6b7a613
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:46:02 +02:00
Oswald Buddenhagen
f86f3613a5 find .qmake.cache for subprojects independently
this allows the creation of aggregator projects, like, say, qt5.
this is not expected to have a negative impact, as no project could
reasonably expect a nested .qmake.cache to *not* take effect - in fact,
if the project was processed stand-alone, it would already use it.

Change-Id: I33f2935d309baba7e95465f2fefb8231c4f03eda
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:46:02 +02:00
Oswald Buddenhagen
c80697cfbe allow setting QMAKEPATH and QMAKEFEATURES in .qmake.cache
Change-Id: Ie383abb57c06cb49d38345d64750837b8fe14c70
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:46:02 +02:00
Oswald Buddenhagen
e894155a41 don't duplicate project_build_root's calculation needlessly
Change-Id: Id2f343c450149b13b52c2cae8eb6eb4bfd73fc03
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:46:02 +02:00
Oswald Buddenhagen
a07d4f8fb3 remove some symbian cruft
- Option::mmp_ext
- references to dead QMAKE_INTERNAL_ET_PARSED_* variables

Change-Id: I863605b23798cbca3f6c8ab5a154fd432f1f4dcc
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:40:02 +02:00
Oswald Buddenhagen
7d44bd0646 remove last traces of js support
don't even complain about trying to use js-based feature files. we have
been doing that for long enough.

Change-Id: Ib58ec204322442c488e8d780989f26b1e32595ed
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:40:01 +02:00
Oswald Buddenhagen
ad92c6c7de make splitPathList() return an empty list for an empty string
this makes the user code a bit cleaner

Change-Id: I3713c73c5c19cf69341be65480917eda0b967b77
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:40:00 +02:00
Oswald Buddenhagen
6a8f64136e introduce /get property variants
properties are now split into a write location $$[FOO] and a read
location $$[FOO/get]. the write locations are hard-coded and configurable
via qt.conf/Paths as before, while the read locations are configured via
qt.conf/EffectivePaths.

this finally provides a clean solution to the problem that during the qt
build itself tools and libraries need to be taken from somewhere else
than they are installed to.

Change-Id: I956c43bd082afd465e690fe75d0bee3c2c0f7c25
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-06-19 16:39:58 +02:00
Oswald Buddenhagen
ab0d55e361 purge unused VcprojGenerator::findTemplate()
it looked fishy for years. now i know why. ;)

Change-Id: I822cadecaf8d914f383f9f907b92507852e434b4
2012-06-19 16:39:58 +02:00
Oswald Buddenhagen
b35d8e651b don't generate make_default targets
make_first really means the same, as the default target is 'first'
which immediately invokes make_first.

as a nice side effect, this fixes ALL_DEPS not being used by the subdirs
template's default target - make_default wasn't special-cased in the
right place, while make_first is.

Change-Id: I946cea3b2dae198eda61d31dbd19c6ccd15deac7
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:58 +02:00
Oswald Buddenhagen
c85dc033dc add $$reverse() function
returns the list with the order of the elements reversed.
one can easily implement this with existing functions, but this is way
faster and more readable.

Change-Id: I12d306eb9fe58fc332622274ea6b658192529491
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:39:57 +02:00
Oswald Buddenhagen
083f7c501f add $$shell_quote() function
to be used in system() calls and when assembling EXTRA_COMPILER and
INSTALLS .commands by hand.

Change-Id: Id706cd56aa267a9fb4b14e3416692b4716fafa5b
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:57 +02:00
Oswald Buddenhagen
09e01856b0 add $$absolute_path() and $$relative_path()
just exposes QDir::fooFilePath() wrapped into QDir::cleanPath()

Change-Id: I7a7644084825fd8092a9910ac20f695c4d9351f6
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:57 +02:00
Oswald Buddenhagen
d8e6c49bfa add $$native_path() function
more or less QDir::toNativeSeparators(QDir::cleanPath())

Change-Id: I52deee1e8086559eda5833b387a0cf64d21cbcd9
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:57 +02:00
Oswald Buddenhagen
f97913f2da add $$clean_path() function
just QDir::cleanPath()

Change-Id: I2d51e2385939d8926c00f296537ab7f6757d9a79
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:56 +02:00
Oswald Buddenhagen
1261c9b2f4 add $$format_number() function
Change-Id: I04266c1f5fb72af94073f3f508cee59085e365b6
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:56 +02:00
Oswald Buddenhagen
bf984d5f24 add $$shadowed() function
return the build directory corresponding to a given source directory.
this is the identity function if not shadow-building. if input lies
outside the source directory, return empty value.

Change-Id: I2d2a6b1112bd19989fe29cfe19a12d39a0d208c1
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:56 +02:00
Oswald Buddenhagen
6a66fef520 add $$val_escape() function
this quotes the elements of a variable in a way suitable for re-parsing
as qmake code.

Change-Id: I0e6ea2478c43b5aeff45f485a48ac8c86705dd4a
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:56 +02:00
Oswald Buddenhagen
ade089907b add $$enumerate_vars() function
this simply returns the keys of all variables in the context.

Change-Id: I0092f827744fcd257dfb9e7ca664c87c6f1cc763
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:39:55 +02:00
Oswald Buddenhagen
1388199d4f make defined() support testing definedness of variables
Change-Id: I58d2dd402d72ee5a19012a6b5a4ba111717d40cc
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:55 +02:00
Oswald Buddenhagen
7da934d776 add mkpath() function
Change-Id: I8809b9ee4e85fbe8cec95641d659f237c5f51a26
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:55 +02:00
Oswald Buddenhagen
b500397809 add log() function
this is a literal print to stderr.

Change-Id: Ib0a2f53373ebbc4e0bda07a38d656bce145b31cf
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:54 +02:00
Oswald Buddenhagen
064a5a08d2 add touch() function
this is equivalent to unix "touch --no-create --reference <ref> <file>".
QFile has no setLastModified() (even though QFileInfo has
lastModified()), so the implementation is low-level.

Change-Id: I6783e8f2613e168ad0c24e79e7384d5b2e4901ee
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:54 +02:00
Oswald Buddenhagen
84614cabfa add write_file() function
this dumps the contents of a variable into a file. each element of the
variable is considered a line; line terminators are added. all missing
directories are automatically created.

Change-Id: Idafeb873cea64e6705c894b3ab0ef21df69e7170
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:54 +02:00
Oswald Buddenhagen
2702f7637e add cache() function
this function adds the current contents of the named variable to the
cache. this comprises populating base_vars and appending an assignment
to .qmake.cache. if no cache file exists yet, it will be created in the
current output directory (and inherited by subdirs projects). if called
without a variable name, only create the cache file if missing.

Change-Id: I1e81c2238aa6a5817a6ebbfb022e2b995c349363
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:54 +02:00
Oswald Buddenhagen
64f475aabd add "blob" and "lines" modes to $$cat() and $$system()
this bypasses the otherwise done insane word splitting

Change-Id: Ia9b8980bc0770de3999544a06d239f55fb34f801
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:53 +02:00
Oswald Buddenhagen
7d8578418d properly declare the host tools as such in the project files
don't mess with the qmake cmdline args any more.

Change-Id: I399d87145d31d25e29951b6acd96387a3c7282f0
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:37:50 +02:00
Oswald Buddenhagen
14bbab09c1 introduce ability to build projects for the host system
when qmake runs into the new option(host_build) command, it will restart
the project evaluation with a host spec.

the new default host spec is called default-host (gasp!). it is
overridden with the pre-exising -spec / -platform option, while the new
-xspec / -xplatform option overrides the pre-existing default spec.
specifying -spec but not -xspec will set the xspec, too, so the behavior
is backwards-compatible. same for the XQMAKESPEC override read from
.qmake.cache and the environment variable.
the cleaner solution would be adding -hostspec, to be symmetrical with
the override semantics, but that would deviate from configure in turn.

Change-Id: I4297c873780af16ab7928421b434ce0f1d3820da
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:37:49 +02:00
Oswald Buddenhagen
528192a78b Revert "make default_pro.prf advertize dynamically created .qmake.cache"
... and followup fixes.
this is not needed any more due to the breaking patch being reverted.

Change-Id: Ia3416fcc16ddece680efbd0322286a601879fa0a
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:37:49 +02:00
Oswald Buddenhagen
4e9cbfc90f Revert "move .qmake.cache search to Option"
We are now moving in the exact opposite direction.
This logically reverts commit 059200a44b.
Some adjustments were necessary to maintain the project root stuff.

Conflicts:

	qmake/main.cpp
	qmake/option.cpp
	qmake/option.h
	qmake/project.cpp

Change-Id: Ic14fa571cbbfe9ac159f92493e49741d70a87eff
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:37:49 +02:00
Oswald Buddenhagen
d8b2998dae Revert "move finding the makespec to Option"
Needed for an upcoming revert.
This reverts commit 74a6669fa7.

Conflicts:

	qmake/option.cpp
	qmake/project.cpp
	qmake/property.cpp

Change-Id: I56088506d27bf1f095f9261c75224f4bee17ec60
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:37:49 +02:00
Andy Shaw
4524187129 Remove unnecessary code from the XCode generator
Since we only support XCode 3 and later, then all of the legacy code can
be safely removed.

Change-Id: I9be8555aaa62c716b2277c2b97f41aa02d27ef13
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-12 17:40:21 +02:00