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 latest test version 0.8x of the XForms library. 
You can get it from

    http://bragg.phys.uwm.edu/xforms
    ftp://laue.phys.uwm.edu/pub/xforms/test
    ftp://ftp.cs.ruu.nl/pub/XFORMS
    ftp://ftp.via.ecp.fr/pub/xforms/test

Note that he older version 0.75 of xforms is *not* supported anymore.

Also note that the current (as of 07/05/96) Xforms library is incompatible with
some libXpm versions older than 4.7 under linux.   

If you compile LyX with gcc, you should not need to have libg++ installed on
most system. See however the note in the section `Problems'.

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-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). You can specify several directories, separated
    by spaces, by quoting the argument. 

  o --with-extra-inc=DIRECTORY that gives the place where LyX will find
    xforms headers. Defaults to NONE (i.e. search in standard places).
    You can specify several directories, separated by spaces, by quoting 
    the argument.

  o --with-debug that specifies whether you want to have debug information
    by default on standard error. Default is no. 

  o --with-sun-headers that provides prototypes to replace functions not
    correctly defined in SunOS4 header files. Its only effect is to suppress
    a few warnings. Since it is autodetected by default, you should not need
    to use this switch.
 
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. IMPORTANT: if you change something to your configuration 
because configure did not find something, remember to do `make clean' before
recompiling.

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

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

  make all
  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, check the contents of config.h 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, check the contents of config.h 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
--------

  o If you have problems indicating that configure cannot find a part of
    the xforms or Xpm library, use the --with-extra-lib and --with-extra-inc 
    options of configure.

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

  o On some systems, the library libstdc++ (part of the libg++ package)
    could be necessary when you compile with g++. This is because it contains
    definition of functions lacking from some system (e.g. strerror on
    SunOS 4.x). If you encounter this problem, please send a report to
    lyx@via.ecp.fr.
