$Id: INSTALL,v 1.4 2001/09/03 18:55:36 rogue Exp $

1.  Configure

Look through the beginning of file "Imakefile". Currently, you can enable
OSS audio playback by uncommenting the appropriate row. You might also want
to change the default audio output device depending on your architecture.
DSPBUF will be the default output buffer size used. It is probably of no
importance; however you might want to increase the buffer if you experience
buffer underruns. See the documentation of your audio subsystem for details.

The DSPDEV and DSPBUF can be overridden with command line arguments.
Currently, only OSS audio is supported. Different flavours of Linux and
the free *BSDs have the free version; OSS is available for many platforms
(see http://www.opensound.com/).

2.  Build Xforge

Basically, you just need to

$ xmkmf -a
$ make

If you don't have xmkmf, use imake instead (with appropriate X11 config
directory path):

$ imake -DUseInstalled -I/usr/lib/X11/config
$ make depend
$ make

Hopefully, everything goes fine. Some systems have neither xmkmf or imake;
you might need to build a skeletal Makefile in that case.

In case of problems (especially Solaris, AIX and HP-UX), take a look at
Notes section below.

If you are still unable to compile Xforge, you are on your own. Ask someone
who knows about the system - the Xforge project does NOT know, otherwise
the Imakefile would support your system. But we are interested if you can
figure out how to compile the thing and send us details.

3.  Try it out

Before messing up the already working stuff, type

$ ./xforge

A window should be opened, with an empty wave buffer. Try some things
out like opening waves and some simple effects. If everything is fine,
there is a good chance that Xforge is actually working.

Note about application defaults: you can create alternative application
defaults with

$ make Xforge-alt.ad	# for MS Windows-like edit accelerators

and

$ make Xforge-sgi.ad	# for nice drag and drop FSB if you linked with -lSgm

Rename the result to Xforge.ad before installing.

4.  Install

Assuming you have proper privileges, Xforge can be installed with

# make install
# make install.man

Otherwise, or if Imakefile is useless for you, copy xforge somewhere in
your search path and Xforge.ad to your app-defaults directory as "Xforge".
Check that xforge is mode 755, and Xforge is mode 644.

5.  Notes

Not all UNIX systems are shipped with C compilers. You can, however, install
gcc on almost any system. However, X on these systems (recent Solaris, AIX
and HP-UX for example) is configured to use the native compiler which
causes problems when compiling Xforge (and any other software which needs
imake).

The following was posted to comp.sys.sun.misc and may be applicable on
other systems as well:

----cut-here----

Subject: Re: Install GhostView on Sun
Date: 03/17/2000
Author: Thad Floryan <thad@thadlabs.com>

"H.Eftoy" <har@traloc.noXX> wrote:
| I have a Spark 5 with Solaris 2.6
| 
| I'm using the gcc compiler, and get this report from make:
| 
| gcc:  unrecognized option  ' -Xc'
| gcc:  language cg92  not recognized
| 
| Thankful for any hint.

The problem is make assumes you're using the Sun compiler(s); the various
make and imake default rules use switches which gcc doesn't recognize. 
  
You'll need to change several files to make it all work:

	/usr/openwin/lib/config/Imake.tmpl
	/usr/openwin/lib/config/site.def
	/usr/openwin/lib/config/sun.cf
	/usr/openwin/lib/config/sv4Lib.rules
  
Make backup copies of the preceding files before changing them; what I
usually do is "cp -p filename filename-ORIG"

Here are the changes that work:

sun.cf:

	line 4 change from:
		#define HasSunC YES
	to:
		#define HasSunC NO

site.def:

	lines 35-39 change from:
		/*
		#ifndef HasGcc2
		#define HasGcc2 YES
		#endif
		*/
	to: 
		#ifndef HasGcc2
		#define HasGcc2 YES
		#endif

	lines 41-45 change from:
		/*
		#ifndef HasCplusplus
		#define HasCplusplus YES
		#endif
		*/
	to: 
		#ifndef HasCplusplus
		#define HasCplusplus YES
		#endif

Imake.tmpl:

	line 625 change from:
		#define LdPreLib -L$(BUILDLIBDIR)
	to:
		#define LdPreLib -L$(BUILDLIBDIR) -R$(BUILDLIBDIR) 

	line 628 change from:
		#define LdPreLib -L$(USRLIBDIR)
	to:
		#define LdPreLib -L$(USRLIBDIR) -R$(USRLIBDIR) 

	line 636 change from:
		#define LdPostLib -L$(USRLIBDIR)
	to:
		#define LdPostLib -L$(USRLIBDIR) -R$(USRLIBDIR) 

sv4Lib.rules:

	line 33 change from:
		#define PositionIndependentCFlags -K PIC
	to:
		#define PositionIndependentCFlags -fpic 

	line 40 change from:
		#define PositionIndependentCplusplusFlags -K PIC
	to:
		#define PositionIndependentCplusplusFlags -fpic 

and that should do it. 

----cut-here----

Note that it is not really necessary to change system configuration files.
You can copy the files above to another directory, edit them and include
that path when running imake:

$ imake -DUseInstalled -I/dir/you/have/edited/files -I/usr/openwin/lib/config

Linux distributions often split libraries (like Lesstif) to two packages,
one which contains the run-time files required by application using these
libraries and a development packages which contains all the stuff needed
for compiling. To compile Xforge, you need Motif and X development packages.
