source: x/lib/qt.xml@ e55ba64

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 6.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 v5_1 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since e55ba64 was e55ba64, checked in by Bruce Dubbs <bdubbs@…>, 20 years ago

Grammar

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

  • Property mode set to 100644
File size: 9.6 KB
RevLine 
[46bca118]1<sect1 id="qt" xreflabel="Qt-&qt-version;">
[19aa75a]2<?dbhtml filename="qt.html" ?>
[46bca118]3<title>Qt-&qt-version;</title>
[f45b1953]4
[972150e7]5<sect2>
6<title>Introduction to <application>Qt</application></title>
[f45b1953]7
[972150e7]8<para>The <application>Qt</application> package contains a
9<application>C++</application> <acronym>GUI</acronym> library. This is useful
10for creating graphical applications or executing graphical applications that
11are dynamically linked to the <application>Qt</application> library. One of the
12major users of <application>Qt</application> is <application>KDE</application>.</para>
13
14<sect3><title>Package information</title>
15<itemizedlist spacing='compact'>
16<listitem><para>Download (HTTP): <ulink url="&qt-download-http;"/></para></listitem>
17<listitem><para>Download (FTP): <ulink url="&qt-download-ftp;"/></para></listitem>
18<listitem><para>MD5 Sum: &qt-md5sum;</para></listitem>
19<listitem><para>Download size: &qt-size;</para></listitem>
20<listitem><para>Estimated Disk space required: &qt-buildsize;</para></listitem>
21<listitem><para>Estimated build time: &qt-time;</para></listitem></itemizedlist>
22</sect3>
23
24<sect3><title><application>Qt</application> dependencies</title>
25<sect4><title>Required</title>
26<para><xref linkend="x-installing"/></para>
27</sect4>
28<sect4><title>Recommended</title>
29<para><xref linkend="libjpeg"/> and <xref linkend="libmng"/>.</para>
30</sect4>
31
32<sect4><title>Optional</title>
33<para><xref linkend="nas"/>, <xref linkend="cups"/>, <xref linkend="mysql"/>,
34<xref linkend="postgresql"/>, <ulink url="http://firebird.sourceforge.net/">Firebird</ulink>,
35and <ulink url="http://www.unixodbc.org/">unixODBC</ulink>.</para>
36</sect4>
37</sect3>
38</sect2>
39
40<sect2>
41<title>Installation of <application>Qt</application></title>
42
43<para>There are several ways to install a complicated package such as <application>Qt</application>.
44The files are not completely position independent. Installation procedures execute the
45program <filename>pkg-config</filename> to determine the location of package executables, libraries,
46headers, and other files. For <application>Qt</application>, <filename>pkg-config</filename> will
47look for the file <filename>lib/pkgconfig/qt-mt.pc</filename> which must be modified if relocating the
48package. This file is set up correctly by the build process.</para>
49
50<para>The default installation places the files in <filename class='directory'>/usr/local/qt/</filename>.
51Many commercial distributions place the files in the system's
52<filename class='directory'>/usr</filename> hierarchy. The package can also be installed
53in an arbitrary directory.</para>
54
55<para>This section will demonstrate two different methods.</para>
56
57
58<note><para>The build time for <application>Qt</application> is quite long. If you want to
59save some time and don't want the tutorials and examples, change the first make line to:</para>
60
61<para><userinput><command>make sub-tools</command></userinput></para>
62</note>
63
64<sect3>
65<title>Method 1 - Installing in the <filename class='directory'>/usr</filename> hierarchy</title>
66
67<para>The advantage of this method is that no updates to the <filename>/etc/ld.so.conf</filename>
68or <filename>/etc/man.conf</filename> files are required. The package files
69are distributed within several subdirectories of the <filename class='directory'>/usr</filename>
70hierarchy. This is the method that most commercial distributions use.</para>
71
72
73<screen><userinput><command>sed -i "s:cp -f:install:" mkspecs/linux-g++/qmake.conf &amp;&amp;
74bash
75export PATH=$PWD/bin:$PATH &amp;&amp;
[2dae8b3]76export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &amp;&amp;
[972150e7]77./configure -prefix /usr -docdir /usr/share/doc/qt \
78 -headerdir /usr/include/qt -plugindir /usr/lib/qt/plugins \
79 -datadir /usr/share/qt -translationdir /usr/share/qt/translations \
80 -sysconfdir /etc/qt -qt-gif -system-zlib \
81 -no-exceptions -thread -plugin-imgfmt-png -system-libpng &amp;&amp;
82find -type f -name Makefile | xargs sed -i "s@-Wl,-rpath,/usr/lib@@g" &amp;&amp;
[2657b9c]83make &amp;&amp;
[972150e7]84make install &amp;&amp;
85ln -sf libqt-mt.so /usr/lib/libqt.so &amp;&amp;
86cp -r doc/man /usr/share &amp;&amp;
87cp -r examples /usr/share/doc/qt &amp;&amp;
88exit</command></userinput></screen>
89
90</sect3>
91
92<sect3>
93<title>Method 2 - Installing in <filename class='directory'>/opt</filename></title>
94
95<para>This is the method recommended by the <application>Qt</application> developers. It
96has the advantage of keeping all the package files consolidated in a dedicated directory
97hierarchy. By using this method, an update can be made without overwriting a previous
[e55ba64]98installation and users can easily revert to a previous version by changing one symbolic
[972150e7]99link.</para>
100
101<para>The <application>Qt</application> developers use a default location of
102<filename class='directory'>/usr/local/qt/</filename>, however this procedure puts the files
103in <filename class='directory'>/opt/qt-&qt-version;/</filename> and then creates a
104symbolic link to <filename>/opt/qt/</filename>.</para>
105
106
107<screen><userinput><command>bash
108export QTDIR=$PWD &amp;&amp;
[2dae8b3]109export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &amp;&amp;
[972150e7]110export PATH=$PWD/bin:$PATH &amp;&amp;
111./configure -prefix /opt/qt-&qt-version; -qt-gif -system-libpng \
112&nbsp;&nbsp;&nbsp;-system-libmng -system-zlib -system-libjpeg -no-exceptions \
113&nbsp;&nbsp;&nbsp;-thread -plugin-imgfmt-png &amp;&amp;
114make &amp;&amp;
115make install &amp;&amp;
116ln -sfn qt-&qt-version; /opt/qt &amp;&amp;
117ln -s libqt-mt.so /opt/qt/lib/libqt.so &amp;&amp;
118cp -r doc/man /opt/qt/doc &amp;&amp;
119cp -r examples /opt/qt/doc
120exit</command></userinput></screen>
121
122<sect4>
123<title>Configuration</title>
124
125<para>For Method 2 only, update the <filename>/etc/ld.so.conf</filename> and
126<filename>/etc/man.conf</filename> files.</para>
127
128
129<screen><userinput><command>cat &gt;&gt; /etc/ld.so.conf &lt;&lt; "EOF"
130# Begin qt addition to /etc/ld.so.conf
131
132/opt/qt/lib
133
134# End qt addition
135EOF
136ldconfig
137
138cat &gt;&gt; /etc/man.conf &lt;&lt; "EOF"
139# Begin qt addition to man.conf
[f45b1953]140
[972150e7]141MANPATH /opt/qt/doc/man
142
143# End qt addition to man.conf
144EOF</command></userinput></screen>
[2dae8b3]145
[fdb8f2c9]146<para>Also, the <envar>QTDIR</envar> environment variable needs to be set when
147building packages that depend on Qt. Add the following to the
148<filename>.bash_profile</filename> initialization script for each user that
149builds packages using the <application>Qt</application> libraries.
150Alternatively, the variable can be set in the system wide
151<filename>/etc/profile</filename> file.</para>
[2dae8b3]152
153<screen><userinput>export QTDIR=/opt/qt</userinput></screen>
154
[972150e7]155</sect4>
156</sect3>
157</sect2>
158
159<sect2>
160<title>Command explanations</title>
161
162<para><command>sed -i "s:cp -f:install:" mkspecs/linux-g++/qmake.conf</command>:
163<command>install</command> is safer than <command>cp</command> when
164libraries are in use.</para>
165
166<para><command>bash</command>: This command enters a sub-shell to isolate
167environment changes.</para>
168
169<para><command>export QTDIR=$PWD</command>: This command
170defines where the root of the Qt directory is located.</para>
171
[2dae8b3]172<para><command>export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH</command>: This command
173allows the not yet installed qt libraries to be used by the not yet installed qt programs.</para>
[972150e7]174
175<para><command>export PATH=$PWD/bin:$PATH</command>: This command
176allows the build process to find supporting executables.</para>
177
178<para><parameter>-qt-gif</parameter>: This switch adds support for gif
179files to the libraries.</para>
180
181<para><parameter>-system-zlib -system-libpng</parameter>: This switch
[fdb8f2c9]182forces the build instructions to use the shared libraries that are on your system
183instead of creating a custom set of support libraries for these
[972150e7]184functions.</para>
185
186<para><parameter>-no-exceptions</parameter>: This switch disables
187the exceptions coding generated by the <application>C++</application> compiler.</para>
188
189<para><parameter>-thread</parameter>: This switch adds
190support for multi-threading.</para>
191
[fdb8f2c9]192<para><command>find -type f -name Makefile | xargs sed -i
193"s@-Wl,-rpath,/usr/lib@@g"</command>: This command removes hardcoded run-time
194paths. Otherwise, <command>uic</command> always tries to run with Qt libraries
195in <filename>/usr/lib</filename>.</para>
[972150e7]196
197<para><command>ln -s libqt-mt.so /usr/lib/libqt.so</command>: This
198command allows configure scripts
199to find a working <application>Qt</application> installation.</para>
200
201<para><command>cp -r doc/man /usr/share (or /opt/qt/doc)</command>: This command
202installs the man pages which are missed by <command>make install</command>.</para>
203
204<para><command>cp -r examples /usr/share/doc/qt (or /opt/qt/doc)</command>: This command
205installs the examples which are missed by <command>make install</command>.</para>
206
207<para><command>exit</command>: This command returns to the parent shell
208and eliminates environment variables set earlier.</para>
209
210</sect2>
211<sect2>
212<title>Configuring <application>Qt</application></title>
213
214<sect3><title>Configuration Information</title>
215
[fdb8f2c9]216<para>As with most libraries, there is no explicit configuration to do. After
217updating <filename>/etc/ld.so.conf</filename> as explained above, run
218<command>/sbin/ldconfig</command> so that <command>ldd</command> can find the
219shared libraries.</para>
[972150e7]220
221</sect3>
222
223</sect2>
224<sect2>
225<title>Contents</title>
226
227<para>The <application>Qt</application>/<application>X11</application>
[dcd8072]228library contains <acronym>API</acronym>s necessary to use
229programs based on the Qt <acronym>GUI</acronym> toolkit.</para>
[972150e7]230
231<para>The <application>Qt</application> package contains
232<command>assistant</command>,
233<command>designer</command>,
234<command>linguist</command>,
235<command>lrelease</command>,
236<command>lupdate</command>,
237<command>moc</command>,
238<command>qm2ts</command>,
239<command>qmake</command>,
240<command>qtconfig</command>,
241<command>uic</command>, and the
242<filename class="libraryfile">libqt-mt</filename> and
243<filename class="libraryfile">libqui</filename> libraries.</para>
244
245</sect2>
246</sect1>
Note: See TracBrowser for help on using the repository browser.