source: x/lib/qt.xml@ bf4f431

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since bf4f431 was bf4f431, checked in by Randy McMurchy <randy@…>, 19 years ago

Added a GCC-4 patch to the Qt instructions

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@5031 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 18.7 KB
RevLine 
[feeb99a]1<?xml version="1.0" encoding="ISO-8859-1"?>
[ff769b8c]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
[feeb99a]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
[8bfb60e]7 <!ENTITY qt-download-http "http://sunsite.rediris.es/mirror/Qt/qt/source/qt-x11-free-&qt-version;.tar.bz2">
[feeb99a]8 <!ENTITY qt-download-ftp "ftp://ftp.trolltech.com/qt/source/qt-x11-free-&qt-version;.tar.bz2">
[14db7cc]9 <!ENTITY qt-md5sum "027f4e82fbe592b39d2f160bfb3a73af">
10 <!ENTITY qt-size "13.8 MB">
[78d0e3c]11 <!ENTITY qt-buildsize "250 MB">
[14db7cc]12 <!ENTITY qt-time "15.5 SBU (full), 10.9 SBU (sub-tools)">
[feeb99a]13]>
14
[46bca118]15<sect1 id="qt" xreflabel="Qt-&qt-version;">
[f82c9c69]16 <?dbhtml filename="qt.html" ?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>Qt-&qt-version;</title>
24
25 <indexterm zone="qt">
26 <primary sortas="a-qt">Qt</primary>
27 </indexterm>
28
[4e82a189]29 <sect2 role="package">
[f82c9c69]30 <title>Introduction to Qt</title>
31
32 <para>The <application>Qt</application> package contains a
33 <application>C++</application> GUI library. This is useful for creating
34 graphical applications or executing graphical applications that are
35 dynamically linked to the <application>Qt</application> library. One of
36 the major users of <application>Qt</application> is
37 <application>KDE</application>.</para>
38
39 <bridgehead renderas="sect3">Package Information</bridgehead>
40 <itemizedlist spacing="compact">
41 <listitem>
42 <para>Download (HTTP): <ulink url="&qt-download-http;"/></para>
43 </listitem>
44 <listitem>
45 <para>Download (FTP): <ulink url="&qt-download-ftp;"/></para>
46 </listitem>
47 <listitem>
48 <para>Download MD5 sum: &qt-md5sum;</para>
49 </listitem>
50 <listitem>
51 <para>Download size: &qt-size;</para>
52 </listitem>
53 <listitem>
54 <para>Estimated disk space required: &qt-buildsize;</para>
55 </listitem>
56 <listitem>
57 <para>Estimated build time: &qt-time;</para>
58 </listitem>
59 </itemizedlist>
60
[bf4f431]61 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
62 <itemizedlist spacing="compact">
63 <listitem>
64 <para>Required patch: <ulink
65 url="&patch-root;/qt-x11-free-&qt-version;-gcc4-1.patch"/></para>
66 </listitem>
67 </itemizedlist>
68
[f82c9c69]69 <bridgehead renderas="sect3">Qt Dependencies</bridgehead>
70
71 <bridgehead renderas="sect4">Required</bridgehead>
72 <para>X (<xref linkend="xfree86"/> or <xref linkend="xorg"/>)</para>
73
74 <bridgehead renderas="sect4">Recommended</bridgehead>
75 <para><xref linkend="libjpeg"/> and <xref linkend="libmng"/></para>
76
77 <bridgehead renderas="sect4">Optional</bridgehead>
[76b19ad]78 <para><xref linkend="nas"/>,
79 <xref linkend="cups"/>,
80 <xref linkend="mysql"/>,
81 <xref linkend="postgresql"/>,
82 <xref linkend="unixodbc"/>,
83 <ulink url="http://sqlite.org/">SQLite</ulink> and
84 <ulink url="http://firebird.sourceforge.net/">Firebird</ulink></para>
[f82c9c69]85
86 </sect2>
87
88 <sect2 role="installation">
89 <title>Installation of Qt</title>
90
91 <para>There are several ways to install a complicated package such as
92 <application>Qt</application>. The files are not completely position
93 independent. Installation procedures execute the program
94 <command>pkg-config</command> to determine the location of package
95 executables, libraries, headers, and other files. For
96 <application>Qt</application>, <command>pkg-config</command> will look
97 for the file <filename>lib/pkgconfig/qt-mt.pc</filename> which must be
98 modified if relocating the package. This file is set up correctly by
99 the build process.</para>
100
101 <para>The default installation places the files in
102 <filename class='directory'>/usr/local/qt/</filename>. Many commercial
103 distributions place the files in the system's
104 <filename class='directory'>/usr</filename> hierarchy. The package can
105 also be installed in an arbitrary directory.</para>
106
107 <para>This section will demonstrate two different methods.</para>
108
109 <note>
110 <para>The build time for <application>Qt</application> is quite long. If
111 you want to save some time and don't want the tutorials and examples,
112 change the first make line to:</para>
113
114<screen><userinput>make sub-tools</userinput></screen>
115
116 </note>
117
118 <sect3>
119 <title>Method 1 - Installing in the '/usr' Hierarchy</title>
120
121 <para>The advantage of this method is that no updates to the
122 <filename>/etc/ld.so.conf</filename> or
123 <filename>/etc/man.conf</filename> files are required. The package
124 files are distributed within several subdirectories of the
125 <filename class='directory'>/usr</filename> hierarchy.
126 This is the method that most commercial distributions use.</para>
127
[033c86d]128<!--
[f82c9c69]129 <note>
[884db0e3]130 <para>The installation incorrectly uses <command>cp</command> to
131 install the files. This causes problems if the
132 <application>Qt</application> libraries are already in use (e.g.,
133 you are logged into your <application>KDE</application> desktop
134 environment). To avoid problems, <command>cp -f</command> is
135 replaced by <command>install</command> in
136 <filename>qmake.conf</filename>.</para>
[f82c9c69]137 </note>
[033c86d]138-->
139 <note>
140 <para>If <application>Qt</application> is being reinstalled, run the
141 following commands from a console or non-Qt based window manager.
142 It overwrites <application>Qt</application> libraries that should not
143 be in use during the install process.</para>
144 </note>
[f82c9c69]145
146<screen><userinput>sed -i -e 's:$(QTDIR)/include:&amp;/qt:' \
[14db7cc]147 -e 's:$(QTDIR)/lib:&amp;/qt:' \
[884db0e3]148 mkspecs/linux*/qmake.conf &amp;&amp;
[972150e7]149bash
150export PATH=$PWD/bin:$PATH &amp;&amp;
[2dae8b3]151export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &amp;&amp;
[bf4f431]152patch -Np1 -i ../qt-x11-free-&qt-version;-gcc4-1.patch &amp;&amp;
[972150e7]153./configure -prefix /usr -docdir /usr/share/doc/qt \
154 -headerdir /usr/include/qt -plugindir /usr/lib/qt/plugins \
155 -datadir /usr/share/qt -translationdir /usr/share/qt/translations \
[fac11e8]156 -sysconfdir /etc/qt -qt-gif -system-zlib -system-libmng \
157 -no-exceptions -thread -plugin-imgfmt-png \
158 -system-libjpeg -system-libpng &amp;&amp;
[972150e7]159find -type f -name Makefile | xargs sed -i "s@-Wl,-rpath,/usr/lib@@g" &amp;&amp;
[c52af0c]160make &amp;&amp;
161exit</userinput></screen>
[14db7cc]162
[f82c9c69]163 <para>Now, as the <systemitem class="username">root</systemitem>
164 user:</para>
[14db7cc]165
[f82c9c69]166<screen role="root"><userinput>make install &amp;&amp;
167ln -v -sf libqt-mt.so /usr/lib/libqt.so &amp;&amp;
168cp -v -r doc/man /usr/share &amp;&amp;
169cp -v -r examples /usr/share/doc/qt</userinput></screen>
[14db7cc]170
[f82c9c69]171 </sect3>
[972150e7]172
[f82c9c69]173 <sect3>
174 <title>Method 2 - Installing in '/opt'</title>
[972150e7]175
[f82c9c69]176 <para>This is the method recommended by the <application>Qt</application>
177 developers. It has the advantage of keeping all the package files
178 consolidated in a dedicated directory hierarchy. By using this method,
179 an update can be made without overwriting a previous installation and
[884db0e3]180 users can easily revert to a previous version by changing one symbolic
181 link.</para>
[972150e7]182
[f82c9c69]183 <para>The <application>Qt</application> developers use a default location
184 of <filename class='directory'>/usr/local/qt/</filename>, however this
185 procedure puts the files in <filename
186 class='directory'>/opt/qt-&qt-version;/</filename>
187 and then creates a symbolic link to <filename>/opt/qt/</filename>.</para>
188
189<screen><userinput>bash
[972150e7]190export QTDIR=$PWD &amp;&amp;
[2dae8b3]191export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &amp;&amp;
[972150e7]192export PATH=$PWD/bin:$PATH &amp;&amp;
[bf4f431]193patch -Np1 -i ../qt-x11-free-&qt-version;-gcc4-1.patch &amp;&amp;
[972150e7]194./configure -prefix /opt/qt-&qt-version; -qt-gif -system-libpng \
[39373956]195 -system-libmng -system-zlib -system-libjpeg -no-exceptions \
196 -thread -plugin-imgfmt-png &amp;&amp;
[033c86d]197make &amp;&amp;
198exit</userinput></screen>
[f82c9c69]199
200 <para>Now, as the <systemitem class="username">root</systemitem>
201 user:</para>
202
203<screen role="root"><userinput>make install &amp;&amp;
204ln -v -sfn qt-&qt-version; /opt/qt &amp;&amp;
205ln -v -s libqt-mt.so /opt/qt/lib/libqt.so &amp;&amp;
206cp -v -r doc/man /opt/qt/doc &amp;&amp;
207cp -v -r examples /opt/qt/doc</userinput></screen>
208
209 <note>
210 <para>If you pass the
211 <option>-plugin-sql-<replaceable>[driver]</replaceable></option>
212 switch to the <command>configure</command> command, you must also pass
213 <option>-I<replaceable>[/path/to/sql/headers]</replaceable></option>
214 so <command>make</command> can find the appropriate header files.</para>
215 </note>
[14db7cc]216
[f82c9c69]217 </sect3>
[972150e7]218
[f82c9c69]219 </sect2>
[78d0e3c]220
[f82c9c69]221 <sect2 role="commands">
222 <title>Command Explanations</title>
[972150e7]223
[f82c9c69]224 <para><command>sed -i -e ... mkspecs/linux*/qmake.conf</command>:
225 Directories in <filename>qmake.conf</filename> need to be adjusted
226 to match the BLFS Method 1 installation directories.</para>
[972150e7]227
[f82c9c69]228 <para><command>bash</command>: This command enters a sub-shell to isolate
229 environment changes.</para>
[972150e7]230
[f82c9c69]231 <para><command>export QTDIR=$PWD</command>: This command defines where
232 the root of the <application>Qt</application> directory is located.</para>
[972150e7]233
[f82c9c69]234 <para><command>export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH</command>:
235 This command allows the not yet installed <application>Qt</application>
236 libraries to be used by the not yet installed <application>Qt</application>
237 programs.</para>
[972150e7]238
[f82c9c69]239 <para><command>export PATH=$PWD/bin:$PATH</command>: This command
240 allows the build process to find supporting executables.</para>
[972150e7]241
[f82c9c69]242 <para><parameter>-qt-gif</parameter>: This switch adds support for
243 <filename>gif</filename> files to the libraries.</para>
[972150e7]244
[f82c9c69]245 <para><parameter>-system-zlib -system-libpng</parameter>: This switch
246 forces the build instructions to use the shared libraries that are on
247 your system instead of creating a custom set of support libraries for
248 these functions.</para>
[972150e7]249
[f82c9c69]250 <para><parameter>-plugin-imgfmt-png</parameter>: This switch enables
251 <application>libpng</application> to be linked to at runtime.</para>
[972150e7]252
[f82c9c69]253 <para><parameter>-no-exceptions</parameter>: This switch disables
254 the exceptions coding generated by the <application>C++</application>
255 compiler.</para>
[fac11e8]256
[f82c9c69]257 <para><parameter>-thread</parameter>: This switch adds
258 support for multi-threading.</para>
[972150e7]259
[f82c9c69]260 <para><command>find -type f -name Makefile | xargs sed -i
261 "s@-Wl,-rpath,/usr/lib@@g"</command>: This command removes hardcoded
262 run-time paths. Otherwise, <command>uic</command> always tries to run
263 with <application>Qt</application> libraries in
264 <filename>/usr/lib</filename>.</para>
[972150e7]265
[f82c9c69]266 <para><command>ln -v -s libqt-mt.so /usr/lib/libqt.so</command>: This
267 command allows <command>configure</command> scripts to find a working
268 <application>Qt</application> installation.</para>
[972150e7]269
[f82c9c69]270 <para><command>cp -v -r doc/man /usr/share (or /opt/qt/doc)</command>:
271 This command installs the man pages which are missed by
272 <command>make install</command>.</para>
[972150e7]273
[f82c9c69]274 <para><command>cp -v -r examples /usr/share/doc/qt (or
275 /opt/qt/doc)</command>: This command installs the examples which are
276 missed by <command>make install</command>.</para>
[972150e7]277
[f82c9c69]278 <para><command>exit</command>: This command returns to the parent shell
279 and eliminates environment variables set earlier.</para>
[972150e7]280
[f82c9c69]281 </sect2>
[972150e7]282
[f82c9c69]283 <sect2 role="configuration">
284 <title>Configuring Qt</title>
[78d0e3c]285
[f82c9c69]286 <sect3 id='qt-config'>
287 <title>Configuration Information</title>
[972150e7]288
[f82c9c69]289 <para>The <envar>QTDIR</envar> environment variable needs to be set when
290 building packages that depend on <application>Qt</application>. Add the
291 following to the <filename>.bash_profile</filename> initialization script
292 for each user that builds packages using the <application>Qt</application>
293 libraries. Alternatively, the variable can be set in the system wide
294 <filename>/etc/profile</filename> file.</para>
[14db7cc]295
[c52af0c]296 <para>For Method 1 (This is optional, only set this if an application is
[884db0e3]297 unable to find the installed libraries):</para>
[14db7cc]298
[f82c9c69]299<screen><literal>export QTDIR=/usr</literal></screen>
[14db7cc]300
[f82c9c69]301 <para>or for Method 2:</para>
[14db7cc]302
[f82c9c69]303<screen><literal>export QTDIR=/opt/qt</literal></screen>
[78d0e3c]304
[f82c9c69]305 <para>If you installed <application>Qt</application> using Method 2,
306 you also need to update the following configuration files so that
307 <application>Qt</application> is correctly found by other packages
308 and system processes.</para>
[78d0e3c]309
[f82c9c69]310 <para>Update the <filename>/etc/ld.so.conf</filename> and
311 <filename>/etc/man.conf</filename> files:</para>
312
313<screen role="root"><userinput>cat &gt;&gt; /etc/ld.so.conf &lt;&lt; "EOF" &amp;&amp;
314<literal># Begin qt addition to /etc/ld.so.conf
[78d0e3c]315
316/opt/qt/lib
317
[f82c9c69]318# End qt addition</literal>
[78d0e3c]319EOF
[f82c9c69]320ldconfig &amp;&amp;
[78d0e3c]321cat &gt;&gt; /etc/man.conf &lt;&lt; "EOF"
[f82c9c69]322<literal># Begin qt addition to man.conf
[78d0e3c]323
324MANPATH /opt/qt/doc/man
325
[f82c9c69]326# End qt addition to man.conf</literal>
327EOF</userinput></screen>
328
329 <indexterm zone="qt qt-config">
330 <primary sortas="e-etc-ld.so.conf">/etc/ld.so.conf</primary>
331 </indexterm>
332
333 <indexterm zone="qt qt-config">
334 <primary sortas="e-etc-man.conf">/etc/man.conf</primary>
335 </indexterm>
336
337 <indexterm zone="qt qt-config">
338 <primary sortas="e-etc-profile">/etc/profile</primary>
339 </indexterm>
340
341 <indexterm zone="qt qt-config">
342 <primary sortas="e-AA.bash_profile">~/.bash_profile</primary>
343 </indexterm>
344
345 <para>Update the <envar>PKG_CONFIG_PATH</envar> environment variable
346 in your <filename>~/.bash_profile</filename> or
347 <filename>/etc/profile</filename> with the following:</para>
348
349<screen><literal>PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/qt/lib/pkgconfig</literal></screen>
350
351 <para>If you want the <application>Qt</application> executables in your
352 shell search path, update the <envar>PATH</envar> environment variable
353 in your <filename>~/.bash_profile</filename> or
354 <filename>/etc/profile</filename> to include
355 <filename class='directory'>/opt/qt/bin</filename>.</para>
356
357 <para>As with most libraries, there is no explicit configuration to do.
358 After updating <filename>/etc/ld.so.conf</filename> as explained above,
359 run <command>/sbin/ldconfig</command> so that <command>ldd</command>
360 can find the shared libraries.</para>
361
362 </sect3>
363
364 </sect2>
365
366 <sect2 role="content">
367 <title>Contents</title>
368
369 <segmentedlist>
370 <segtitle>Installed Programs</segtitle>
371 <segtitle>Installed Libraries</segtitle>
372 <segtitle>Installed Directories</segtitle>
373
374 <seglistitem>
375 <seg>assistant, designer, linguist, lrelease, lupdate, moc,
376 qm2ts, qmake, qtconfig, and uic</seg>
377 <seg>libqt-mt.so, libqt.so libqui.so, libdesignercore.a,
378 libeditor.a, and libqassistantclient.a</seg>
379 <seg>/opt/qt-&qt-version; or /usr/lib/qt, /usr/share/qt,
380 /usr/share/doc/qt, /usr/include/qt, and /etc/qt</seg>
381 </seglistitem>
382 </segmentedlist>
383
384 <variablelist>
385 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
386 <?dbfo list-presentation="list"?>
387 <?dbhtml list-presentation="table"?>
388
389 <varlistentry id="assistant">
390 <term><command>assistant</command></term>
391 <listitem>
392 <para>is a tool for presenting on-line documentation.</para>
393 <indexterm zone="qt assistant">
394 <primary sortas="b-assistant">assistant</primary>
395 </indexterm>
396 </listitem>
397 </varlistentry>
398
399 <varlistentry id="designer">
400 <term><command>designer</command></term>
401 <listitem>
402 <para>is a full-fledged GUI builder. It includes
403 powerful features such as preview mode, automatic widget
404 layout, support for custom widgets, and an advanced
405 property editor.</para>
406 <indexterm zone="qt designer">
407 <primary sortas="b-designer">designer</primary>
408 </indexterm>
409 </listitem>
410 </varlistentry>
411
412 <varlistentry id="linguist">
413 <term><command>linguist</command></term>
414 <listitem>
415 <para>provides support for translating applications into
416 local languages. </para>
417 <indexterm zone="qt linguist">
418 <primary sortas="b-linguist">linguist</primary>
419 </indexterm>
420 </listitem>
421 </varlistentry>
422
423 <varlistentry id="lrelease">
424 <term><command>lrelease</command></term>
425 <listitem>
426 <para>is a simple command line tool. It reads a Qt project
427 file and produces message files used by the application.</para>
428 <indexterm zone="qt lrelease">
429 <primary sortas="b-lrelease">lrelease</primary>
430 </indexterm>
431 </listitem>
432 </varlistentry>
433
434 <varlistentry id="lupdate">
435 <term><command>lupdate</command></term>
436 <listitem>
437 <para>reads a Qt project file, finds the translatable
438 strings in the specified source, header and Qt Designer
439 interface files, and produces or updates the translation
440 files listed in the project file.</para>
441 <indexterm zone="qt lupdate">
442 <primary sortas="b-lupdate">lupdate</primary>
443 </indexterm>
444 </listitem>
445 </varlistentry>
446
447 <varlistentry id="moc">
448 <term><command>moc</command></term>
449 <listitem>
450 <para>generates Qt meta object support code.</para>
451 <indexterm zone="qt moc">
452 <primary sortas="b-moc">moc</primary>
453 </indexterm>
454 </listitem>
455 </varlistentry>
456
457 <varlistentry id="qm2ts">
458 <term><command>qm2ts</command></term>
459 <listitem>
460 <para>is a tool for converting Qt message file formats.</para>
461 <indexterm zone="qt qm2ts">
462 <primary sortas="b-qm2ts">qm2ts</primary>
463 </indexterm>
464 </listitem>
465 </varlistentry>
466
467 <varlistentry id="qmake">
468 <term><command>qmake</command></term>
469 <listitem>
470 <para>qmake uses information stored in project files to
471 determine what should go in the makefiles it generates.</para>
472 <indexterm zone="qt qmake">
473 <primary sortas="b-qmake">qmake</primary>
474 </indexterm>
475 </listitem>
476 </varlistentry>
477
478 <varlistentry id="qtconfig">
479 <term><command>qtconfig</command></term>
480 <listitem>
481 <para>is used to customize the appearance of Qt applications.</para>
482 <indexterm zone="qt qtconfig">
483 <primary sortas="b-qtconfig">qtconfig</primary>
484 </indexterm>
485 </listitem>
486 </varlistentry>
487
488 <varlistentry id="uic">
489 <term><command>uic</command></term>
490 <listitem>
491 <para>is a Qt user interface compiler.</para>
492 <indexterm zone="qt uic">
493 <primary sortas="b-uic">uic</primary>
494 </indexterm>
495 </listitem>
496 </varlistentry>
497
498 </variablelist>
499
500 </sect2>
501
[972150e7]502</sect1>
Note: See TracBrowser for help on using the repository browser.