| 1 |
This is a patched version of Qt. It may include changes made by KDE |
| 2 |
and Qt developers that have either not been accepted for inclusion |
| 3 |
into Qt, or have been accepted for a later version of Qt than this |
| 4 |
one. |
| 5 |
|
| 6 |
1. Configuring Qt |
| 7 |
================= |
| 8 |
|
| 9 |
The recommended compile line is: |
| 10 |
|
| 11 |
--default-config-begin-- |
| 12 |
|
| 13 |
./configure -qt-gif -debug -fast -no-separate-debug-info \ |
| 14 |
-system-libpng -system-libjpeg -system-zlib \ |
| 15 |
-dbus -webkit -plugin-sql-mysql \ |
| 16 |
-nomake examples -nomake demos -prefix <installdir> |
| 17 |
|
| 18 |
--default-config-end-- |
| 19 |
|
| 20 |
It contains "-debug", which greatly improves the use for backtraces (but |
| 21 |
also needs a lot more disk space and makes things slower). To build in |
| 22 |
release mode, replace it with "-release". |
| 23 |
|
| 24 |
It also contains "-no-separate-debug-info", which disables separate .debug |
| 25 |
files. Instead, the debug information will be built into the libraries. |
| 26 |
This option is needed when you install Qt. |
| 27 |
|
| 28 |
If you don't install Qt, it can be useful to disable this option, |
| 29 |
thus having separate debug symbol files. With separate debug files, you can |
| 30 |
just move those debug files to another directory to remove Qt debug symbols. |
| 31 |
Moving the files back will enable Qt debug symbols again. |
| 32 |
This is useful if you rarely need to step into Qt functions during debugging, |
| 33 |
because GDB loads much faster and uses less memory without Qt debug symbols. |
| 34 |
In the rare case you need to step into Qt code, you can temporarily enable |
| 35 |
debug symbols again by moving the debug files back. You can even load the Qt |
| 36 |
debug symbols from within GDB on demand, using the "symbol-file" command. |
| 37 |
|
| 38 |
If you are planning to compile Qt using an Icecream cluster you have to |
| 39 |
pass the option -no-pch (no precompiled headers) to configure to make |
| 40 |
distributed compilation work. |
| 41 |
|
| 42 |
2. Compiling Qt |
| 43 |
=============== |
| 44 |
|
| 45 |
To compile Qt on a Unix platform, run: |
| 46 |
|
| 47 |
export MAKEFLAGS=-j2 |
| 48 |
make |
| 49 |
make install |
| 50 |
|
| 51 |
If your computer has more than one core or processor, you may consider |
| 52 |
increasing the "2" above. If you've got a compile farm available, you |
| 53 |
should adjust the -j argument to match the number of slots in that |
| 54 |
farm. |
| 55 |
|
| 56 |
3. Modifying & rebuilding Qt |
| 57 |
============================ |
| 58 |
|
| 59 |
If you make modifications to the Qt source code, you don't need to |
| 60 |
build everything again. Simply go to the directory containing the |
| 61 |
Makefile closest to the files you changed and run "make" again. |
| 62 |
|
| 63 |
For example, if you've modified src/corelib/io/qiodevice.cpp, do: |
| 64 |
|
| 65 |
cd src/corelib |
| 66 |
make |
| 67 |
|
| 68 |
If you make a change that is not temporary, you should create a Git |
| 69 |
commit out of it. However, you shouldn't push those changes to |
| 70 |
kde-qt.git. If you have a fix that benefit others, see the "Creating |
| 71 |
kde-qt.git modifications" section below. |
| 72 |
|
| 73 |
4. Building Qt examples and demos |
| 74 |
================================= |
| 75 |
|
| 76 |
The "-nomake examples -nomake demos" arguments to the configure script |
| 77 |
mean that those two sections will not be configured for building, |
| 78 |
which is unneeded for usage of the library. If you want to compile |
| 79 |
the examples or demos later, just enter either directory and type: |
| 80 |
|
| 81 |
qmake |
| 82 |
make |
| 83 |
|
| 84 |
5. Build Qt tests |
| 85 |
================= |
| 86 |
|
| 87 |
(Official information: http://qt.gitorious.org/qt/pages/QtAutotestsEnvironment) |
| 88 |
|
| 89 |
In order to run Qt tests, you must have a "developer build" of Qt. For |
| 90 |
that, you need to reconfigure Qt and add the "-developer-build" |
| 91 |
option. That option is technically equivalent to the options: |
| 92 |
|
| 93 |
-debug -prefix $PWD -DQT_BUILD_INTERNAL |
| 94 |
|
| 95 |
To run a test, go to its source dir in tests/auto/testname. Type |
| 96 |
"make" to build it, then run it (either ./tst_testname, or "make install"). |
| 97 |
|
| 98 |
6. Building Qt documentation |
| 99 |
============================ |
| 100 |
|
| 101 |
To build and install the documentation, run: |
| 102 |
|
| 103 |
make docs |
| 104 |
./config.status |
| 105 |
make install |
| 106 |
|
| 107 |
It is necessary to do this once only, even if you rebuild Qt later. |
| 108 |
|
| 109 |
7. Using Qt uninstalled |
| 110 |
======================= |
| 111 |
|
| 112 |
To use without having to install it, configure it as follows: |
| 113 |
|
| 114 |
./configure <other configure options> -prefix $PWD |
| 115 |
make sub-src |
| 116 |
make sub-tools |
| 117 |
|
| 118 |
Attention: DO NOT run |
| 119 |
|
| 120 |
make install |
| 121 |
|
| 122 |
If you do, Qt will overwrite your include/ directory with its |
| 123 |
installation. |
| 124 |
|
| 125 |
8. Creating kde-qt.git modifications |
| 126 |
==================================== |
| 127 |
|
| 128 |
If you have fixed a bug in Qt or modified it in any way that may |
| 129 |
benefit others, please share your change in the form of a patch. Do |
| 130 |
not commit your changes directly to the main branch because they |
| 131 |
may be lost in a future update if they have not been added to the |
| 132 |
official Qt release. |
| 133 |
|
| 134 |
The exception to the above rule is that if the fix has been accepted |
| 135 |
by the Qt developers (and so will appear in the very next release of |
| 136 |
Qt), then it should be simply cherry-picked from the Qt development |
| 137 |
branch. Note that you shouldn't do this for changes that have been |
| 138 |
accepted into a release which is not the very next. In this case, you |
| 139 |
should use the following command: |
| 140 |
|
| 141 |
git cherry-pick -x SHA1_OF_THE_FIX |
| 142 |
where SHA1_OF_THE_FIX is the SHA-1 of the commit that you want to |
| 143 |
introduce. Then push the change to the server. |
| 144 |
|
| 145 |
In all other cases, before creating a patch, it is recommended to |
| 146 |
contact the Qt developers via a new task in |
| 147 |
http://bugreports.qt.nokia.com and explain the situation. There may be |
| 148 |
a solution for the problem already or a new direction that should be |
| 149 |
accounted for. |
| 150 |
|
| 151 |
To create a patch, do the following: |
| 152 |
a) look at the listing of branches in |
| 153 |
http://qt.gitorious.org/+kde-developers/qt/kde-qt/commits/HEAD and |
| 154 |
select the next number. |
| 155 |
|
| 156 |
b) create a new branch out of a clean, released version of Qt, (for |
| 157 |
example, 4.5.1), using the number above and a brief description of |
| 158 |
your fix. For example: |
| 159 |
git checkout -b patches/0180-window-role v4.5.1 |
| 160 |
You can see the available released versions of Qt with: |
| 161 |
git tag |
| 162 |
|
| 163 |
c) make your changes to the Qt source code and verify that it |
| 164 |
compiles, links and works (please run the respective unit tests from |
| 165 |
tests/auto in the source tree). |
| 166 |
|
| 167 |
c) commit your changes to Git, using the "git commit" command. Please |
| 168 |
see http://qt.gitorious.org/qt/pages/GitIntroductionWithQt and |
| 169 |
http://qt.gitorious.org/qt/pages/QtCodingStyle for information on |
| 170 |
how to create commits |
| 171 |
|
| 172 |
Note that you are allowed to create as many commits as necessary to |
| 173 |
accomplish a working change that can be easily reviewed. |
| 174 |
|
| 175 |
e) merge the change to the patch branch, for example, 4.5.1-patched: |
| 176 |
git checkout 4.5.1-patched |
| 177 |
git merge patches/0180-window-role |
| 178 |
|
| 179 |
f) merge the patch branch to master: |
| 180 |
git checkout master |
| 181 |
git merge 4.5.1-patched |
| 182 |
|
| 183 |
g) push the changes you made to your branch and to the main server: |
| 184 |
git push git@gitorious.org:qt/kde-qt.git master 4.5.1-patched patches/0180-window-role |
| 185 |
(Don't forget to list all 3 branch names) |
| 186 |
|
| 187 |
Don't forget to submit your patch to using the Qt Contribution Model, |
| 188 |
along with the long description of the issue found. See |
| 189 |
http://qt.gitorious.org/qt/pages/QtContributionGuidelines for |
| 190 |
information how. You can submit the branch you've just sent to the |
| 191 |
server. |
| 192 |
|
| 193 |
9. Troubleshooting: Re-configuring and re-compiling |
| 194 |
=================================================== |
| 195 |
|
| 196 |
For those updating the source in a directory where Qt has already |
| 197 |
been compiled, you may need to run the following commands from the |
| 198 |
top directory of your Qt sources: |
| 199 |
|
| 200 |
find . -name '*.moc' | xargs rm |
| 201 |
|
| 202 |
Sometimes ./configure will refuse to run. You may need to: |
| 203 |
rm .qmake.cache |
| 204 |
rm src/corelib/global/qconfig.* |
| 205 |
|
| 206 |
If you think you may have run "make install" on an install-less Qt |
| 207 |
(srcdir == $QTDIR), run: |
| 208 |
|
| 209 |
rm -rf include |
| 210 |
bin/syncqt |
| 211 |
|
| 212 |
10. Maintenance: updating kde-qt to a newer Qt version |
| 213 |
====================================================== |
| 214 |
|
| 215 |
When a new version of Qt is released, do the following to update the |
| 216 |
repository (assuming Qt 4.6.1 is the release you're updating to): |
| 217 |
|
| 218 |
a) rebase each of the individual patches against this new version. |
| 219 |
for branch in patches/*; do |
| 220 |
git checkout -b $branch origin/$branch |
| 221 |
git rebase v4.6.1 |
| 222 |
resolve conflicts |
| 223 |
done # Note: pseudo-shell, don't try to run this |
| 224 |
|
| 225 |
If a given branch is no longer valid (it's been applied to this Qt |
| 226 |
version), then delete it on the server: |
| 227 |
git push origin :$branch |
| 228 |
|
| 229 |
b) create a new "patched" branch locally, starting on the release tag: |
| 230 |
git checkout -b 4.6.1-patched v4.6.1 |
| 231 |
|
| 232 |
c) merge the patch branches and the README branch, one by one. There |
| 233 |
should be no conflicts at this stage; if there are, it indicates |
| 234 |
one patch conflicts with another. |
| 235 |
git merge patches/0997-patch1 |
| 236 |
git merge patches/0998-patch2 |
| 237 |
git merge patches/0999-patch3 |
| 238 |
# etc. |
| 239 |
git merge README |
| 240 |
|
| 241 |
d) overwrite the master branch's contents with the new branch. If the |
| 242 |
Git merge strategy "theirs" exist (it doesn't as of Git 1.6), use |
| 243 |
it: |
| 244 |
git checkout master |
| 245 |
git merge -s theirs 4.6.1-patched |
| 246 |
|
| 247 |
If it doesn't exist, do the equivalent by inverting the point of |
| 248 |
view: |
| 249 |
git checkout -b tmp 4.6.1-patched |
| 250 |
git merge -s ours master |
| 251 |
git checkout master |
| 252 |
git merge tmp |
| 253 |
git branch -d tmp |
| 254 |
|
| 255 |
Also possible using Git plumbing: |
| 256 |
git checkout master |
| 257 |
git merge -s ours --no-commit 4.6.1-patched |
| 258 |
rm .git/index |
| 259 |
git read-tree 4.6.1-patched |
| 260 |
git commit |
| 261 |
|
| 262 |
e) push everything to kde-qt.git, including the new Qt. Note that |
| 263 |
the individiual patch branches will require force, because they |
| 264 |
have been rebased (that is, the new branch tip is no longer a |
| 265 |
direct descendant of the previous tip). |
| 266 |
|
| 267 |
# Push the individual patch branches with force |
| 268 |
git push -f origin patches/0997-patch1 patches/0998-patch2 patches/0999-patch3 etc |
| 269 |
# Push the tag, the new patched branch and master |
| 270 |
git push v4.6.1 4.6.1-patched master |