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