-*-Mode: Outline-*-

How to configure, build, and install SANE.

* Prerequisites

In order to build SANE, the following tools and libraries are required:

	- GNU make: version 3.70 or newer

	- ANSI C compiler: GNU C (gcc) is recommended for best performance,
	  but any ANSI-compliant compiler should do

	- To build the graphical frontends (xscanimage and xcam), it is
	  necessary to have the GTK libraries and header files installed
	  (libgtk, libgdk, and libglib).  If you do not have these libraries
	  on your system, you can find a recent snapshot in the ftp directory
	  of the SANE distribution.  In addition, if you want to use
	  xscanimage from within GIMP, you'll need to make sure libgimp and
	  its header files are installed as well.  This is most easily done
	  by first obtaining and installing The GIMP.  The GIMP can be ftp'd
	  from ftp://ftp.xcf.berkeley.edu/pub/gimp.

SANE is know to build on the following platforms:

	- Digital Unix (Alpha)		[no generic SCSI support]
	- HP-UX (PA-RISC)		[generic SCSI support untested]
	- Linux (Alpha, m68k, x86)
	- NetBSD (x86?)
	- OpenStep/NeXTStep (x86)	[xscanimage/xcam untested]
	- Solaris (SPARC)		[no generic SCSI support]
	- SunOS (SPARC)			[no generic SCSI support]

* Configuration

Simply invoke configure in the top-level directory.  Besides the usual
GNU configure options, there are the following SANE specific options:

 --disable-shared
	Don't use shared libraries.  Useful for debugging or when there
	is a problem building shared libraries.

 --disable-ld-fix
	Turn off a bug fix in the Mustek backend.  See sane-mustek(5)
	for details.

 --disable-dynamic
	Disable dynamic loading of backends (in the dll backend).
	configure normally turns on dynamic loading when it
	can find the appropriate header files and libraries
	(<dlfcn.h> and -dl).

 --enable-preload
	Preload backends into DLL backend.  This is useful for debugging,
	when dynamic loading is unavailable, or to reduce runtime linking
	overheads.  If dynamic loading or shared libraries are unavailable
	or disabled, this option is turned on automatically.

In addition to these SANE-specific configuration options, there are
many standard-options.  To get a description of available standard
option, invoke configure with option --help.

If you plan on debugging one of the SANE programs, we recommend to run
configure like this:

   CFLAGS="-g -O -Wall" ./configure --disable-shared

** HP-UX

Under HP-UX, it is necessary to add options -Aa and -D_HPUX_SOURCE to
the compiler flags when using HP's C compiler (not gcc).  This can be
done by invoking configure with:

	CPPFLAGS=-D_HPUX_SOURCE CFLAGS=-Aa ./configure

* Build

To build SANE, simply type "make" in the top-level directory.

* Installation

Once the build has finished, install SANE with "make install".  By
default, this will place the SANE libraries in /usr/local/lib/ and the
configuration files in /usr/local/etc/sane.d.  The location of these
directories can be overridden with configure options.

Backend and frontend specific information on the configuration files
can be found in backend/*.README and frontend/*.README.

If you're using any SCSI scanners, be sure to set the permission of
the generic scsi devices appropriately.  We recommend to add a group
"scanner" to /etc/group, add everybody who's allowed to access that
scanner to that group, and then set the permission of the special
device to allow group read and write.  E.g., if the scanner is at
generic scsi device /dev/sge, this would set the permission correctly:

	$ chgrp scanner /dev/sge
	$ chmod 660 /dev/sge
	$ ls -l /dev/sge
	crw-rw----   1 root     scanner   21,   4 Feb 12  1996 /dev/sge
