[sane-devel] patch to make sane-backends compile and work on cygwin (cygwin without shared mem)

Martin meuk@olifantasia.com
Sun, 25 Jan 2004 18:43:16 +0100


This is a multi-part message in MIME format.
--------------030304050206040903000404
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi all,
I use sane on cygwin on windows 2000.
A little while back I hacked sane-backends to compile on cygwin (only for scsi scanners and no fork support)

Recently I found out that the official cvs version of sane-backends now supports cygwin (better than my hackwork).
It works wonderfully both with scsi as with usb scanners (thanks to libusb-win32)

I did however have to make two small changes to make it compile on my cygwin.
Disable the artec_eplus48u backend since it needs shared memory (not supported on all cygwin installations)
#undef interface  because some win32api include defines this and the name interface is used as a variable.

So if a recent sane snapshot does not compile on your cygwin installation try this patch.

The patch is made against the cvs version of sane-backends of 1 december 2003 (snapshot sane-backends-2003-12-01.tar.gz)

You can also find this patch on:
http://sourceforge.net/tracker/index.php?func=detail&aid=858540&group_id=71382&atid=531104
This is the patches page of
http://sourceforge.net/projects/hp5400backend/

I tested the patch with the microtek2 backend (parallel scsi, original windows driver has to be installed for the parallel scsi driver)
  and hp5400 backend (usb, using libusb-win32)
They both work fine

I hope this patch is of use for anyone.


greetings,
Martin Dvh

--------------030304050206040903000404
Content-Type: text/plain;
 name="sane_cygwin.patch.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="sane_cygwin.patch.txt"

diff -urN sane-backends_orig/backend/dll.conf sane-backends/backend/dll.conf
--- sane-backends_orig/backend/dll.conf	2003-11-24 09:53:30.000000000 +0100
+++ sane-backends/backend/dll.conf	2003-12-02 01:41:50.000000000 +0100
@@ -5,7 +5,7 @@
 apple
 avision
 artec
-artec_eplus48u
+#artec_eplus48u
 as6e
 bh
 canon
diff -urN sane-backends_orig/configure sane-backends/configure
--- sane-backends_orig/configure	2003-11-24 09:53:30.000000000 +0100
+++ sane-backends/configure	2003-12-02 01:39:56.000000000 +0100
@@ -23919,7 +23919,8 @@
           microtek2 mustek mustek_pp mustek_usb nec pie plustek \
           plustek_pp ricoh s9036 sceptre sharp \
           sp15c st400 tamarack test teco1 teco2 teco3 umax umax_pp umax1220u \
-          artec_eplus48u ma1509 ibm hp5400"
+          ma1509 ibm hp5400"
+    BACKENDS_THAT_NEEDSHARED_MEM="artec_eplus48u"
 
   if test "${sane_cv_use_libjpeg}" != "yes"; then
     echo "*** disabling DC210 backend (failed to find JPEG library)"
diff -urN sane-backends_orig/configure.in sane-backends/configure.in
--- sane-backends_orig/configure.in	2003-11-24 09:53:30.000000000 +0100
+++ sane-backends/configure.in	2003-12-02 01:40:32.000000000 +0100
@@ -280,7 +280,8 @@
           microtek2 mustek mustek_pp mustek_usb nec pie plustek \
           plustek_pp ricoh s9036 sceptre sharp \
           sp15c st400 tamarack test teco1 teco2 teco3 umax umax_pp umax1220u \
-          artec_eplus48u ma1509 ibm hp5400"
+          ma1509 ibm hp5400"
+  BACKENDS_THAT_NEEDSHARED_MEM="artec_eplus48u"
 
   if test "${sane_cv_use_libjpeg}" != "yes"; then
     echo "*** disabling DC210 backend (failed to find JPEG library)"
diff -urN sane-backends_orig/tools/sane-find-scanner.c sane-backends/tools/sane-find-scanner.c
--- sane-backends_orig/tools/sane-find-scanner.c	2003-09-24 05:41:48.000000000 +0200
+++ sane-backends/tools/sane-find-scanner.c	2003-12-02 02:15:54.000000000 +0100
@@ -40,6 +40,9 @@
 #include <ddk/scsi.h>
 #include <ddk/ntddscsi.h>
 #endif
+#ifdef interface
+#undef interface
+#endif
 
 #include "../include/sane/sanei.h"
 #include "../include/sane/sanei_scsi.h"

--------------030304050206040903000404--