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

Table of Contents:

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

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

--------------------------------------------------

0.  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 folk out there with Sun's -- 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.

1.  Configuring lesstif

  Configuration of lesstif is now handled by GNU autoconf.  There
exists an Imakefile package contributed by Paul Hoad, but this is not
supported by the core team at this time.

  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 headers and libaries
   o  Motif 1.2 headers and libraries

  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

  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-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, 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 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.

2.  Compiling lesstif

  After configuring lesstif, just typing 'make' should build all the
libraries, tests, and clients 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.

3.  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.

4.  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.

