[sane-devel] HP5400 backend progress

Henning Meier-Geinitz henning at meier-geinitz.de
Sun Feb 23 22:54:47 GMT 2003


Hi,

On Mon, Feb 24, 2003 at 09:19:17AM +1100, Martijn van Oosterhout wrote:
> On Sun, Feb 23, 2003 at 03:11:44PM +0100, Henning Meier-Geinitz wrote:
> > You are talking about sane-hp5400.so that's in your package?
> > ls -l sane-hp5400.so
> > -rwxr-xr-x    1 hmg      hmg         83577 2003-02-23 13:52 sane-hp5400.so
> > 
> > nm sane-hp5400.so|grep sane
> > 000056cc T sane_hp5400_cancel
> > 00004f48 T sane_hp5400_close
> > [...]
> > 
> > There is no sane_init (etc.). That may work if you load the library by
> > the dll meta backend but you can't link to it from a frontend directly.
> 
> Interesting. I havn't tried to get it loaded by a frontend directly. I've
> only tried indirectly via the dll meta-backend. Obviously I've missed
> something somewhere...

I recommend to use the infrastructure that's already present in the
sane-backends package. If you make your own package without using
configure and the makefiles from sane-backends, you'll need quite
some tricks. E.g. there must be symbold like sane_init, otherwise you
can't link to a shered lib directly. On the other hand, if you link
statically, you can't use sane_init, because you would have thirty
backends with the same symbols :-)

Further more, despite the library name sane-hp5400.so, the internal so
name must be libsane.so, otherwise linking won't work. We use a
modified libtool for this trick.

> > So are you sure that sane_init of your backend is called at all?
> 
> It is via the dll backend. It spits out messages about opening and reading
> the config file. It then opens the usb port and confirms the scanner is on
> the other end. And then the frontend exitssaying it oculdn't find a scanner.

Ok. I just loaded the sane-hp5400.so that was in your tar.gz. I didn't
try to compile it myself. I don't even know if it's "legal" to produce
the .so from the .o as you do it in the makefile.

> > If you set the appropriate links and run it with the dll backend you
> > get:
> > [dll] load: searching backend hp5400' in /usr/local/lib/sane'
> > [dll] load: trying to load /usr/local/lib/sane/libsane-hp5400.so.1'
> > [dll] load: dlopen()ing /usr/local/lib/sane/libsane-hp5400.so.1'
> > [dll] init: initializing backend hp5400'
> > [dll] init: backend hp5400' has a wrong major version (0 instead of 1)
> > 
> > Maybe that's because V_MAJOR and V_MINOR is set by sane-backend's
> > configure?
> 
> Hmm, I had to make up some numbers for those #defines. Nothing on my system
> complained about them being wrong. Are they defined in sane-config.h?
> Because I know I don't have that file.

You must set them yourself, if you don't use the sane-backends package.
In sane-backends, it's set by configure and the compiler gets it by -D
command line options.

Bye,
  Henning



More information about the sane-devel mailing list