[sane-devel] niash backend dependencies in backend/Makefile.in

Mattias Ellert mattias.ellert@tsl.uu.se
Sat, 9 Oct 2004 20:59:23 +0200


2004-10-08 kl. 13.03 skrev Henning Meier-Geinitz:

> Hi,
>
> On Thu, Oct 07, 2004 at 10:49:09PM +0200, Bertrik Sikken wrote:
>> I just tried sane-backends CVS and found that it did not work
>> for my hp3300 (niash backend). Scanimage -L complains about
>> missing 'sanei_scsi_find_devices'. I think this is somehow
>> pulled in from another sanei function.

I have the same problem with the CVS version...

  gcc -c -g -O2 -W -Wall -Wcast-align -Wcast-qual -Wmissing-declarations 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prototypes 
-pedantic -DHAVE_CONFIG_H -I. -I. -I../include -I../include 
-DPATH_SANE_CONFIG_DIR=/usr/local/etc/sane.d 
-DPATH_SANE_DATA_DIR=/usr/local/share -DV_MAJOR=1 -DV_MINOR=0 
-D_REENTRANT -DBACKEND_NAME=niash -DLIBDIR=/usr/local/lib/sane niash.c  
-fno-common -DPIC -o .libs/niash.o
niash.c: In function `sane_niash_exit':
niash.c:805: warning: cast discards qualifiers from pointer target type
rm -f niash-s.c
ln -s ./stubs.c niash-s.c
  gcc -c -g -O2 -W -Wall -Wcast-align -Wcast-qual -Wmissing-declarations 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prototypes 
-pedantic -DHAVE_CONFIG_H -I. -I. -I../include -I../include 
-DPATH_SANE_CONFIG_DIR=/usr/local/etc/sane.d 
-DPATH_SANE_DATA_DIR=/usr/local/share -DV_MAJOR=1 -DV_MINOR=0 
-D_REENTRANT -DSTUBS -DBACKEND_NAME=niash niash-s.c  -fno-common -DPIC 
-o .libs/niash-s.o
gcc -bundle  -o .libs/libsane-niash.1.0.14.so  .libs/niash.o 
.libs/niash-s.o .libs/sane_strstatus.o 
../sanei/.libs/sanei_init_debug.o ../sanei/.libs/sanei_config.o 
../lib/.libs/isfdtype.o ../lib/.libs/strndup.o 
../sanei/.libs/sanei_config2.o ../sanei/.libs/sanei_constrain_value.o 
../sanei/.libs/sanei_usb.o  /usr/local/lib/libusb-0.1.4.4.1.dylib 
-lpthread -lm -framework CoreFoundation -framework IOKit
ld: Undefined symbols:
_sanei_scsi_find_devices
make[1]: *** [libsane-niash.la] Error 1
make: *** [all-recursive] Error 1

> That's called from sanei_config_attach_matching_devices.
>
> However, at least in current CVS niash doesn't seem to use that
> function.
>
>> I noticed that nearly all other backends have a line in
>> backend/Makefile.in that declares dependency on sanei_scsi.lo
>> (the niash backend does not have it)
>> Adding the following line to backend/Makefile.in made it work
>> for me:
>> libsane-niash.la: ../sanei/sanei_scsi.lo

Well, the correct fix is to remove the line asking for linking against 
sanei_config2.lo

--- sane-backends-2004-10-09-cvs.orig/backend/Makefile.in       Sun Oct 
  3 19:39:43 2004
+++ sane-backends-2004-10-09-cvs/backend/Makefile.in    Sat Oct  9 
20:09:03 2004
@@ -365,7 +365,6 @@
  libsane-net.la: ../sanei/sanei_codec_bin.lo
  libsane-net.la: ../sanei/sanei_net.lo
  libsane-net.la: ../sanei/sanei_wire.lo
-libsane-niash.la: ../sanei/sanei_config2.lo
  libsane-niash.la: ../sanei/sanei_constrain_value.lo
  libsane-niash.la: ../sanei/sanei_usb.lo
  libsane-pint.la: ../sanei/sanei_constrain_value.lo

If this line is removed the linking works...

	Mattias