Compiling and installing LyX
============================

Original document by Pascal Andre (andre@via.ecp.fr)

There are three ways to compile and install LyX on your system. You can
either use the configure script, customize your own Imakefile from the
given Imakefile.std, or (if imake is broken for your system) customize the
given Makefile.std.

The first two are the only methods that are really supported. Use the third one
at your own risk.

Note that you need the XForms library. You can get it from

    http://bragg.phys.uwm.edu/xforms
    ftp://bloch.phys.uwm.edu/pub/xforms
    ftp://ftp.cs.ruu.nl/pub/XFORMS

Also note that the current (as of 12/21/95) Xforms library is incompatible with
the most recent libXpm (at least under linux).  It should work with libXpm-4.5
and earlier.


Creating the Makefile.
---------------------

LyX can be configured using GNU autoconf utility which attempts to
guess your configuration.  The standard way to use it is described in
the file INSTALL.autoconf. In most cases you will be able to create
the Makefile by typing

  ./configure

For more complicated cases, LyX configure takes the following specific
flags:

  o --with-two-colors=(yes/no) that forces LyX to use two colors pixmaps
    (bitmaps) instead of the full-colored standard ones. Defaults to no.

  o --with-texsty-dir=DIRECTORY that specifies the path where LyX will install 
    its style sheet (lyx.sty). Defaults to /usr/lib/texmf/tex/latex/sty.

  o --with-extra-lib=DIRECTORY that specifies the path where LyX will find
    extra libraries (Xpm, xforms) it needs. Defaults to NONE (i.e. search 
    in standard places).

  o --with-extra-inc=DIRECTORY that gives the place where LyX will find
    xforms headers. Defaults to NONE (i.e. search in standard places).

Moreover, it honors the following generic ones:

  o --prefix=DIRECTORY that specifies the root directory to use for
    installation. [defaults to where lyx has already been installed or
    /usr/local]

  o --libdir=DIRECTORY that gives the directory where all extra LyX 
    files (lyxrc, documentation, templates and layouts definitions) will be 
    installed. [defaults to ${prefix}/lib/lyx]

  o --bindir=DIRECTORY that gives the directory where the lyx binary
    will be installed. [defaults to ${prefix}/bin]

  o --mandir=DIRECTORY that gives the directory where the man pages will go.
    [defaults to ${prefix}/man]

If you do not like the default compile flags used (-g -O on gcc), you can modify manually the CXXFLAGS variable in the Makefile.

If you encounter other problems, please read the section 'Problems' at the end of this file.

Compiling and installing LyX.
-----------------------------

Once you've got the Makefile created, you just have to type:

  make
  make install

All should be OK ;)


If configure fails for some strange reason:
------------------------------------------

Just use the Imakefile.std. Copy it to Imakefile, modify it to your
own wishes and type:

  xmkmf -a
  make 
  make install
  make install.man

If imake fails for some strange reason:
------------------------------------------

Just use the Makefile.std. Copy it to Makefile, modify it to your
own wishes and type:

  make 
  make install

Stripping LyX
-------------

A LyX binary for linux is about 252k.  (That may be true for ELF, with dynamic 
Xforms library, but those with linux a.out systems and static Xforms libraries
see about 470K instead -- DLJ).  If yours is much bigger you probably 
compiled it with debug-informations (-g).  If you don't want to debug LyX just 
enter 
          strip lyx

before installing.


BTW: in the images subdirectory there is also a small icon "lyx.xpm", that 
can be used to display lyx-documents in filemanagers.

Problems
--------

According to John Collins <collins@phys.psu.edu>, you may find on SunOS
4.1.3 two sets of X libraries, and they are of course incompatible :-)
One is the set provided as part of OpenWindows, and one is the standard
X distribution (e.g., X11R5).  If you encounter problems (or if, for
some obscure reasons configure cannot find your X libraries) you can
use the following options:

 o --x-libraries=DIRECTORY that indicates where the X libraries reside.

 o --x-includes=DIRECTORY that indicate where the X include files reside.

The standard X11R5 libraries should work when the OpenWindows ones
don't.
