[sane-devel] SOLVED: scanimage and the net backend with cygwin

Philip Aston paston at bea.com
Sat Jan 28 13:02:47 UTC 2006


Thanks to a pointer from Henning Meier-Geinitz and SANE_DEBUG_DLL,
I now have sane built and the net backend working find under Cygwin.
This required another patch.

Henning, I apologise for responding directly to you on Thursday and
not to the list. I'd like to blame MS Outlook, but it was most
probably just me.

All three patches below.

Henning quite rightly questioned the "interfac" patch. Here's my
findings...

What gcc said with the unpatched source:

 make[1]: Entering directory `/opt/src/sane-backends-1.0.17/tools'
 gcc -c -g -O2 -W -Wall -DHAVE_CONFIG_H -I. -I. -I../include
-I../include -D_REENTRANT -DPATH_SANE_CONFIG_DIR=/usr/local/etc/sane.d
-DPATH_SANE_DATA_DIR=/usr/local/share
-DPATH_SANE_LOCK_DIR=/usr/local/var     -DV_MAJOR=1 -DV_MINOR=0
sane-find-scanner.c
 In file included from sane-find-scanner.c:41:
 ../include/sane/sanei_usb.h:381: error: parse error before ')' token
 ../include/sane/sanei_usb.h:399: error: parse error before ')' token

 % gcc -v
 Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
 Configured with: /gcc/gcc-3.4.4/gcc-3.4.4-1/configure --verbose
--prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc --enable-nls
--without-included-gettext --enable-version-specific-runtime-libs
--without-x --enable-libgcj --disable-java-awt --with-system-zlib
--enable-interpreter --disable-libgcj-debug --enable-threads=posix
--enable-java-gc=boehm --disable-win32-registry --enable-sjlj-exceptions
--enable-hash-synchronization --enable-libstdcxx-debug : (reconfigured) 
 Thread model: posix
 gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)

I guess "--enable-languages=c,ada,c++,d,f77,java,objc" is a hint
("interface" is a Java keyword). This is a standard gcc build from the
cygwin distro, so I think my fix is reasonable.

If there is a more appropriate way to submit these patches (e.g.
should I submit a bug report?) please tell me.

Regards,

- Phil


--- backend/dll.c.original      2006-01-28 12:24:08.857990400 +0000
+++ backend/dll.c       2006-01-28 12:40:13.835560000 +0000
@@ -108,6 +108,8 @@
 
 #if defined(HAVE_OS2_H)
 # define DIR_SEP        ";"
+#elif defined(__CYGWIN__)
+# define DIR_SEP        ":"
 #elif defined(HAVE_WINDOWS_H)
 # define DIR_SEP        ";"
 #else



--- snapscan-usb.c.original	2006-01-23 12:14:59.012552000 +0000
+++ snapscan-usb.c	2006-01-23 12:15:11.150004800 +0000
@@ -74,6 +74,15 @@
 #include "snapscan-usb.h"
 #include "snapscan-mutex.c"
 
+#ifndef SHM_R
+#define SHM_R 0
+#endif
+
+#ifndef SHM_W
+#define SHM_W 0
+#endif
+
+
 /* Global variables */
 
 static snapscan_mutex_t snapscan_mutex;


--- sanei_usb.original	2005-10-03 18:40:44.000000000 +0100
+++ sanei_usb.h	2006-01-23 12:06:27.797460800 +0000
@@ -378,7 +378,7 @@
  */
 
 extern SANE_Status
-sanei_usb_claim_interface (SANE_Int dn, SANE_Int interface);
+sanei_usb_claim_interface (SANE_Int dn, SANE_Int interfac);
 
 /** Initiate release interface.
  *
@@ -396,7 +396,7 @@
  */
 
 extern SANE_Status
-sanei_usb_release_interface (SANE_Int dn, SANE_Int interface);
+sanei_usb_release_interface (SANE_Int dn, SANE_Int interfac);
 
 /** Initiate a set altinterface.
  *




More information about the sane-devel mailing list