##=============================================================================
## 
## This file is part of BibTool.
## It is distributed under the GNU General Public License.
## See the file COPYING for details.
## 
## (c) 1996 Gerd Neugebauer
## 
## Net: gerd@informatik.uni-koblenz.de
## 
##*****************************************************************************

This file contains instructions and hints for the compilation of BibTool.

Table of Contents

	0. Introduction
	1. Prerequisites
	2. Generic Installation Procedure
	3. Installation on MSDOS-like Computers
	4. Installation on Amiga
	5. Installation without make
	6. Problems and Porting



0. Introduction
===============

BibTool is known to work on the following operating systems/C compilers:
(At least an earlier version has been compiled successfully on them.)

	Sun4/SunOS4.1.*		cc, gcc
	Sun3/SunOS4.1.1		cc
	HP 9000/4??/HP UX ??	cc
	Atari ST/TOS 1.2	Laser C, Pure C
	SparcStation/Solaris2.4 gcc
	SparcStation/Solaris2.5 gcc

I have been informed that BibTool has been compiled on the following
machines/operating systems:

	Linux			gcc
	MSDOS,OS/2,Win32,WinNT  emx, dj, Watcom C, MSC
	DEC Alpha/OSF/1		
	NeXT			
	MIPS/Ultrix4.4		gcc 2.4.5
	Amiga			SAS/C

If you compile BibTool on other systems drop me a mail. I'm interested
to support a broad variety of systems/compilers.


	Gerd Neugebauer
	Mainzer Str. 8
	56321 Rhens (Germany)

	Net: gerd@informatik.uni-koblenz.de

You can also send me a mail if you encounter problems in compiling
BibTool, or crashes, or unexpected (contradicting the documentation)
behaviour of the final program.

Please enclose a precise description what went wrong. Include the
version numbers of BibTool, your computer, your operating system, and
your C compiler.

If you encounter unexpected behaviour of BibTool enclose your resource
file(s) and a SMALL BibTeX file demonstrating the problem. Describe
how you have invoked BibTool (arguments) and justify why you think
that there is a problem.

I know this sounds like work. But otherwise I will not be able to give
you a proper advice.


1. Prerequisites
================

To install BibTool you need:

-   A C compiler. ANSI-C is not required but highly recommended.
    Several library functions are expected. You will see if your linker
    complains.
-   A running version of make is recommended.


2. Generic Installation Procedure
=================================

See if there is a special section for your computer/C compiler and
follow the instructions given there.

To install BibTool you can try to apply the following instructions:

 A  Copy one of the prepared makefiles to makefile and adjust it according
    to your C compiler. The following makefiles should be present in the
    distribution: 

    makefile.unx
	This is the generic makefile. Especially it is for all UN*X systems
	and may provide a basis for compilation on systems not explicitly
	mentioned here.
    makefile.dos
	This is the makefile for MSDOS based machines.
    makefile.ata
	This is the makefile for Atari ST/TT computers.
    makefile.ami
	This is the makefile for Amiga computers (with SAS/C).

    Edit the makefile and adjust the settings in the configuration
    setion according to your needs.

    Maybe you have to adapt the name and options for your C compiler.
    (Most of the time I prefer the GNU C compiler)

    Maybe you want to change the location for the installation target,
    even though reasonable defaults are provided.

 B  Look in the file config.h to see if it fits your operating system
    and C compiler. Adjust things as required.
    Most probably you do not have to change anything in this file.
    This file is mainly for those without a make command or for those
    configuring the internals of BibTool.

 C  If you have a working makedepend command run

	make depend 

    Otherwise just skip this step. It is only helpful if you compile BibTool
    more than once.

    This might cause problems if the makedepend command does not fit
    the C compiler used (e.g. propriatary makedpend together with gcc).
    This results in unknown files to show up.
    In this case also skip this step and revert to the original makefile.

 D  Afterwards run

	make

 E  If you have tried the command bibtool in the current directory
    you can install it with

	make install

    to install the executable and the libraries and

	make install.man

    to install the UN*X man pages. This is only useful if you can make
    use of them.

 F  To get rid of all intermediate files run

	make clean

 G  To prepare the documentation contained in the subdirectory Doc
    go into the Doc subdirectory and run

	latex   bibtool
	latex   bibtool
	bibtex  bibtool
	makeidx bibtool
	latex   bibtool
	latex   bibtool

    The makeidx program may be named differently on your system or missing
    at all. In this case you can omit this step and do without the index.

    On UNIX you can try

	make doc

    There might be problems when files produced by LaTeX2.09 should be read by
    LaTeX2e and vice versa. In this case you can try to remove the
    intermediate files

	bibtool.toc
	bibtool.ind

    and follow the instruction for making the documentation from the beginning.


3. Installation on MSDOS-like Computers
=======================================

This section some hints on the compilation of BibTool on MSDOS computers.
These adaptions are mainly due to the efforts of Josef Spangler
(JS@rphnw3.ngate.uni-regensburg.de). All credits go to him. Any remaining
problems should be blamed on my ignorance.

General instructions:

 A  Copy  makefile.dos  to  makefile
    and adjust it according to your C compiler.

 B  Edit config.h to adjust it to your needs.
    Normally you should be interested only in the suppport of EMTEX at the end
    of the configuration file.

 C  Copy  MSDOS\link.*  to the source directory.

 D  Depending on the C compiler do the following:

    - dj  (GNU C port)

	make dj

    - emx (GNU C port)

	make emx

    - Watcom C 386 (32 Bit Compiler for Dos, OS/2 2.x, Win32 and WinNT)

	make wat

    - Microsoft C 6.00A (16 Bit Dos and OS/2 1.x)

	make msc

    - Borland C++ 3.1 (16 Bit Dos)
	Go and get another compiler. 
	Or, even better do the port and send me the diffs :-)


4. Installation on Amiga
========================

This section contains some hints on the compilation of BibTool on Amiga
computers. These adaptions are mainly due to the efforts of Andreas Scherer
(SCHERER@genesis.informatik.rwth-aachen.de). All credits go to him. Any
remaining problems should be blamed on my ignorance.

This section describes the installation procedure if you are using the SAS/C
compiler on Amiga.

General instructions:

 A  Copy  makefile.ami  to  SMakefile
    and adjust it accordingly.

 B  Edit the file config.h and adjust it to your needs.
    There should not be much for you to change.

 C  	make

 D  Make the documentation according to step G in section 2.


5. Installation without make
============================

 A  Adjust the settings in the file config.h to fit your C compiler and 
    operating system.

 B  Compile all .c files in the base directory. The macros REGEX and
    maybe MSDOS should be defined. The subdirectory regex-0.12 should
    be included in the include search path.
    A typical compile command looks like

	cc main.c -c -o main.o -DREGEX -DMSDOS -Iregex-0.12

 C  Compile regex.c in the regex-0.12 subdirectory and move the object
    file into the base directory (The one containing this file).

 D  Link together all object files to get the exectable bibtool.

 E  Run LaTeX on bibtool.tex in the Doc subdirectory to produce the 
    documentation. (see step G in section 2 for details)


6. Problems and Porting
=======================

Well, if the procedures described above don't work I have some hints.  These
hints may also be useful if you plan to port BibTool to other operating
systems or C compilers.

First of all a small list of assumptions that I use.

 -	On ANSI systems there should be no problem at all.
	There is some support for non-ANSI systems. This support can be
	improved. (I don't know if it's worthwhile to do so).

 -	BibTool has been developed on UN*X (SunOS) and UN*X-like systems
	(Atari).
	Such file/directory naming conventions found their way into the code.
	Single character delimiters between directories and files can
	be modified in a resource file.

 -	ASCII encoding is assumed.
	I role my own type.h instead of using ctypes.h.
	This has mainly historical reasons. Maybe this code should be
	rewritten to be adapted at make time.

	If you port BibTool to a non-ASCII machine the table of characters
	(allowed[]) in type.h has to be adapted at least (send me the diffs,
	please).

 -	Maybe some BSD-isms found their way into the code even if I am
	not aware of it.

