[sane-devel] backend naming conventions/constraints

Henning Meier-Geinitz henning@meier-geinitz.de
Fri, 28 Feb 2003 13:14:24 +0100


Hi,

On Fri, Feb 28, 2003 at 08:50:44PM +0900, Olaf Meeuwissen wrote:
> I tried getting things to work with a hyphenated backend name, but to
> no avail.  The dll backend uses the literal name in dll.conf to check
> for functions in the backend :-(

What would be the alternative? How should it get the internal
backend name?

> Some minor mods in the dll backend could easily fix that (I'd think),
> but since I have to rely on existing sane-backends packages out there
> that is not an option for me right now.  I'll go with epkowa for the
> backend.

Sounds fine for me.

Keep in mind that attaching to a sane  backend is quite flexible.
That's the reason for some of the tricks used in the Makefile.

1) static linking
  a) link to one backend statically (e.g. net). The symbold must be
     sane_init () (without backend name) for this to work.
  b) link to libsane-dll.a which includes (preloads) all backends
     statically. The api symbols must use e.g. sane_mustek_init () to 
     avoid duplicated symbols.
2) shared libraries
  a) link to any sane backend as shared library. The symbol names must
     be sane_init(). The so name of the library must be libsane.so
     (not libsane-mustek.so), otherwise you can't change the backend
     after linking. That's the reason for the change in libtool.
  b) link to libsane-dll.so as a shared libryry which preloads all
     other backends (see above).
3) dynamic loading
 link to libsane-dll.so which loads all other backends dynamically.

I'm open for changes but it's not as easy as it looks on first sight.

Bye,
  Henning