<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE note PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [    
   <!ENTITY % general-entities SYSTEM "../general.ent">
   %general-entities;
]>

<!-- $LastChangedBy: $
     $Date: $ -->

<sect2>
    <title>Qt Installation Alternatives</title>

    <para>The installation of <application>Qt</application> presents 
    several challenges and choices. Complicating the Qt installation is the fact
    that there are two versions,  <application>Qt4</application> and 
    <application>Qt5</application>, that have executable programs with
    identical names.  If both packages are installed on one system,
    the only methods to manage which set of programs is used is to
    either control the users' <envar>PATH</envar> or to rename files
    either directly or via symbolic links.  Both packages cannot
    be installed in the same directory.
    </para>

    <para>If you are only going to install one of the Qt versions, 
    the choice of installation methods is easier.  You can either 
    install the components in the several directories of the <filename
    class='directory'>/usr</filename> hierarchy or install the 
    entire package in a separate directory of your choice.  We
    refer to these options below as "Method 1: Installing in /usr" 
    and "Method 2: Installing in /opt".</para>

    <para>If both versions of Qt are to be installed, one or both versions need
    to be installed in a separate directory.  For the purposes here we use the
    <filename class='directory'>/opt</filename> directory.  The selection of
    which version is being used by individual users on a system is controlled
    by the <envar>PATH</envar> variable.  Other systems can be designed, but
    the BLFS editors find the <envar>PATH</envar> method easiest.</para>

    <para> The advantage of installing in <filename
    class='directory'>/usr</filename> is that no updates to the
    <filename>/etc/ld.so.conf</filename> or
    <filename>/etc/man_db.conf</filename> files are required. The package files
    are distributed within several subdirectories of the <filename
    class='directory'>/usr</filename> hierarchy.  This is the method that most
    commercial distributions use.  The disadvantage for BLFS users is that this
    Qt instance cannot be upgraded while it is in use.  For instance, it cannot
    be upgraded from a running KDE environment.  It also precludes having
    multiple versions of Qt on your system and does not allow reverting to 
    an existing, known working instance of Qt.</para>

    <para> The advantage of installing <application>Qt</application> in a
    custom directory such as 
    <filename class='directory'>/opt/qt-&qt4-version;</filename> or 
    <filename class='directory'>/opt/qt-&qt5-version;</filename> or 
    is that it keeps all the
    package files consolidated in a dedicated directory hierarchy. By using
    this method, an update can be made without overwriting a previous
    installation and users can easily revert to a previous version by changing
    one symbolic link or merely changing the PATH variable.  It also allows a
    developer to maintain multiple versions of <application>Qt4</application>
    or <application>Qt5</application> for testing.  </para>

</sect2>
