





















                             INSTALLING LESSTIF
                             ==================
                             November 21, 1996



Introduction
------------

    This document details configuring, compiling, and installing lesstif on
  various platforms.

  Table of Contents:

  1.  Before lesstif (What you need to compile lesstif)
  2.  Supported platforms
  3.  Configuring lesstif
  4.  Compiling lesstif
  5.  Installing lesstif
  6.  After lesstif (Getting shared libraries working)

    If you have any corrections/additions/comments about this document,
  please email lesstif@hungry.com, and let us know.



1.  Before lesstif (What you need to compile lesstif)
----------------------------------------------------

    Lesstif is meant as a source compatible replacement/alternative to 
  Motif 1.2.  As such, it will have the same requirements as Motif 1.2.
  As far as we know, the _only_ requirement that Motif 1.2 has is that
  you have X11R5 on your system.  Lesstif will _not_ compile with R4 or
  earlier.  If you have X11R5 or above, you should be able to compile 
  and run lesstif programs.

    What this means is that all you folks out there with Sun's running
  SunOS 4.x that haven't uprgraded your X11 release to R5 -- don't
  use /usr/openwin.  That's R4 stuff, and won't work with lesstif.
  Please don't send bug reports about this, because there is no way we
  can write lesstif and remain source compatible with R4 or earlier.

    If you're going to be doing development work with lesstif, building
  the dependencies for the library files is a necessity.  You must
  have 'makedepend' to do this.  This should be standard on any machine
  with R5, but if you can't find it, get it from ftp.x.org 
  try in /pub/R6untarred).  If you don't have makedepend in your path,
  make depend' will not work.

    Lastly, you will need an ANSI-C compiler to build Lesstif.  If you
  have GNU CC, you're set.



2.  Supported platforms
----------------------

   Currently, LessTif is known to build and execute on the following platforms:

OS      Version      CPU               Compiler        X Version
----------------------------------------------------------------------------
Linux   2.0.25        Pentium           GCC-2.7.2.1     X11R6.1 (XFree86-3.2)
                      486               GCC-2.7.1       X11R5
        2.0.0         486               gcc-2.7.2       X11R6 (XFree86-312)
        2.0.18        Alpha             gcc-2.7.2       X11R6
        2.0.20        68030             gcc-2.7.2       X11R6 (Xfree86-3.2)
MkLinux 2.0.21        PowerPC           gcc-2.7.2       X11R6.1
Solaris 2.4           SPARC             GCC-2.7.2.1     X11R5
        2.5           SPARC             GCC-2.7.2       X11R5
SunOS   4.1.4         SPARC             GCC-2.7.2       X11R6.1
FreeBSD 2.1.5-RELEASE 386, 486          gcc-2.6.3       X11R6
        2.1           Intel             GCC-2.6.3       X11R6
        2.2-SNAP      Intel             GCC-2.6.3       X11R6
        2.2-961006-SNAP Pentium         GCC-2.7.2.1     X11R6.1
OpenBSD 2.0           i486              GCC-2.7.2.1     X11R6.1
        2.0           m68k (Sun3)       GCC-2.7.2.1     X11R6
NetBSD  1.2           m68k (Amiga 3000) GCC-2.7.2       X11R6.1
        1.2(B)        SPARC             GCC-2.7.2       X11R6, X11R6.1
OS/2    Warp          Pentium           GCC-2.7.2 (EMX) X11R6.1 (XFree86-3.2)
Digital UNIX 4.0      Alpha             GCC-2.7.2       X11R6
AIX     4.1.x         ?? (assume RS6K)  gcc-2.6.?       X11R5
        3.25          ?? (assume RS6K)  gcc-2.6.?/cc    X11R5
HP-UX   9.0.4         HP PA             HP cc           X11R5
------------------------------------------------------------------------------

  Notes:
   o the Linux/ALPHA build was not thoroughly tested, and generated many
     compiler warnings.
   o The AIX builds were not done recently.
   o The SunOS build was not done recently.



3.  Configuring lesstif
----------------------

    Configuration of lesstif is now handled by GNU autoconf.  [Historical
  note: at one time, there was an Imakefile package contributed by Paul Hoad;
  this package was not maintained, and has been removed.]

    To configure lesstif for your system, just type 'configure'.  This
  should do a reasonable job of locating the stuff it needs, and gives
  rather verbose output should something fail.

    Two things that configure looks for on your machine are:

     o  X11R5/R6/R6.1 headers and libaries
     o  Motif 1.2 headers and libraries (optional)

    It will tell you where it has found them if it found them.  If it
  didn't find them, you'll have to specify the path to them on the 
  command line to configure.  To specify the X stuff, use these two 
  options:

    --x-includes
    --x-libraries

  And to specify the Motif stuff, use these:

    --with-motif-includes
    --with-motif-libraries

NOTE: If you don't have Motif on your system, don't worry.  The clients and
the tests may be linked with either Lesstif or Motif -- the Motif binaries
will have a .motif extension, and can be used to verify correct Lesstif
behavior.

    To specify the location of the various bits, you have to set these
  flags equal to something.  An example on how to do this is:

   configure --x-includes=/usr/local/X11R5/include

  The other flags behave identically.  

NOTE:  If configure can't locate either X or Motif on your system you
have to specify both the include path and the library path.

    There are also other flags available on the command line.  Each of these 
  can take on either a 'yes' or 'no' value.  They are:

   --with-gcc
   --with-gmake
   --with-shared
   --with-static
   --with-textXm
   --with-testMrm

    --with-gcc tells configure whether you'll be compiling lesstif with GNU
  CC or the default system C compiler.  If you set this to no, don't use GCC,
  and if you set it to yes, don't use the system compiler.  In most cases
  it won't work.  The default for this value is yes if configure can find gcc,
  and no if you don't have gcc installed.

    --with-gmake tells configure whether you'll be using GNU make to compile
  lesstif.  If you set this field to no, then configure will generate Makefiles
  that will work with your system's make.  If the value is yes, configure will
  generate Makefiles that work with GNU Make.  Once again, if you configure for
  GNU make, you must use GNU Make.  If you configure for your system's make,
  you must use your system's make.

    There are some systems whose make takes the same syntax as GNU make (at
  least for the features we use), and so theoretically you could use their
  make with Makefiles for GNU make and vice versa, but this is not recommended.
  If you have problems in this regard, you are encouraged to submit a patch
  that works with both* your make utility, and GNU make.  If it only works with
  your make utility, don't tell us.

    The default for this variable is no.  There are some operating systems
  whose make utility does not provide enough functionality for our build
  process to complete.  On these platforms, only GNU make is supported.
  These platforms are:

   o IRIX (5.x and 6.x)
   o HPUX
   o AIX
   o DG/UX
   o OSF/1 (Digital Unix)

    With all other OS's, you have a choice.  We recommend GNU make, but use
  what you want on the machines that give you an option.


    --with-shared tells configure whether you're going to build shared
  libraries when compiling. If you're building shared libraries, then the
  tests (if you've configured them to be built: see below) will link with
  the shared libraries, reducing disk space, so it is recommended that you 
  use shared libraries if available.

    Whether or not you can create shared libraries depends on the system you're
  running, as well as the compiler (GNU CC or the system's CC) you're using.

    This table tells with what OS and compiler you can build shared libraries:

   OS              GCC             CC
   ------------------------------------
   HPPA-HP/UX 9    YES*            YES
   Linux       	   YES**           N/A
   FreeBSD     	   YES             N/A
   NetBSD      	   YES             N/A
   AIX 3           YES             YES
   IRIX 5.x/6.x    YES             YES
   DG/UX 5.x       YES             YES
   OSF/1       	   YES             YES
   Solaris 2.x     YES             YES
   SunOS 4.x       YES             YES
   SysV            YES             YES

   * GCC version 2.7.0 supports position independent code (PIC) 
     for HPPA machines.  If you're using one of these machines,
     you'll have to get 2.7.0 or better to build shared libraries.

  ** ELF shared libraries should work with any ELF capable gcc.  If
     you're using a.out, shared libraries are still possible.  Check
     out etc/README.linuxaout for more details.

    --with-static tells configure whether you're going to build static
  libraries when compiling.  If you can (and decide to) build shared
  libraries, this defaults to no.  If shared libraries aren't supported
  on your system, or if you use "--with-shared=no", static libraries will
  be built.  Also, if you just specify "--with-static=yes" on the command
  line, static libraries will be build.  

    You can specify both "--with-static=yes" and "--with-shared=yes", but you
  cannot specify both "--with-static=no" and "--with-shared=no".  If you do,
  configure will generate makefiles for building static libraries only.

    --with-testXm tells configure that you want to build the testXm library
  tests.  This can take quite a bit of time, and quite a bit of disk space
  (especially if you use --with-static), so it is disabled by default.
  However, the Makefiles in the testXm directory (and subdirectories) do get
  generated, so you can at your leisure build and execute the tests.

    --with-testMrm is identical to --with-testXm, but applies to the testMrm
  directory.



4.  Compiling lesstif
---------------------

    After configuring lesstif, just typing 'make' should build all the
  libraries, clients, and (optionally) tests for lesstif.  To build libraries
  or other things only, just cd to the directory in which you want to build
  things, and type 'make'.  Dependencies have been set up so that the libraries 
  will be recompiled if they are old (or haven't been compiled yet), so typing
  make' from within a test directory will rebuild what needs to be rebuilt.

    Some combinations of compilers and libraries may have code generation
  bugs.  For example, gcc-2.7.0 on a Solaris platform has known problems if
  the library is compiled with an optimization greater than -O (-O1).  If
  you see weird problems when you debug library code, try a lower (or no)
  optimization.  For the vast majority who compile with the default flags
  -g for GNU-C), this is not an issue.



5.  Installing lesstif
----------------------

    Installing lesstif is as easy as typing 'make install'.  Getting
  shared libraries to work on your machine after installation depends
  on your OS.

6.  After lesstif (Getting shared libraries working)
----------------------------------------------------

    Shared library configuration differs from system to system.  Here is the
  lowdown on getting them to work on the systems that support them.

    a.  Linux 

       There are two ways to have shared libraries available under linux:

         1. Use the LD_LIBRARY_PATH environment variable.
         2. Use ldconfig.

       The second option is only available to those with superuser access, so
       if you don't, or you specifically want to use the library that was just
       built (for running the tests), use the LD_LIBRARY_PATH variable.  

       The LD_LIBRARY_PATH variable is to contain a colon separated list of 
       paths to be searched for shared libraries.  This variable is consulted 
       before the information compiled by ldconfig, so even if you have lesstif 
       already installed on your system you can use this variable to force the 
       use of the newly built library.

       An example setting for LD_LIBRARY_PATH:

         $ LD_LIBRARY_PATH=/home/toshok/lesstif/libXm:/home/toshok/lesstif/libMrm
         $ export LD_LIBRARY_PATH

       If you have superuser access and want lesstif to be installed for system-
       wide use,  make sure the directory to which the libraries were installed 
       is listed in /etc/ld.so.conf.  Then (as root) type 'ldconfig -v' to make 
       them available.

       If you're not sure which library is being used (either the system-wide
       installed one, or one you've just compiled), use the 'ldd' command.  After
       generating an executable linked dynamically with lesstif, type 
       'ldd <executable-name>'.  This will output a list of the paths to all 
       the shared libraries this executable depends on.

   b.  HPUX 9

       Nothing additional needs to be done.  Just make sure the linker can
       find the libraries when generating the executable (the -L flag).

   c.  NetBSD/FreeBSD

       same as for Linux.

Send corrections or additions to this document to <lesstif@hungry.com>
