$Id: INSTALL,v 1.11 1999/10/20 19:24:46 joe Exp $
================================================================================
COST INSTALLATION GUIDE

	For information about Cost, see
	    <URL:http://www.flightlab.com/cost/>

	Please report any problems, questions, bugs, and suggestions
	for enhancements to:

	Joe English <joe@flightlab.com>, or <jenglish@crl.com>

================================================================================
BEFORE YOU START

To build Cost you will need a standard (ISO/ANSI) C compiler,
or something reasonably close.  'gcc' should be fine.

You will also need the following packages:

    * Tcl:   	Any version from 7.5 through 8.2 ought to work, with or without
		plus-patches and/or [incr Tcl].  However, I've really only
		tested the current version of Cost with Tcl 7.6+, Tcl 8.1,
		and Tcl 8.2.1.

    * [N]SGMLS:	SP/NSGMLS is recommended if it's available for your system.
		SGMLS version 1.1.91 is more portable and is next best.
		SGMLS version 1.1 will also work.

If you only want to process XML, then you don't need [N]SGMLS.

You may also want to get:

    * Tk:	Whichever version works with your copy of Tcl.


See below for archive sites where these packages may be obtained.

================================================================================
BUILDING COST UNDER UNIX

The usual routine:

	cd src
	./configure

	make package	;# build Cost as a dynamically loadable package
	make costsh	;# build Tcl interpreter with Cost package included
	make		;# all of the above

	make -n install	;# check what 'make install' will do
	make install	;# install the package

	make clean	;# remove intermediate files
	make spotless	;# remove intermediate files & all targets

If this works, great!

Chances are it won't work though.  I don't quite have the hang
of autoconf yet, sorry.  You can try copying 'Makefile.in'
to 'Makefile' and replacing @CONFIGVARS@ by hand.  Otherwise
e-mail me and I'll try to help.

On some platforms, it may be necessary to use different
compilation flags for shared objects than those which are
statically linked.  If this is the case, run 'make clean'
before 'make package'.  This will recompile all the .o files
with (hopefully!) the appropriate flags for shared objects.

To try Cost out before installing it, set the environment variable
COSTLIB to point to the 'lib' directory underneath where you unpacked
the distribution:

	setenv COSTLIB `pwd`/lib

For the truly adventurous, there is some support for the new
Tcl "Stubs" mechanism and for various other packages, but to add
these you'll need to edit the Makefile and tclAppInit.c by hand.

A couple other targets you might want:

	make costwish	;# Tcl interpreter with Cost and Tk built in
	make lib	;# build static library libcost<Version>.a

To build 'costwish', you must specify --with-tk=<dir>
to the 'configure' command, where <dir> specifies the location
of tkConfig.sh.


================================================================================
BUILDING COST UNDER WINDOWS

NOTE: a binary distribution for Windows is available as a
self-extracting executable from the Cost home page.

If you have the CYGWIN toolkit (release B20), you can run

	cd src
	sh cygconfig.sh     ;# note: autoconf configure script doesn't work
	make package

This builds Cost as a dynamically loadable library.
I haven't been able to build a standalone executable yet,
and you'll have to install stuff by hand:

	set COSTLIB=C:\PROGRA~1\TCL\Lib\COST22	
	rem ... or wherever you want to put it...
	rem  Note that Tcl only looks in %TCLDIR%\Lib for packages,
	rem  where %TCLDIR% is Tcl's installation directory (default  
	rem  "\Program Files\Tcl")

	mkdir %COSTLIB%
	copy libcost2.2.dll %COSTLIB%
	copy ..\lib\*.* %COSTLIB%

You can also try:

	make -n install | /bin/sh

For MSVC, there is a 'makefile.vc' file in the 'src' directory 
which *used* to work at one point.  I don't know if it still does.


================================================================================
BUILDING COST ON OTHER PLATFORMS

... I have no idea ...


================================================================================
WHERE TO GET STUFF

    Cost is available at
	<URL:ftp://ftp.crl.com:/users/je/jenglish/cost-2.2.tar.gz>

    NSGMLS and SGMLS are available at:
	<URL:ftp://ftp.jclark.com/pub/sp>
	<URL:ftp://ftp.jclark.com/pub/sgmls>
    and various mirror sites.

    Tcl and Tk are availble at
    	<URL:ftp://ftp.scriptics.com/pub/tcl>

    The CYGWIN toolkit contains a Windows port of many GNU utilities,
    including GCC.  Find it at:
	<URL:http://sourceware.cygnus.com/cygwin/>



Building SGMLS and Tcl is fairly simple.  Just unpack the
distributions, './configure',  'make', and (for Tcl) 'make install'.
You'll probably want to install the 'sgmls' executable somewhere
convenient as well like in /usr/local/bin.

Building SP/NSGMLS can be quite a bit more difficult.  If you have a
smart enough C++ compiler, then "./configure; make" ought to do the
trick.  If this doesn't work, abandon hope: try SGMLS instead.

================================================================================
