Commit Graph

146 Commits

Author SHA1 Message Date
Thiago Macieira
fd63acdc83 Don't use the QRegExp methods that modify the object [qmake]
QRegExp matching methods modify the object, which we don't want to. In
particular, when we receive a QRegExp from the user or we store in a
context that might require thread-safety, make sure we make a copy
before using it.

QRegularExpression has no such shortcoming.

Task-number: QTBUG-25064
Change-Id: I6b2d2530238a7e04b44859664a2962f2f466ee30
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-23 19:20:19 +02:00
Mark Brand
8e053a5dfc fix static library names when generating .pc files for pkgconfig
219a688ac1 added the version extension
which only occurs on the DLL import library.

Change-Id: Ie913adf039d7f3a9aadf43f4af014289a8aeacbe
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Hib Eris <hib@hiberis.nl>
2012-04-19 19:46:07 +02:00
Lars Knoll
64255ef650 Merge remote-tracking branch 'origin/api_changes'
Change-Id: I964b0a6f5c38351fdfafb8a2a128a349ff8c89d1
2012-04-17 12:58:52 +02:00
Joerg Bornemann
ac7dd2782f qmake vc(x)proj generator: don't create bogus directories
When creating the temporary project object,
Option::output_dir must be adjusted temporarily.

Task-number: QTBUG-22788
Change-Id: Ibf8897a46b63f48b9e33d7e2168b09e559cecec7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-17 03:26:32 +02:00
Joerg Bornemann
8987e5d2cb qmake/Win: fix incomplete generated version resource
Since Windows Vista the resource language must be included to
make the version information visible in Windows Explorer.

Two new variables have been introduced:
RC_LANG (default: 1033) - resource language
RC_CODEPAGE (default: 1200) - resource codepage

Task-number: QTBUG-23218
Change-Id: I29e102d19501e3b7a43d5096fc4806bc38a4d846
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-04-17 03:26:32 +02:00
Joerg Bornemann
31cfe5ca1b qmake vcxproj generator: fix handling of /MANIFEST:NO linker option
Task-number: QTBUG-23513

Change-Id: I5dd6fb6fd7910e43acd28057133a3ad6613cfc1a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-04-17 03:26:32 +02:00
Joerg Bornemann
ee4d723ecc qmake: QMakeProject::intValue added
For variables that are supposed to contain a single int,
this method returns the numeric value.
Only the first value of the variable is taken into account.

Change-Id: Ifa11ba5ac044e0a4703a387a9bcf02043e4681d8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-17 03:26:32 +02:00
Joerg Bornemann
65425be8fe qmake vcproj generator: unused variable removed
Change-Id: Iaf8bb1772846001297e1a421c3860f5e4d090a35
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-17 03:26:32 +02:00
Lars Knoll
9bd0323551 Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
	configure
	src/corelib/io/qurl.cpp
	src/gui/kernel/qwindow.cpp
	src/tools/moc/generator.cpp
	src/widgets/kernel/qwidget_qpa.cpp
	src/widgets/styles/qstyle.h
	src/widgets/widgets/qtabbar.cpp
	tests/auto/corelib/codecs/utf8/tst_utf8.cpp

Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e
2012-04-16 12:04:34 +02:00
Joerg Bornemann
99a2074369 qmake vc(x)project generator: fix VC++ Express detection
If VC++ 2010 Express and VC# 2010 Express are installed, then the
installation path is written in two places into the registry.
We're now filtering detected installations with the same installation
path.

Task-number: QTBUG-24956

Change-Id: I401430e7aa81d96c523d8172d2a2e9d40ebdb3ce
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-12 04:15:05 +02:00
Oswald Buddenhagen
143c4d3e13 Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
	configure
	src/widgets/styles/qwindowsxpstyle.cpp
	tests/auto/gui/kernel/qwindow/qwindow.pro
	tests/auto/gui/kernel/qwindow/tst_qwindow.cpp

Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
2012-04-10 15:31:45 +02:00
Thiago Macieira
7ae76153cb Remove -DQT_NO_STL from the bootstrapped builds
Change-Id: I37ea06426b66e617a49ec46952abdaad8814eadf
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-04-07 05:19:56 +02:00
Joerg Bornemann
0174c966f7 qmake vcxproj generator: properly escape XML attributes
Task-number: QTBUG-24954

Change-Id: I21299440ba3f268c2fa1e14d37003cdc3e6a35ad
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-05 17:48:15 +02:00
Giuseppe D'Angelo
33984e72ab QHash security fix (1/2): add global QHash seed
Algorithmic complexity attacks against hash tables have been known
since 2003 (cf. [1, 2]), and they have been left unpatched for years
until the 2011 attacks [3] against many libraries /
(reference) implementations of programming languages.

This patch adds a global integer, to be used as a seed for the hash
function itself. The seed is randomly initialized the first time a
QHash detaches from shared_null.

Right now the seed is not used at all -- another patch will modify
qHash to make use of it.

[1] http://www.cs.rice.edu/~scrosby/hash/CrosbyWallach_UsenixSec2003.pdf
[2] http://perldoc.perl.org/perlsec.html#Algorithmic-Complexity-Attacks
[3] http://www.ocert.org/advisories/ocert-2011-003.html

Task-number: QTBUG-23529
Change-Id: I7519e4c02b9c2794d1c14079b01330eb356e9c65
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-03 19:12:13 +02:00
Yuchen Deng
c7f8f459bd Fix build all failed for 'TEMPLATE = aux'
NMAKE : fatal error U1073: don't know how to make 'all'
Stop.

Change-Id: I387a417d37e38811706a1ff460df8ee581c6a33f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-02 12:41:32 +02:00
Jędrzej Nowacki
fb650b0271 Compile QArrayData in bootstrap phase.
This change will be needed during migration from QByteArrayData to
QArrayData.

Change-Id: I0c8d6f9ed3ef7c33af62736af55259a8f9a70c0f
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-29 11:28:41 +02:00
Thiago Macieira
af3c7d35b6 Fix qmake's use of Q_ASSERT with side-effects.
The nice side-effect of having Q_ASSERT use the condition twice is
that we break code that has side-effects.

Change-Id: Ia0b7ed2a8030c8e222612af95eb2d58671433110
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-28 21:24:43 +02:00
Thiago Macieira
6ab6b0fc1c Disable QUrl support in QVariant in bootstrapped mode
The only use of QUrl in qmake, moc, uic and rcc is due to QVariant's
internals, so let's disable it. This means those binaries are now
probably a lot smaller since the parsing and IDNA code don't need to
be present.

Change-Id: Ie156b0817d119b2ba5d3dcb9712a9fea2ee7d4a1
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-24 16:30:58 +01:00
Kent Hansen
95d6f8a4cf Merge master into api_changes
Conflicts:
	src/corelib/tools/qvector.h
	tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp

Change-Id: I877256e95f3788e617437f4e9661a88047f38cd6
2012-03-19 10:03:48 +01:00
Marius Storm-Olsen
fbc251b364 Win32: Compile qmake when shadow-building
Change-Id: I803c733f744372701c51e4d629ff797c6648f833
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-18 12:36:48 +01:00
Olivier Goffart
3abc6be685 Build qmake with QStringBuilder.
QStringBuilder will be enabled by default so qmake should build with it.

qstringbuiler.cpp has to be compiled in just for the convertFromAscii
(The alternative was to build with QT_NO_CAST_FROM_ASCII, but that would
be too much work)

Change-Id: I1fbeed7ed8a9d3bc38ef591a687c50644980e2fd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-16 23:02:15 +01:00
Oswald Buddenhagen
c0791b86ab allow the unix generator to run in windows host mode
this is a complete bastardization of the concept and breaks the (unused)
debugging feature to create proper unix makefiles under windows, but
apparently it permits cross-compiling unix targets under windows.

Change-Id: I4ee95a20e7d6a6b2063ec7aa22f52c1a97d78a77
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-16 18:12:41 +01:00
Lars Knoll
d5098f2802 Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
	tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp

Change-Id: I884afc3b6d65c6411733a897a1949e19393573a7
2012-03-12 21:03:49 +01:00
Sean Harmer
2dd6f1467f Allow qmake to find features when using mkspecs in nested dirs
Commit 8e5eb1bddc introduced the assumtion that mkspecs are
immediately below the mkspecs directory itself. This is not true for
e.g. unsupported/blackberry-armv7le-qcc.

This commit restores qmake's ability to find the "root" of the mkspecs
collection no matter how deeply the actual mkspecs are nested.

Task-number: QTBUG-24665
Change-Id: I98faaf8e6ae7b8524277aea6c17e685e507e37b3
Reviewed-by: Sean Harmer <sh@theharmers.co.uk>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-12 11:09:24 +01:00
Oswald Buddenhagen
aed6eaa5b2 QT_RAW_INSTALL_FOO => QT_INSTALL_FOO/raw
this makes the "sysrootable" properties more magic, with the raw
versions being omitted from the qmake -query output and automatically
falling back to the "cooked" variant if there is no sysroot set.

this makes the "normal" qmake -query less noisy. this will become even
more obvious when i add more "overloads" of the properties.

Change-Id: I08000986427264ec6238c8fe0a77f5cecdbf1201
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-12 11:01:02 +01:00
Oswald Buddenhagen
197ba93cf0 rip out -incremental from configure
the feature is rather obscure and unlikely to be used by anyone.

Change-Id: I2dfb4ca4d5d1f210d385c013f46bc6389fd6ea2d
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-12 10:59:44 +01:00
Oswald Buddenhagen
46e51ce1dd do not copy/symlink qmake to build dir
make is perfectly capable of doing shadow builds

Change-Id: I7e1c27cddc385b7a17ae5645b9cd26fa56d2f029
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-09 14:23:15 +01:00
Oswald Buddenhagen
2640b71be4 remove support for QMAKE_PLATFORM_DIR
this was a somewhat magic support for sysroots, automatically rewriting
a number of path-holding variables. this was (as usual) completely
undocumented, extremely fragile, and we are coming up with something
better now anyway.

Change-Id: I045910f532cb3efc839ea81c7a48f8db695e4092
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-08 23:52:34 +01:00
João Abecasis
12f221410f Merge remote-tracking branch 'origin/master' into api_changes
Change-Id: I89dc2e193bd01624c1fb50484610d516e39b1538
2012-03-08 01:27:39 +01:00
Oswald Buddenhagen
6c612c9338 move postProcessProject() call to sane location
there is totally no reason to call it unless the project is actually
used for makefile generation, and the excessive calls actually mess up
things.

Change-Id: Idb7912a5404f6054010d2f29cce820a167de4f6f
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-07 22:46:29 +01:00
Oswald Buddenhagen
4958c138a7 don't add bogus /mkspecs to QMAKE_MKSPECS
the project build root can of course be empty - if there is neither an
mkspecs/ nor a .qmake.cache - or no project in the first place (-query).

Change-Id: I9595b0b4ad80a9086dcd48c9ae62b3e8bd1b6f2f
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-06 21:50:25 +01:00
Thomas McGuire
11f9d18731 Fix finding specs in the unsupported/ directory.
The -spec argument was interpreted as a relative directory as
soon as it contained a slash. Fix this by checking if the
directory exists before attempting to interpret it.

Change-Id: Ide8f0418abc719b0be582d2d72642a141f6c6dea
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-06 17:47:46 +01:00
Max Desyatov
9d5e721e96 escape *_script_file usages in MingwMakefileGenerator::writeObjectsPart
Task-number: QTBUG-24595
Change-Id: I1e78a6015247b9e41ae2b05b50fdedf0613f00f1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-06 12:28:26 +01:00
Oswald Buddenhagen
52843c1988 de-duplicate feature and mkspec root candidate lists
Change-Id: I03f5b5903a133e5386b9ebef640ddbacdf3ebcd4
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-06 12:28:18 +01:00
David Faure
dc75c20397 Split up base class QFileDevice for open-file operations (read/write)
This will be used later on as a base class for QTemporaryFile and
QSaveFile.

Change-Id: Ic2e1d232f95dc29b8e2f75e24a881ab459d3f037
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-06 12:09:57 +01:00
Oswald Buddenhagen
84ddc06380 do not re-evaluate spec+cache in build passes
clean up the somewhat convoluted code paths which forced re-evaluation.
now that the spec+cache are evaluated in a completely clean context
anyway, there is no point in re-evaluating them for build passes.

Change-Id: I12279083238e9ca7028af97f45e2638c8dc715b8
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-06 06:34:49 +01:00
Oswald Buddenhagen
703ef4f79e make QMakeProject's copy c'tor actually behave like one
instead of initializing base_vars with the original's vars, initialize
vars itself. this has two consequences:
- there is no need to call read(0) to initialize vars
- one cannot usefully call the complex read() anymore, as that would
  re-initialize vars from base_vars

this is much closer to an actual copy than the previous "seeding with
existing project".

Change-Id: Ib007bc5b779aedb680a27329aa578f7c604a4308
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-06 06:34:47 +01:00
Oswald Buddenhagen
a91c997238 give load()/include() with target and infile()/$$fromfile() a clean environment
load()/include() with a target namespace would inherit the current
context. however, if you source a project with all bells and whistles,
this makes completely no sense and may be actually counterproductive.

infile()/$$fromfile() would have interited only the functions from the
current context. that was only a hack to support abusing them.

Change-Id: I2e992b923d9e5b0e5056001ca49b35de573abc63
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-05 14:46:36 +01:00
Oswald Buddenhagen
deb3c134b5 remove injection of default_pre in infile()/$$fromfile()
this is a hack from the times when these functions were (ab)used to
inspect proper project files, but the inclusion was done with a clean
project, so that the included files did not have any functions to work
with.

Change-Id: I19925e8ead597ca38df040000c183e368b32c06d
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-05 14:46:12 +01:00
Lars Knoll
96232be146 Merge remote-tracking branch 'origin/api_changes'
Conflicts:
	dist/changes-5.0.0
	mkspecs/features/qt_module_config.prf
	qmake/project.cpp
	qmake/property.cpp

Change-Id: I6e4af40743a9aeff8ed18533a48036e332acc296
2012-03-04 21:45:05 +01:00
Oswald Buddenhagen
c679b2f0a6 get rid of Option::user_configs
merge them into before_user_vars. they are evaluated right after another
anyway.

Change-Id: I11859284b363fee01233f6e20989444fef711d0d
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-02 21:33:08 +01:00
Oswald Buddenhagen
a30074bab8 remove now unused QMakeProject c'tors
Change-Id: Ia65d49df50a5610bbd88417ca90ac348a774a1e1
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-02 21:33:08 +01:00
Oswald Buddenhagen
dce3821b8a make evaluation of spec+cache independent of build pass context
don't inject the build pass specific variables into the project even
before evaluating the .spec file and the .qmake.cache. they are not
supposed to base configuration on that - feature files should do that
later.

the immediate advantage of this is that base_vars is never manipulated
upfront any more, which allows for cleaner setup paths. also, we can do
more caching of the spec+cache contents.

Change-Id: I19d7f8bec1fb7c3b54121e26794340b287055ebf
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-02 21:33:08 +01:00
Oswald Buddenhagen
93ee903da7 clean up build pass project initialization
instead of messing with the Option singleton, add a way to inject
extra config values into QMakeProject.

Change-Id: Ia347dcc38af2c72913e30ebf5c2b4044f93b4f5f
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-02 08:43:21 +01:00
Oswald Buddenhagen
74a6669fa7 move finding the makespec to Option
this is a one-time operation which depends only on the invocation, so
this new home is much more appropriate.

Change-Id: I07c66d95a9ae01a664cec17564995311fb78ec9b
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-02 08:43:06 +01:00
Oswald Buddenhagen
c3a1af63ae search for default spec just like for other ones
that way qtbase will find its spec without hacking .qmake.cache.
note that passing "-spec default" on the command line would have already
triggered the normal path, so artificial limitation did not even provide
safety against abuse (it is arguably pointless/counterproductive for
other projects than qtbase to have a default spec).

Change-Id: Ib0c3e6498fd70cd6f9561951d72a47165878bb33
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-02 01:06:22 +01:00
Oswald Buddenhagen
054051d91f remove some bogus include locations
nothing to be found in <sourcedir>/include.
neither in <builddir>/src/corelib/xml.

Change-Id: I381391a64542dc2ac7b421b6646c60a1b7a14639
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-01 23:22:00 +01:00
Oswald Buddenhagen
5515b48ac9 use VPATH to locate sources
makes the file a "tad" more concise

Change-Id: I81d9721942890659ac93b32f5988f9c005c88e87
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-01 23:21:48 +01:00
Oswald Buddenhagen
d9bf972e2b merge Makefile.win32-g++{,-sh}
the only difference is in the copy & del commands. the msys tools are
tolerant about windows paths, so this just works.
the in-makefile variant detection is stolen from tools/configure/.

Change-Id: Ia283c1fe2e2aaa8cd5b1dfd7ae29244115f07d65
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-01 23:20:44 +01:00
Oswald Buddenhagen
012f799254 revamp -sysroot and -hostprefix handling
instead of being a variable added to the makespec (via qconfig.pri),
QT_SYSROOT is now a property.

the QT_INSTALL_... properties are now automatically prefixed with the
sysroot; the raw values are available as QT_RAW_INSTALL_... - this is
expected to cause the least migration effort for existing projects.

-hostprefix and the new -hostbindir & -hostdatadir now feed the new
QT_HOST_... properties.

adapted the qmake feature files and the qtbase build system accordingly.

Change-Id: Iaa9b65bc10d9fe9c4988d620c70a8ce72177f8d4
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-01 23:18:23 +01:00