INSTALLATION INSTRUCTIONS

   xdvi now uses a `configure' shell script to guess correct values for
various system-dependent variables used during compilation.  The mechanism
it uses to implement those values depends on whether imake is being used
or not, but in both cases it creates a file `config.h' that is included
by the C source files.  It also creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').

   The file `configure.in' is used to create `configure' by a program
called `autoconf'.  You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.  If
so, see the file `xautocnf.txt' for details on some custom modifications
to autoconf.

   xdvi can be installed either with the standard X tool `imake,' or with
just plain `make.'  Follow the directions in the appropriate section of
this file.

   EXCEPTION:  Users of using teTeX should go directly to the section
`COMPILING FOR USE WITH TETEX' below.


COMPILING WITH MAKE

To compile and install with make, do the following:

    1.	`cd' to the directory containing the package's source code and type:

		./configure

	to configure the package for your system.  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.

	You may want to run `configure' with some arguments to indicate
	where it is to be installed, where the X Window System libraries
	and include files are, and what program features are to be enabled
	or disabled.  See the section `CONFIGURE SCRIPT OPTIONS' for
	details.

	While running, `configure' prints some messages telling which
	features it is checking for.  When done, it creates a Makefile
	and a file config.h containing the options it has determined.

    2.  Compile xdvi:

		make

    3.	Try out xdvi.

	If the settings in Step 1 are incorrect, then you can use the
	corresponding environment variables to quickly try out different
	values.  Then go back to Step 1.

    4.	Install by typing:

		make install

    5.	If you are compiling for several architectures, type

		make archclean

	and repeat the above steps on each different machine.

    6.	To enable xdvi as a helper application from within the browser, follow
	the instructions given in the man page for xdvizilla.


COMPILING WITH IMAKE

This will probably not work with X11R4 and earlier.

To compile and install with imake, do the following:

    1.	`cd' to the directory containing the package's source code.

    2.	Edit the Imakefile according to the directions contained in that file.

    3.	Create the Makefile by typing:

	    xmkmf

    4.	Compile xdvi:

	    make depend
	    make

    5.	Try out xdvi.

	If the settings in Step 2 are incorrect, then you can use the
	corresponding environment variables to quickly try out different
	values.  Then go back to Step 2.

    6.	Install by typing:

		make install install.man

    7.	If you are compiling for several architectures, type

		make archclean

	and repeat the above steps on each different machine.

    8.	To enable xdvi as a helper application from within the browser, follow
	the instructions given in the man page for xdvizilla.

CONFIGURE SCRIPT OPTIONS

	The `configure' script is similar to others created by GNU autoconf,
	except that it has been modified to support the different needs of
	X applications.  It recognizes the following options to control how
	it operates:

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

    --x-top=DIR
	Look for X include files in directory DIR/include and for X libraries
	in directory DIR/lib.  This is a convenient replacement for
	the options --x-includes and --x-libraries.

    --aux-top=DIR
	Look for additional X include files in DIR/include and library files
	in DIR/lib.  This is useful, for example, if a locally installed
	toolkit is being used.

    --prefix=DIR
	This option determines default values for the --bindir and --mandir
	options.  The default value is the directory specified in --x-top
	(if one was given); otherwise /usr/local.

    --bindir=DIR
	Install the xdvi executable in DIR.  By default, it will be placed
	in the directory PREFIX/bin, where PREFIX is the value of the
	--prefix option.

    --mandir=DIR
	Install the xdvi manual page in DIR/man1.  By default, it will be
	placed in the directory PREFIX/man/man1, where PREFIX is the value
	of the --prefix option.

    --x-includes=DIR
	Look for X include files in directory DIR.

    --x-libraries=DIR
	Look for X libraries in directory DIR.

    --with-x-toolkit=PKG
    --without-x-toolkit
	Use the PKG toolkit for xdvi.  PKG may be `xaw' (use the Xaw
	toolkit), `xaw3d' (use the Xaw3d toolkit as a drop-in replacement for
	Xaw), `motif' (use the Motif toolkit), or `no' (use raw X calls).
	By default, xdvi will use the Xaw toolkit.  `--without-x-toolkit'
	is the same as `--with-x-toolkit=no'.

    --disable-grey
	Disable greyscale anti-aliasing for displaying shrunken bitmaps.
	(This is enabled by default.)

    --disable-color
	Disable support for dvips-style color specials.  (This is enabled
	by default.)

    --disable-buttons
	Disable the placement of radio buttons on the right side of the
	window for commonly used commands.  This option is automatically
	disabled when compiling without a toolkit.

    --disable-make-pk
	If xdvi is compiled without disabling this option, it will use a
	script called `mktexpk' or `MakeTeXPK' to call Metafont to render
	a font at the desired size if that size is not already available.
	This option turns off this feature.

    --enable-make-pk=PATH
	Specifies PATH as the name of the script for dynamically creating
	font pixel files.  This is the default value of the XDVIMAKEPK
	environment variable; see the discussion of XDVIMAKEPK in the manual
	page for more information.

    --enable-old-make-pk
    --enable-old-make-pk=PATH
	Use an old `MakeTeXPK' script instead of `mktexpk' to dynamically
	create font pixel files.  If given, PATH is as in `--enable-make-pk';
	if not given, the default is `MakeTeXPK.'  This option supersedes
	the `--enable-make-pk' option.

    --enable-gf
	Enable support for Metafont `gf' font pixel files.  (The `pk' format
	for font pixel files is always enabled.)

    --enable-ps-gs
    --enable-ps-gs=PATH
	Enable use of Ghostscript<TM> to render PostScript<TM> specials.
	Your system must have Ghostscript installed for this to work.
	Versions earlier than 2.6.1 have not been tested with xdvi.  The
	PATH is the path of the ghostscript executable; "gs" by default.
	This option can be used in combination with either of the next two
	`--enable-ps-' options.  If one of them is enabled, then they take
	precedence over Ghostscript.

    --enable-ps-dps
	Enable use of Display PostScript<TM> to render PostScript specials.
	Your system must have DPS for this to work.

    --enable-ps-news
	Enable use of NeWS server to display PostScript specials.  Your
	system must have the NeWS include files and libraries for this to
	compile; the xdvi binary can be run with either a standard X server
	or the NeWS server, but in the former case the code generated by
	PS_NEWS will have no effect.  NOTE:  This option refers only to
	OpenWindows versions 3.1 (possibly 3.2) and earlier (running under
	SunOS 4.x).  If you are using Solaris 2, then you should use PS_DPS
	instead.

    --enable-config-file=PATHLIST
	Enable use of a configuration file in xdvi.  The PATHLIST should be
	a colon-separated list of directories to be searched for a
	configuration file named `texmf.cnf.'

    --enable-self-auto
    --enable-self-auto=PATHLIST
	Enable configuration files; also enable special symbols SELFAUTODIR
	and SELFAUTOPARENT in the config file.  This option also selects for
	the use of config files; if no PATHLIST is given, the value
	".:$SELFAUTOLOC:$SELFAUTODIR:$SELFAUTOPARENT
	:$SELFAUTODIR/share/texmf/web2c:$SELFAUTOPARENT/share/texmf/web2c
	:$SELFAUTODIR/texmf/web2c:$SELFAUTOPARENT/texmf/web2c
	:$TETEXDIR:$TEXMF/web2c" (without the line breaks) is used.

    --enable-extra-app-defaults
    --enable-extra-app-defaults=PATHLIST
	Selects `--enable-self-auto' (with PATHLIST, if given); in addition,
	it causes xdvi to look for a second app-defaults file, either in the
	root directory of the texmf tree, or in the xdvi or web2c
	subdirectories.  This option is primarily intended for copies of xdvi
	that are to be distributed with precompiled TeX distributions such as
	teTeX.  This option is not available when compiling without a toolkit.

    --enable-dosnames
	Check also for pk or gf files with names like dpi329/cmr10.pk
	(instead of cmr10.329pk).

    --enable-a4
	Set the default paper size to `a4' instead of 8.5 x 11 inches.
	Also change the default unit from inches to centimeters.

    --enable-texxet
	Enable support for dvi op-codes 250 and 251 (used for typesetting
	right-to-left languages).

    --with-mfmode=MODE:DPI
	Set the default value for the `-mfmode' option to `MODE:DPI'.
	(This is the Metafont mode used when creating fonts.)  If neither this
	option nor `--without-mfmode' is selected, then the default value
	is `cx:300'.

    --without-mfmode
	Indicate that the `-mfmode' option has no default value.

    --with-tetex
    --with-tetex=PATHLIST
	This causes --enable-ps-gs, --enable-dosnames, and
	--enable-extra-app-defaults to be set by default (their values can be
	overridden explicitly).  If a PATHLIST is given, it is passed to
	the --enable-extra-app-defaults argument.

    --with-default-texmf-path=PATH
	Set the default value of the TEXMF environment variable.

    --with-default-font-path=PATH
	Set the default value of the XDVIFONTS environment variable.

    --with-default-vf-path=PATH
	Set the default value of the VFFONTS environment variable.

    --with-default-header-path=PATH
	Set the default value of the XDVIHEADERS environment variable.

    --with-default-fig-path=PATH
	Set the default value of the XDVIPICTS environment variable.

    --with-default-source-path=PATH
	Set the default value of the XDVISOURCES environment variable.

    --with-default-dvips-path=CMD
	Set the default value of the dvipsPath resource, which gives the
	command to use for printing (not applicable if compiling without the
	X Toolkit).


ADDITIONAL OPTIONS

	Some additional rarely-used options may also be set in the `configure'
	script.  To do so, set the `CPPFLAGS' variable explicitly.  This can
	be done as in the following examples:

	If using make and using the C-shell (/bin/csh, /bin/tcsh, etc.):

	    env CPPFLAGS='-DALTFONT="ptmr8r"' ./configure

	If using make and using a Bourne-like shell (/bin/sh, /bin/bash,
	/bin/ksh, etc.):

	    CPPFLAGS='-DALTFONT="ptmr8r"' ./configure

	If using imake:  See the instructions for setting DEFS in the Imakefile.

	(Of course, options such as --prefix may be supplied to `configure'
	as well.)

	The following options are supported in CPPFLAGS:

	Option Flag	Explanation
	-----------     -----------

	ALTFONT		Default font to use if the font named in the dvi file
			cannot be found.  Can be set to NULL.  By default,
			it is "cmr10".
	BDPI		Default number of pixels per inch to use.  It is better
			to set this value by setting the default metafont mode
			instead.
	DEFAULT_FONT_SIZES Colon-separated list of font sizes to look for if				the exact size cannot be found, and if automatic
			generation of pixel files fails.  See the description
			of the XDVISIZES environment variable in the manual
			page for more details.
	SHRINK		Default value for the -s option (shrink factor).
			If not specified, the default will be 3.
	XDVIFONTS_ONLY	Never check the TEXFONTS environment variable.
			Normally xdvi checks TEXFONTS if the XDVIFONTS variable
			is not set.  This option is recommended if the version
			of TeX in use requires that the TEXFONTS variable be
			set.  See the relevant paragraph in xdvi-man.sed for
			more details.  This option turns off that paragraph.
	MKPK_REDIRECT	Enables use of the `%r' specifier for MakeTeXPK scripts
			that support sending the file name to a numbered file
			descriptor instead of standard output.  This implies
			-DMAKEPK.
	NOQUERY		Set this if you have trouble compiling the definition
			of drawingWidgetClass.
	TICKTMP		Directory for temporary files created by PostScript
			specials that call for the output of a command (e.g.,
			compressed .eps files).  Default is "/tmp".
	TICKCACHESIZE	Maximum number of such files to be stored at a time
			(this is dynamically increased if more than this number
			occur on a single page).  Default is 3.


SETTING PATHS

	Read the ENVIRONMENT section of xdvi-man.sed to determine the correct
	default values for the TEXMF and XDVIFONTS environment variables.
	These should be specified as arguments to `./configure' (which can
	be set in the Imakefile, if you are going that route).
	If your site uses virtual fonts, do the same thing with the
	VFFONTS variable.  Note that support of virtual fonts in xdvi
	does not include support of built-in PostScript<tm> fonts.
	Usually you will want to use the same font files as your printer;
	given a choice, however, it has been suggested that write-white
	fonts look better.

	If you are compiling with PostScript specials enabled, then
	you also need to set default values for the XDVIPICTS and
	XDVIHEADERS variables.	These should contain colon-separated
	lists of directories.  The XDVIPICTS variable gives the list
	of directories to search for PostScript figures; typically
	this is the same as the default input directory used by TeX.
	The XDVIHEADERS variable gives the default list of directories
	to search for PostScript headers.  If you also install dvips,
	then it is recommended that XDVIPICTS and XDVIHEADERS be set to the
	same values as FIGPATH and HEADERPATH in the Makefile for dvips.

	If you are compiling with a configuration file, then the paths
	described above are less important, since they can be set in the
	configuration file.


NOTES FOR SPECIFIC OPERATING SYSTEMS

	This section is probably not necessary, and will be deleted eventually.
	If you find that part of it is needed, please let me know by sending
	e-mail to vojta@math.berkeley.edu.

	SGI/IRIX 4:  You can substantially reduce the size of the xdvi binary
	    by linking with -lX11_s instead of -lX11 and -lXt_s instead of -lXt.
	    This requires some hacking in the Makefile.

	SGI/IRIX 5.1:  If you are not using imake, add

		-cckr -float -KPIC -G 0 -Wf,-XNh2000

	    to CFLAGS when configuring (by treating CFLAGS similarly to
	    CPPFLAGS, as above).

	Sun/Solaris 2.x:  If you are using the X11R6 server (as opposed to the
	    OpenWindows server) and are running Solaris 2.4 or earlier, then
	    a bug in the threads library may cause xdvi to fail to work
	    (it won't respond to keystrokes or may not display the page).
	    If you experience this problem, edit config.h after running
	    `configure,' and undefine HAVE_STREAMS.
	    Or, better yet, try to get the appropriate patch from Sun, since
	    you are probably having other problems with X, too.

	IBM RS6000:  Some of the libraries are in non-obvious places:

		libXmu	/usr/lpp/X11/Xamples/lib/Xmu/libXmu.a
		libXaw	/usr/lpp/X11/Xamples/lib/Xaw/libXaw.a

	    These should be moved to /usr/lib or some more reasonable place
	    (or use symlinks), and ditto for the include files, which are
	    initially placed in /usr/lpp/X11/Xamples/include.


COMPILING FOR USE WITH TETEX

    If you are replacing the version of xdvi that comes with the teTeX
    distribution of TeX (these instructions work with Versions 0.4 and 1.0),
    you need to:

    1.	Determine where the xdvi binary and manual page are to go.  If you
	have the `locate' command installed on your system, you can type
	`locate xdvi' to find them.

    2.	Run the following command to configure this version of xdvi.
	The --bindir and --mandir arguments should be the directories
	determined in Step 1.  Note, however, that the --mandir directory
	should end in `/man', not in `/man/man1'.

	Also, if you found that xdvi and xdvi.1 were located in /usr/bin
	and /usr/man/man1, respectively, then the `--bindir' and `--mandir'
	arguments should be omitted.  In that case `configure' will put them in
	/usr/local/bin and /usr/local/man(/man1) by default, and this version
	of xdvi will supersede the system version because presumably
	/usr/local/bin and /usr/local/man will be searched before /usr/bin
	and /usr/man.  This paragraph applies, for example, to the teTeX that
	comes with Debian Linux systems.  (As a general rule, locally installed
	programs should go into /usr/local.)

	    ./configure --with-tetex --bindir=/usr/local/teTeX/bin/i386-linux \
		--mandir=/usr/local/teTeX/man

	In the above example, the `--bindir' and `--mandir' arguments should
	be correct for a locally installed version of teTeX.

	If you are using teTeX version 0.4, you should also include
	--enable-old-make-pk in the above arguments.

	You may also, of course, use other `configure' options in addition.

    3.	Locate the file texmf.cnf and add the following lines. They must go
	before any of these symbols are defined without the .XDvi suffix:

	    PKFONTS.XDvi    = .:$TEXMF/%s:$VARTEXFONTS/pk/{%m,modeless}//
	    VFFONTS.XDvi    = .:$TEXMF/%s
	    PSHEADERS.XDvi  = .:$TEXMF/%q{dvips,fonts/type1}//
	    TEXPICTS.XDvi   = .:$TEXMF/%q{dvips,tex}//

	In teTeX 0.4, use $TEXMFS instead of $TEXMF and VARFONTS instead of
	VARTEXFONTS in the above lines.

	You may also define MFMODE, PIXELSPERINCH, SHRINKFACTOR, and PAPER in
	texmf.cnf.  For example, if your $TEXMF/xdvi/XDvi file contains

	    XDvi*mfmode: ljfour
	    XDvi*pixelsPerInch: 600
	    XDvi*shrinkFactor: 4
	    XDvi*paper: letter

	then the following lines can go into texmf.cnf:

	    MFMODE          = ljfour
	    PIXELSPERINCH   = 600
	    SHRINKFACTOR    = 4
	    PAPER           = letter

	You can also put lines such as:

	    SHRINKBUTTON1   = 1
	    SHRINKBUTTON2   = 3
	    SHRINKBUTTON3   = 4
	    SHRINKBUTTON4   = 6

	into texmf.cnf to change the labels on the buttons. You will probably
	need to be root to edit texmf.cnf.

    4.	Type "make" and see if it produces any error messages. If it does,
	study the documentation above, make whatever changes to the Makefile
	seem appropriate, then "make clean" and "make" again.

    5.	Before installing xdvi, you may remove `xdvi.bin' from the binary
	directory.  Or, if you wish to still be able to run the version of
	xdvik that comes with teTeX, rename `xdvi' to `xdvik' and leave
	`xdvi.bin' alone.  Omit this step if you omitted the `--bindir'
	and `--mandir' arguments in Step 2.  In that case, you will be able
	to run the old xdvi by using its full path:  `/usr/bin/xdvi ...'.

    6.	Install xdvi and its man page by typing:

	    make install

	You will probably need to do this as root.

    7.	To enable xdvi as a helper application from within the browser, follow
	the instructions given in the man page for xdvizilla.
