we pull this feat off by booting configure with a dummy spec. the proper
spec gets loaded subsequently.
note that it was necessary to move the cache loading after processing
the early checks (from which the spec handling is triggered). this is
just fine, as the cache is needed only by tests, which are forbidden at
this stage by definition.
Change-Id: I5120e25a8bf05fb8cc5485fd93cf6387301089aa
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
this moves us another step towards the "outer" configure doing just
minimal bootstrapping of qmake.
a challenge here was that so far, qmake itself needed qconfig.cpp. this
was replaced by usage of a qt.conf file instead of compiled-in values.
however, to make the executable still self-contained, that qt.conf is
embedded into it (by simple appending of a fixed signature and the text
file).
the qmake with the embedded qt.conf is not used for the qt build itself,
which instead relies on the qt.conf in bin/ as before. however, due to
the missing built-in values, this file now needs to contain more
information than before. but except for a minimal version that is needed
to start up qmake/configure at all, that file is now also generated with
qmake. as some of the newly set up properties are subsequently used by
configure itself, qmake gains a (deliberately undocumented) function to
reload the qt.conf after it's fully populated.
unlike the old implementations, this one doesn't emit redundant qt.conf
entries which match the hard-coded fallbacks. omitting them leads to
leaner files which are more comprehensible.
Started-by: Paolo Angelelli <paolo.angelelli@qt.io>
Change-Id: I4526ef64b3c89d9851e10f83965fe479ed7f39f6
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
its only consumer is qt_tool.prf, which is an internal api.
Change-Id: Iae90b079c5af60efad2ded70d6ea481212e5353a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
the qmake bootstrap uses some of the options, so the configures still
read config.opt for their own purposes, but the general handling is
entirely in the new system now.
Change-Id: I2c6c657d4da01c8d520ac74795454747bb224bdd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
this also removes the need for passing pre-processed options via
configure.cfg, so get rid of that.
a somewhat unfortunate side effect is that the android-style-assets
feature had to move back to the top level, as the licensing options
depend on it.
Started-by: Lars Knoll <lars.knoll@qt.io>
Change-Id: Id4d1e0ba18b3e3104400293b8f0c7f2f65e68dea
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Adds platform and CPU features to the reported build type,
matching the format of the old configure.
Started-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: I6d93ec7416b38684da51af5238a5cf537810b21d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
now the callbacks don't need to re-export the designated file contents,
which improves the abstraction and removes some boilerplate.
Change-Id: Ifa50313155fc96762025e2610b810ebb71daa373
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The crossCompile test checked only if platform and xplatform are different
(which is the usual case), but in yocto builds cross compilation is done
by setting both platform and xplatform to the same target mkspec and using
host tools from -external-hostbindir.
Change-Id: Ib4ae3975a52196d9c0ad52b5b5e9ccd7c1bfe883
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
it's a bit pointless to state "(with debug info)" also for the default
build mode.
Change-Id: I99563c424752c735a3157776ef4fe5252ebd3900
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
the regex didn't match the actual output ("icpc (ICC) 17.0.0 20160721"),
and the code failed to concatenate the lines (broken in 492d7d14fc, as
for clang).
but using -dumpversion (as we do for g++) is more elegant anyway, so do
it instead.
Change-Id: I328bbfab9c08d6e660c3f1ec51554d9f877b8f66
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Concatenate the multi line output from clang into one line before parsing
it. This got broken in 492d7d14fc.
Change-Id: I282d69932c5851f229213d7ef1ca6a78cd56c8c3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
the spec (possibly) provides QMAKE_PKG_CONFIG. PKG_CONFIG is dynamically
determined on use.
Change-Id: I45b7f4eddeff5d28539021472ef9036dd397d61e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
... and use that variable in qt_configure.prf to find the pkg-config we
detected during qtbase configuration.
This is required for modules outside of qtbase being able to use
pkg-config to configure external libraries.
We do not use the PKG_CONFIG variable any more, as that interferes with
the $$pkgConfigExecutable() function, which some Qt modules still use.
Change-Id: I8886a266207e04301009fe8207c16b02c5455b2f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
... to the new qmake based configuration system.
This removes the old qfeatures.txt (distributed over configure.json
files) and qfeatures.h (distributed over qconfig-<module>.h files).
qfeatures.prf is gone without replacement, as attempts to use it would
lead to followup errors anyway.
Change-Id: I1598de19db937082283a905b9592d3849d2199d0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
"description" suggests something slightly longer.
this may seem like a gratuitous change, but the upcoming replacement of
the old feature system clarifies makes it seem much less so.
Change-Id: Ibe702e01cb146b59127bf1f990b4acaef1c61d55
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Move the different parts of configure.json/.pri into the libraries where
they belong.
Gui is not yet fully modularized, and contains many things related to
the different QPA plugins.
Done-with: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Change-Id: I6659bb29354ed1f36b95b8c69e7fce58f642053f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This change implements the required infrastructure to modularize the new
configuration system.
This requires a hierarchy of configuration files, both for handling
multiple repositories and for individual modules inside the same
repository.
When configuring, they all need to get loaded first, as command line
processing needs to know about all possible command line options.
When the command line has been processed, the individual configuration
files need to get processed one after the other and independently from
each other.
Configure is now automatically invoked when building the a project
tree's "root" project; this works with both modular and top-level builds
of Qt (the latter with an according change in the super repo). As an
immediate consequence, the -skip option moves to the super repo with a
different implementation, as configuration is now done after the repo
list is determined. The option belongs there anyway.
This commit also adds an optional testDir entry to the json file. Like
this, we can still have all configure tests in qtbase/config.tests and
the configuration file in, e.g., corelib can reference those.
The files section can now be left out as long as a 'module' entry is
present, specifying the module name. The names of the files to generate
can then be deduced from that name. We still need to be able to specify
names directly for the global configuration files.
qtConfig() now also queries features which are module-specific. As it is
sometimes necessary to query the configuration of modules which should
not be actually linked (and cannot in the case of subdirs projects), the
new variable QT_FOR_CONFIG which allows specifying configuration-only
dependencies is introduced.
Done-with: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Change-Id: Id1b518a3aa34044748b87fb8fac14d79653f6b18
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This is required to do the modularization of those
features properly.
Change-Id: I384aff20274e795aa70483980f0ef25309328800
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Run cl.exe /? and extract version from header line printed
to standard error.
Change-Id: Iecf18f1b0f94cc1d51add7021d80772784e0f953
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
test callbacks MUST NOT act as outputs, ever.
this went unnoticed so far, as it would become visible only with
configure -recheck.
Change-Id: Idd923097b4b2790ef4fe8a6d430db4b62851801a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
as these tests do nothing but validating the command line, caching the
result is more confusing than anything else.
also make the tests silent, so they don't clutter an otherwise fully
cached configure run.
Change-Id: Ifc3d65278769b36a056650f077fd6274a7e192e7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
instead of saving the files away and restoring them afterwards, use the
new and shiny discard_from() function to throw away everything the files
might contain.
strictly speaking, this is not precise, as the pris may also use *=, -=,
and possibly other operations which cannot be trivially undone, but the
purpose is essentially to discard the special outputs of some features
which may affect subsequent tests, for which this is sufficient.
as a side effect, the failure to load qmodule.pri is not fatal any more
(like for qconfig.pri), to save the pointless effort of ensuring that it
exists.
Change-Id: I07625b60c4f2e27b21206b2c16d24ab111737395
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This is just an excuse to let build failures slip past CI, as has
happened and been fixed recently.
Change-Id: If4356eaced0f90c7c455b21cc7676b0c9b7b1e27
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Adapt configure.exe to use qmake to do most of the work of configuring
Qt. This unifies a large part of our configuration system between Unix
and Windows. configure.exe is now still doing the license check,
creating qconfig.cpp, building qmake, and not much more.
On the way, re-implement the still missing Windows-specific tests with
the new system.
The opengles2 vs. opengl-desktop conditions got a bit convoluted, as
Unix prefers desktop GL, while Windows GLES2 (via ANGLE). Superficially,
there is a circular dependency, but the platform scopes are supposed to
break it.
Done-with: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Change-Id: Ia1941f2c34b7f5bd4990a7673cd737361381c2e7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
it is sometimes desirable to override values from the mkspec without
modifying (or wrapping) the spec itself. linux distributors do this on a
regular basis.
so far, we'd pick up CFLAGS, etc. from the environment, in a somewhat
autoconf-like fashion. however, over time, this approach proved
problematic: the concept doesn't mix particularly well with mkspecs to
start with, is unexpected (and therefore causes frustration), and
doesn't mix well with cross-building (at least the way it was realized).
ironically, it was implemented this way (quite a while ago) upon my
explicit request ...
the new mechanism uses explicit variable manipulations on the configure
command line, just like qmake itself understands. as it happens, this is
again quite similar to autoconf-generated configure scripts. however,
this time around we don't pretend to be actually autoconf-like, so we
also don't try to map any variable names (some of which have different
semantics anyway).
this commit also eliminates the last use of the QMakeVar() function,
so delete it and the underlying infrastructure.
Task-number: QTBUG-32530
Task-number: QTBUG-42962
Change-Id: Id31a6b80e1add08ca21f5b178614bda530d12374
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Add [-no]-style-foo command line options for all widget styles, bringing
this closer in line with configure.exe. Add proper platform dependencies
and a configure test for the required uxtheme.h header on Windows. Clean
up and simplify styles.pri. Don't let configure.exe define QT_NO_STYLE_*
any more, as styles.pri does that locally anyway.
Change-Id: I81341f887a65b4e45e77380974eb79743acfad77
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
so far, each library was distributed over a test and (optionally) a
'library' output of a feature. this was conceptually messy and limiting.
so instead, turn libraries into a category of their own.
libraries now support multiple properly separated sources, which makes
overriding them a lot saner. sources can be conditional to accommodate
platform differences.
as an immediate consequence, move (almost) all library references from
the config test projects to the json file.
a few tests were excluded, because they are doing somewhat magic things
that should not be handled in this bulk change:
- freetype: .pri file shared with actual source code
- clock-gettime: -lrt is conditional, and there is a .pri file which is
shared with actual source code
- ipc_posix: -lrt & -lpthread conditional
- iconv: -liconv conditional
the multi-source mechanism is used to make a variety of tests work on
windows, where the library name differs from unix (and sometimes between
build configurations). some tests still needed minor adjustments to
actually work.
on the way, fix up disagreements between manually specified libraries
and pkg-config lines (affecting several xcb-related tests).
Change-Id: Ic8c58556fa0cf8f981d386b13ea34b4431b127c5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
never use $$system() directly, but instead use qtRunLoggedCommand() with
a newly introduced out parameter. that way we can print the command's
raw output, which should help debugging configure problems.
additionally, we now consistently check the exit code of all executed
commands, which should avoid confusing followup errors.
note that as a side effect some calls now use $$system()'s 'lines' mode
instead of the bizarre default splitting mode. this has no impact on any
of the cases, which is why it is basically a negligible style change at
this point.
however, qtLog() gained support for arguments with more than one element
to accommodate this.
Change-Id: I40d907e27de32dfec8d6086ce7d93fc4be18241f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
this is clearer, and avoids potential false hits if the target OS
is changed without cleaning the build dir first.
Change-Id: If88f3c555740dc9ff559c172b4b005ed8bfb60ae
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
standardize on the fields in the json structure being single strings in
which separate elements are quoted and space-joined (because quoting
is unlikely to be necessary in the json file itself, and this format
avoids the visual noise of array handling).
the quoting itself is expected to be qmake-compatible, which is assumed
to be the case for the output of pkg-config (it's actually shell-quoted,
but that's the same except in some not-so-relevant corner cases).
Change-Id: Icc1d7abc02c449fa759d9714bc5e56e2b8809585
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Now that -l and -fw options are gone, using a combined EXTRA_LIBS
makes no sense anymore and only complicates things.
Change-Id: Ic12bf482f3bed041aff7f0891f008b1f34ae2b4d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
These arguments were nonsensical, as they would lead to every single Qt
module linking to those libraries. This was probably some left-over from
old times, when Qt was just a single library.
Change-Id: I0343a6df270fd0d2efa5333ba4e457670f5d0910
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This is not a feature that should get propagated to other
configure runs, so simply hardcode support for it.
Change-Id: Ieb1c33243154b3583e91061d3592d7e87c36f402
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Detect host and target architecture from within qmake, and set
QT_ARCH accordingly.
Change-Id: I30255f88c7645d197bd07355a1dff02b377cbbe8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
But without a version number for now.
Change-Id: I0a976ba463cff6812faf85de03a6ad003ea582f5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Command line arguments, configure tests and features are now
defined in a json file and a configure.pri containing some
custom functions.
qmake uses the json file to determine command line arguments,
tests and features to be executed at configuration time.
A new qt_configure.prf contains all the infrastructure to parse
the command line, run the configure tests, determine the set of
available features and create a report about it.
Change-Id: If30ac089dd3e9f8c67ebd642bde10cfa960893bb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>