Index Qt and Solaris OS/2 Software SANE GUIs

Here are some tips for running and compiling SANE under OS/2

Well, I've hardly touched SANE and OS/2 for about 18 months now. The main beacon holder seems to be Paul Smedley these days - here's his web site.

First of all, if you just want to run a pre-compiled binary.

Running SANE

The SANE_CONFIG_DIR environment variable should point to the directory that contains your [backend].conf file. For instance, SET SANE_CONFIG_DIR=c:\mptn\etc which contains snapscan.conf. In addition, if you are using a parallel port scanner with one of the later betas (1.0.3 and 1.0.4 in which I've disabled the -d option), you should also have a "dll.conf" file that contains the name of your backend (e.g., mustek_pp).

You should set TMP to something valid. If you have problems, then you might like to try the following: SANE_DEBUG_[BACKEND], SANE_DEBUG_DLL and SANE_DEBUG_SANEI_SCSI. All three take numeric values, as far as I can tell, from 0 to 255. For instance set SANE_DEBUG_SNAPSCAN=2. See below for more information.

You can set SANE_DEFAULT_DEVICE (e.g., to snapscan:b1t2l0).

There are several GUIs available (fesane, jsane, josi, pmsane, SANE/2 and Scan It/2). They can also be found on hobbes, except for Scan It/2, which should be on leo. SANE/2 and Scan It/2 require the DLL version of SANE, so they won't work with anything that I've compiled (at the time of writing - since then I've managed to build DLLs, but haven't tried them).

Compiling SANE

I recommend that you download the following packages and patches.

  1. sane-1.0.x.tar.gz from the sane homepage.
  2. os2unix
  3. You need the directory \var\tmp to exist on the drive where you are running scanimage.exe.

There are a ton of packages that you will need (possibly non-exhaustive): ksh, autoconf, m4, gcc, gnu bin utils, gnu text utils, gnu patch, sed, bison, gnu diff, gnu find, gnu gawk, gnu shell utils, gnu make. As a rule, the latest versions should work. sed might pose a problem

You'll probably also want the following packages as well:

  1. from leo. Make sure that you recompile the libraries, as you may not be able to link otherwise. You'll also have to put the compiled library (syslog.a) in your emx library directory (x:\emx\lib), and the syslog headers in your emx include directory (x:\emx\include[\sys]). (Other directories will probably work, and/or modifying the options that you use with configure, but this is the quickest and easiest way).
  2. More recent backend code. For instance, for the Agfa SnapScan or for Mustek.
  3. Alternatively, set yourself up to check out the latest SANE source code from anonymous CVS.

In order to configure your build environment, there are a few things that you'll need to do.

A few explanations. On my system I have most of the gnu binaries in f:\bin. I also have some things (mainly not gnu) in f:\utils. EMX is in g:\emx. /tmp is in h:\tmp and the /usr tree is on h:\usr (this is mainly needed by autoconf). You may have noticed that a lot of the PATH components refer to the real hard disk directories, whilst I'm using a Z: TVFS directory. I think there is a performance gain to be had by accessing files directly whenever possible. It's vitally important if you do this that the paths pointed to directly are the same ones that are mounted in your TVFS drive. For instance, if you have TMP=c:\tmp, but d:\tmp is mounted as z:\tmp in TVFS, then you might find that one tool writes a file to $TMP (c:\tmp) but then some bozo has written a script that wants to read it using the direct path /tmp (which is z:\tmp, which is d:\tmp). Since the file was written to c:\tmp, it's not going to find it later when it looks in d:\tmp.

There are a few more things that I recommend doing.

SANE and output streams

Briefly, when SANE runs, it outputs stuff to two places, stdout and stderr. By default both of these go to the screen. However, if you redirect stdout to a file (scanimage > scan.pnm) then only stderr continues to be shown on the screen. You should be able to redirect stderr to a file as well, for instance if you have the SANE_DEBUG* environment variables set, and you run the command "scanimage -v 2>debug.log > scan.tnm", then hopefully you won't lose the reams of debug output. (If you use the --help option, it seems as though the help output goes to stdout instead of stderr).


Not in any particular order

Copyright © Paul John Floyd 2003 - 2005

Valid HTML 4.01!