PREREQUISITES

- an ANSI C compiler (gcc will certainly do) 
- libreadline (4.2 or later) - the real thing, not the fake one
  that OS X installs
- any one of: termcap, curses, ncurses, tinfow, or tinfo
- libptytty (unless you configure  --without-libptytty)
- perl or python (but only if you want to use filters)

rlwrap should compile on most unices and unix-like environments like
linux, the BSDs, OS/X, solaris, HP/UX, QNX, AIX and cygwin (special
thanks go to PolarHome for their "dinosaur zoo" of ageing Unix systems!)


INSTALLATION

First, unzip the tarball or clone the git repository (git clone
https://github.com/hanslub42/rlwrap.git). Then go to the rlwrap
directory, and:

autoreconf --install # only needed if there is no ./configure script

then:

./configure
make
sudo make install


CONFIGURATION OPTIONS

configure can be called with a number of options (e.g. if you want to
install rlwrap in a non-standard place). Do

./configure --help

to see them all. Most of them are not specific to rlwrap, except the
following:

--with-libptytty (default: YES) Use libptytty instead of rlwrap's own
  crusty (but still functional) pty handling. 
  
--enable-spy-on-readline (default: YES) If we want to keep the display
  tidy when re-sizing the terminal window or printing multi-line
  prompts, we have to know whether or not readline is in
  horizontal-scroll-mode (i.e. wheter long lines are scrolled or
  wrapped). At present, this involves a look at a private readline
  variable - if you feel guilty about that, disable this option.

--enable-homegrown-redisplay (default: NO): some people report ddouble
  echoing of user input. Enabling this option will cure the problem -
  though the display will then flicker over slow connections
  (cf. BUGS)

--enable-debug: (default: NO) Adds a --debug option to rlwrap's
  repertoire. This will make rlwrap write debug information to a file
  /tmp/rlwrap.debug (cf. the output of rlwrap --help for more info)

--enable-proc-mountpoint (default: /proc) mountpoint for Linux-style
  procfs, used for determination of slave command's working directory.

--enable-multibyte-aware (default: YES) Prevent rlwrap from seeing
  multibyte characters as multiple  characters. 


UNINSTALLATION

To uninstall, do 'make uninstall'

INSTALLING AS NON-ROOT

If you want to install rlwrap as non-root, you should call configure with
the --prefix option, like:

./configure --prefix=$HOME

after which 'make install' will install rlwrap in $HOME/bin

You may have to install GNU readline as well (e.g using ./configure
--prefix=$HOME in the readline source directory)

rlwrap's configure script will then not find this installation automatically, but

./configure --prefix=$HOME CFLAGS=-I$HOME/include CPPFLAGS=-I$HOME/include LDFLAGS=-L$HOME/lib

should work. You can add '-static' to LDFLAGS if you want to build a statically linked rlwrap, 
like so:

./configure --prefix=$HOME CFLAGS=-I$HOME/include CPPFLAGS=-I$HOME/include LDFLAGS=-L$HOME/lib' -static'



BUILD PROBLEMS

If configure complains about missing Xyz (where Xyz can be ncurses,
libptytty, or readline) and you are sure that Xyz is installed on your
system, chances are that you use a distribution with separate Xyz and
Xyz-devel packages.  Compiling rlwrap (or any other software) requires
the -devel packages to be installed.

completion.c is generated from completion.rb by the program rbgen
(https://github.com/hanslub42/libredblack). As this program is
probably not installed on your machine, both files are included in the
tarball and the repository; rbgen is only needed when you want to
change completion.c.

As mentioned above, on OS X sytems, libreadline is not the real
thing, but a non-GNU replacement. If the linker complains about
missing symbols, install GNU readline and try again.

