-*-text-*-

This file contains:

- Installation instructions and notes for the Midnight Commander
- Where to get more information on the Midnight Commander
- Common problems
- Information on porting the program
- Obtaining the missing pieces of the Midnight Commander


Installation instructions for the Midnight Commander
----------------------------------------------------

   The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation, and creates
the Makefile.  It also creates a file `config.status' that you can run
in the future to recreate the current configuration.

To compile this package:

1.  Configure the package for your system.

   Normally, you just `cd' to the directory containing the package's
source code and type `./configure'.  If you're using `csh' on an old
version of System V, you might need to type `sh configure' instead to
prevent `csh' from trying to execute `configure' itself (under AIX,
you may need to use ksh instead of sh).

   Running `configure' takes a while.  While it is running, it
prints some messages that tell what it is doing.  If you don't want to
see any messages, run `configure' with its standard output redirected
to `/dev/null'; for example, `./configure >/dev/null'.

   To compile the package in a different directory from the one
containing the source code, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'.  `cd' to the
directory where you want the object files and executables to go and run
the `configure' script.  `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.  If
for some reason `configure' is not in the source code directory that
you are configuring, then it will report that it can't find the source
code.  In that case, run `configure' with the option `--srcdir=DIR',
where DIR is the directory that contains the source code.

   By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc.  You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.  Alternately, you can do so by consistently
giving a value for the `prefix' variable when you run `make', e.g.,
     make prefix=/usr/gnu
     make prefix=/usr/gnu install

   You can specify separate installation prefixes for
architecture-specific files and architecture-independent files.  If
you give `configure' the option `--exec-prefix=PATH' or set the `make'
variable `exec_prefix' to PATH, the package will use PATH as the
prefix for installing programs and libraries.  Data files and
documentation will still use the regular prefix.  Normally, all files
are installed using the same prefix.

    The program detects if you have the gpm library installed.  If you
installed the gpm mouse library in a non-standard place, you will need
to use the --with-gpm-mouse flag with the directory base where you
installed the gpm package.

   `configure' also recognizes the following options:

`--help'
     Print a summary of the options to `configure', and exit.

`--quiet'
`--silent'
     Do not print messages saying which checks are being made.

`--verbose'
     Print the results of the checks.

`--version'
     Print the version of Autoconf used to generate the `configure'
     script, and exit.

`--with-gpm-mouse=PATH'
     Use this flag if your GPM mouse package is not installed in
     a standard place.  The configure will append `lib' and
     `include' to find the libgpm.a and gpm.h files respectively.

`--with-mmap'
     Needed when compiling under AIX if you want the fast viewer.

`--with-subshell[=optional]', `--without-subshell' 
     The subshell support is by default turned on, you can disable
     this by using the --without-subshell option.  If you pass the
     =optional parameter, then the subshell support is turned off by
     default, to turn it on, you have to specify the `-U' flag when
     running the program.

`--with-termnet'
     Enables the network support with the Term package.

`--without-vfs'
     This option disables the Virtual File System switch code in the
     Midnight Commander and uses the standard file system calls for
     file access.  If you specify this option you will not get the
     transparent tar File system manipulation as well nor the
     networked Midnight Commander file system.

`--with-xview'                 [WARNING: X code is not released]
     This option enables including the XView version.

`--with-xview-includes=DIR'    [WARNING: X code is not released]
     Lets you specify the place where you have your xview headers installed.
     It should be the directory, which has subdirectories xview and
     hopefuly xview_private.

`--with-xview-libraries=DIR'   [WARNING: X code is not released]
     Lets you specify the place where you have your xview libraries - 
     libolgx and libxview.

`--with-xv-bindir=DIR'         [WARNING: X code is not released]
     Lets you specify the place where program mxc will be installed.
     Default is somewhere in your XView binaries directory,
     $OPENWINHOME/bin.

`--with-tk'                    [WARNING: X code is not released]
     This option enables including the Tcl/Tk version.

`--with-tk-includes=DIR'       [WARNING: X code is not released]
     Lets you specify the place where you have your Tcl/Tk headers installed.
     It should be a directory containing tcl.h and tk.h.

`--with-tk-libraries=DIR'      [WARNING: X code is not released]
     Lets you specify the place where you have your Tcl/Tk libraries - 
     libtcl and libtk.

`--without-dusum'
     This option disables a feature of the Midnight Commander, which is
     forking the du command with the -s option when you want to calculate
     directory sizes.

`--with-sco'
     This option is used to compile on SCO: it disables the terminal
     resizing mechanism and uses the BSD-like pseudoterminal handling.

You may also tell configure which display manager you want to use with
the Midnight Commander.  The configure script will use SLang as default,
but you can override this by using any of the following flags (please 
note that slang is included as part of the distribution),

`--with-slang' (default)
     This is used to configure the program to use the SLang screen
     manager.  This is included as part of the Midnight Commander,
     you don't need it installed on your system.
     Slang is the only library that will let you resize the Midnight
     Commander window on an xterm.

     This option will usually try to use the terminfo database if it
     is available, otherwise it will use the termcap database.  At
     compile time, you may force the use the terminal database with
     the `--with-termcap' and `--with-terminfo' options.

`--with-ncurses[=directory]'
     Use this flag (either with or without the =directory part), if
     you want to compile with ncurses instead of the default SLang.

     Use the =directory part if your ncurses is not installed in any of the
     places configure will check (/usr/include, /usr/include/ncurses,
     /usr/local/include and /usr/local/include/ncurses).
     The argument to this flag is the base directory where the ncurses
     files are located.  The configure will append lib and include to
     find the libncurses.a and ncurses.h file respectively.  For
     example, if you have installed ncurses under /gnu/lib and
     /gnu/include, you specify: --with-ncurses=/gnu

     You will need the ncurses package only if your system does not
     provide a compatible curses.  If after compiling, the program
     says that it can't resolve the has_colors function, then you need
     the ncurses package or you may always go back to the included SLang
     screen manager.

`--with-vcurses[=directory]'
     Use this flag to force the Midnight Commander to use a SystemV
     type ncurses, the optional directory specifies where should
     the C compiler find the include files.

`--with-sunos-curses'
     You use this flag on SunOS machines if you want to use SunOS 4.x
     curses instead of ncurses.  You don't need this flag if you don't
     have ncurses installed: it's only needed to force the usage of
     SunOS curses over ncurses.

   `configure' also accepts and ignores some other options.

   On systems that require unusual options for compilation or linking
that the package's `configure' script does not know about, you can give
`configure' initial values for variables by setting them in the
environment.  In Bourne-compatible shells, you can do that on the
command line like this:

     CC='gcc -traditional' LIBS=-lposix ./configure

On systems that have the `env' program, you can do it like this:

     env CC='gcc -traditional' LIBS=-lposix ./configure

   Here are the `make' variables that you might want to override with
environment variables when running `configure'.

   For these variables, any value given in the environment overrides the
value that `configure' would choose:

 - Variable: CC
     C compiler program.  The default is `cc'.

 - Variable: CFLAGS
     The default flags used to build the program.

 - Variable: INSTALL
     Program to use to install files.  The default is `install' if you
     have it, `cp' otherwise.

   For these variables, any value given in the environment is added to
the value that `configure' chooses:

 - Variable: LIBS
     Libraries to link with, in the form `-lfoo -lbar...'.

   If you need to do unusual things to compile the package, we encourage
you to figure out how `configure' could check whether to do them, and
mail diffs or instructions to the address given in the README so we
can include them in the next release.

2.  Type `make' to compile the package.

3.  If the package comes with self-tests and you want to run them,
type `make check'.  If you're not sure whether there are any, try it;
if `make' responds with something like
	make: *** No way to make target `check'.  Stop.
then the package does not come with self-tests.

4.  Type `make install' to install programs, data files, and
documentation.
If your system is Linux, then install installs the Linux console screen
saver as well.

5.  You can remove the program binaries and object files from the
source directory by typing `make clean'.  To also remove the
Makefile(s), the header file containing system-dependent definitions
(if the package uses one), and `config.status' (all the files that
`configure' created), type `make realclean'. If you want to clean the source
tree completely, so that it contains only those files that should be
packaged in the archive, issue `make distclean'. If you've run configure in
a different directory than the source tree, distclean won't remove your *.o
and linked programs in that directory.

6.  The Midnight Commander allows you to be kept on the directory you
were when you quit the program, this is done with a shell function,
the man page has more information about this.  If you want to let the
install program make the change to your /etc/profile or your
~/.profile or ~/.bashrc, then type: `make mcfninstall'.

   The file `configure.in' is used to create `configure' by a program
called `autoconf'.  You only need it if you want to regenerate
`configure' using a newer version of `autoconf'.


- Where to get more information on the Midnight Commander
---------------------------------------------------------

Janne Kukonlehto set up a WWW page, here is the URL:
http://stekt.oulu.fi/~jtklehto/mc/

We also a set of mailing lists for the program:

mc-announce: Announcements of new version of the Midnight Commander.
mc-digest:   Digest version of the mc list.
mc-patches:  Patches by mail (also on the ftp site).
mc:          Discussion on the Midnight Commander file manager.
mc-devel:    For discussion between the developers of the program.

to subscribe to the mailing lists, send a message to:

majordomo@roxanne.nuclecu.unam.mx

with the following text in the body of the message:

subscribe <list-name> [address]

The address is optional and list-name is one of the above list names
(mc, mc-announce, mc-patches or mc-digest).


Notes about the Midnight Commander installation
------------------------------------------------

The Midnight Commander has been run in the following configurations:

i386-linux-linux1.0
i386-linux-linux1.1
i386-linux-linux1.2
i386-linux-linux1.3
mips-dec-ultrix4.3
mips-dec-netbsd1.0
mips-sgi-irix5.2
mips-sgi-irix5.3
rs6000-ibm-aix3.2.5
sparc-sun-sunos4.1
sparc-sun-netbsd1.0
sparc-sun-solaris2.3
hppa-hp-hpux9
hppa-hp-hpux7
m68k-apple-aux
mc88110-aviion-dgux5.4


Since the Midnight Commander is configured via the GNU autoconf
program, it's not difficult to run it in other operating systems.

If you're using AIX, with the cc6000 compiler, you have to specify the
`--with-mmap' command line option. 

You will need GNU C (or an ANSI C Compiler) and optionally a color
curses library (ncurses is a good choice).  The Midnight Commander now
comes with the Slang screen manager, a fast screen manager, so ncurses
is not required anymore unless you want to use it.  

Many Linux systems ship with ncurses version 1.8.0 or 1.8.1; the
Midnight Commander may run with it, but some bugs in this version of
NCurses sometimes make the display look strange (which is not the
intention).  

VERY IMPORTANT NCURSES NOTE: On some architectures, the default
compilation mode for ncurses it to include the buggy OPT_MVCUR in the
Makefile.  If that is the case, please remove it before compiling.

Since version 0.9 the Midnight Commander comes with mouse support on
xterms and in the Linux console. In order to take advantage of the
mouse support on the Linux console you will need the gpm mouse server
(see the section "Obtaining the Missing Pieces" in this file).

Once you get the Mouse Server, compile it and install it, then you
will have to specify the `--with-gpm-mouse' flag to the configure
program if you installed it in a non-standard directory.  If you
installed the gpm package under /usr or /usr/local, you don't need to
specify this flag; configure will find gpm for you.  The support for
mice on xterms is always compiled in.

We are working on further enhancements to the program, but we're not
sure which ones must go first.  If you would like to point us in the
Right Direction we will be glad to hear from you (you could check the
file TODO included with this distribution for the current projects).

If you happen to find an undocumented feature that doesn't do what you
expected, please drop us a note telling us as much as you can about
the problem you're experiencing (to miguel@roxanne.nuclecu.unam.mx).


Porting the program
-------------------

Random notes on porting to other architectures.  

The program requires normally ncurses.  If you don't want to install
ncurses and your OS is a SystemV Release 4 variant, maybe the curses
supplied with your system will do the work.  If you experience display
problems, then it means that we are dealing with a buggy
implementation of curses.  You have two options: one, download ncurses
and recompile with ncurses or recompile all your source code with the
symbol BUGGY_CURSES defined.  
But you can always switch to the default SLang screen manager.

The fast way to do this is to:

make clean; make XINC=-DBUGGY_CURSES

The correct thing is that you add a detection case to the file
ncurses.h (provided with this program) and again, run: make clean;
make;

If you add the detection case, please, send me a patch, so that I
could include it in future versions of the program.


Obtaining the missing pieces of the Midnight Commander
------------------------------------------------------

The Midnight Commander will build without requiring you to get any
other software packages, however, you may be interested in enhancing
the Midnight Commander environment with some of these:

o Terminal database
 
  There are many incomplete terminal databases out there, you can get
  the official termcap and terminfo database from the following URL:

  http://www.ccil.org/~esr/ncurses.html

  Some terminfo data are included with the mc distribution (lib/*.ti).
  Particularly linux, xterm and vt100. Use e.g. ''tic linux.ti'' to
  use them.

  If you want to run mc on xterm/color_xterm/ansi_xterm (not rxvt), then
  you might read lib/README.xterm for further information.

o In the past the Midnight Commander required the NCurses library to
  build, now it's optional and it's not the recommended way of using
  it, but in case you feel nostalgic, you can get the NCurses library 
  from:

  ftp.nuclecu.unam.mx:/Midnight
  ftp.netcom.com:/pub/zm/zmbenhal

  When compiling ncurses, please check that you don't define
  OPT_MVCUR since it's buggy.

o The GPM Mouse Server is available at:

  iride.unipv.it:/pub/gpm

o The X Windows System libraries are only used if you are going to
  build the X11 versions of the program.  Please note that this code
  is not finished, so it's only useful if you want to look at what we
  are doing or want to help in one of the two X11 versions.
  
o The XView library can be obtained from (currently the newest is
  XView3.2p1-X11R6.tar.gz):

  ftp.nuclecu.unam.mx:/Midnight/devel/XView.libs
  ftp.x.org:/contrib/libraries
  ftp.cvut.cz:/pub/x11/contrib/libraries

  - Linux/ELF shared binaries:

      sunsite.unc.edu:/pub/Linux/libs/X/xview
      ftp.cvut.cz:/pub/linux/sunsite/libs/X/xview

o The Tcl/Tk libraries can be obtained from:

  ftp.smli.com:/pub/tcl
  ftp.aud.alcatel.com:/tcl/ftp.smli.com
  ftp.cvut.cz:/pub/tcl/ftp.smli.com

  - Linux/ELF shared binaries:

      ftp.ods.com:/pub/linux
      ftp.cvut.cz:/pub/linux/ods

o The Xpm library (used by the XView version) can be obtained from
  (currently xpm-3.4f.tar.gz):

  koala.inria.fr:/pub/xpm
  ftp.x.org:/contrib/libraries
  ftp.cvut.cz:/pub/x11/contrib/libraries

  - Linux/ELF shared binaries:

      ftp.ctd.comsat.com:/pub/linux/ELF
      ftp.cvut.cz:/pub/linux/comsat

To get the mouse support working on the Linux console:

If you're using Linux version >= 1.1.34, then you will have to choose yes
to selection when you compile your kernel. If your Linux version is
older than this one, you may try to apply one of the patches included in
the gpm package.

And the GNU C Compiler may be obtained from the following sites:

        ASIA: ftp.cs.titech.ac.jp, utsun.s.u-tokyo.ac.jp:/ftpsync/prep,
              cair.kaist.ac.kr:/pub/gnu
        AUSTRALIA: archie.au:/gnu (archie.oz or archie.oz.au for ACSnet)
        AFRICA: ftp.sun.ac.za:/pub/gnu
        MIDDLE-EAST: ftp.technion.ac.il:/pub/unsupported/gnu
        EUROPE: ftp.cvut.cz:/pub/gnu, irisa.irisa.fr:/pub/gnu, 
              ftp.univ-lyon1.fr:pub/gnu, ftp.mcc.ac.uk, 
              unix.hensa.ac.uk:/pub/uunet/systems/gnu,
              src.doc.ic.ac.uk:/gnu, ftp.win.tue.nl, ugle.unit.no, 
              ftp.denet.dk, ftp.informatik.rwth-aachen.de:/pub/gnu, 
              ftp.informatik.tu-muenchen.de, ftp.eunet.ch, 
              nic.switch.ch:/mirror/gnu, nic.funet.fi:/pub/gnu, isy.liu.se, 
              ftp.stacken.kth.se, ftp.luth.se:/pub/unix/gnu, archive.eu.net
        CANADA: ftp.cs.ubc.ca:/mirror2/gnu
        USA: wuarchive.wustl.edu:/mirrors/gnu, labrea.stanford.edu,
             ftp.kpc.com:/pub/mirror/gnu, ftp.cs.widener.edu, uxc.cso.uiuc.edu,
             col.hp.com:/mirrors/gnu, ftp.cs.columbia.edu:/archives/gnu/prep,
             gatekeeper.dec.com:/pub/GNU, ftp.uu.net:/systems/gnu


Unsupported options to configure:
---------------------------------
`--with-bsd-curses'
     If you don't want to use ncurses and are using an Ultrix box, you
     can use this switch.  Be aware that ncurses is a better option
     than the curses included in Ultrix.

