sane-project-website/old-archive/1998-03/0000.html

246 wiersze
8.5 KiB
HTML

<!-- received="Sun Mar 1 00:29:02 1998 PST" -->
<!-- sent="Sun, 1 Mar 1998 09:27:55 +0100 (CET)" -->
<!-- name="=?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?=" -->
<!-- email="mikko@dynas.se" -->
<!-- subject="Patches for sane on FreeBSD" -->
<!-- id="" -->
<!-- inreplyto="" -->
<title>sane-devel: Patches for sane on FreeBSD</title>
<h1>Patches for sane on FreeBSD</h1>
<b>=?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?=</b> (<a href="mailto:mikko@dynas.se"><i>mikko@dynas.se</i></a>)<br>
<i>Sun, 1 Mar 1998 09:27:55 +0100 (CET)</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#0">[ date ]</a><a href="index.html#0">[ thread ]</a><a href="subject.html#0">[ subject ]</a><a href="author.html#0">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0001.html">Erdmann Bloch: "sane unable to find mustek scanner 1200SP"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>
<!-- body="start" -->
Hi!<br>
<p>
Is this the right place to send patches?<br>
<p>
<p>
After some minor tweaking I got sane 0.71 up and running on both<br>
FreeBSD 2.2.5 and FreeBSD 3.0 (-CURRENT).<br>
<p>
I'm using an Agfa Snapscan 310. No idea how other backends may fare,<br>
but I see no reason why they should not work too.<br>
<p>
<p>
Now for the bad <a href="news:">news:</a><br>
<p>
So far xscanimage does not work well (for me) as a gimp-plugin (does<br>
not work with colour images, not even with the pnm backend). Is<br>
anyone successfully using gimp-0.99.18 + gtk-0.99.3 + sane-0.71?<br>
<p>
If I get the time, I'll build everything on a Sparc/Solaris and see if<br>
the same thing happens there, to rule out platform weirdness. Then<br>
maybe I'll see what "Purify" has to say... (the number of gimp<br>
warnings printed out is slightly unsettling...)<br>
<p>
NOTE: the configure script will leave out gimp support entirely if<br>
"&lt;libgimp/gimp.h&gt;" is not in the regular compiler search path.<br>
Using CPPFLAGS in environment when running configure is one workaround<br>
(e.g. configuring with "CPPFLAGS=-I/usr/X11R6/include ./configure")<br>
<p>
Summary:<br>
<p>
Platform: FreeBSD 2.2.5, FreeBSD 3.0<br>
SANE version tested: 0.71 (Gtk 0.99.3, Gimp 0.99.18)<br>
Compiler: Gcc<br>
User-level SCSI support: yes<br>
Shared library support: yes<br>
Dynamic loading support: yes<br>
X11 clients: yes (have not tested xcam)<br>
GIMP support: yes, thouhg it seems to need some debugging<br>
<p>
<p>
<p>
Regards,<br>
/Mikko<br>
<p>
--------8&lt;------------------------------------------------------------<br>
<p>
<p>
FreeBSD Patches (diffs for sane-0.71):<br>
<p>
If you are the trusting type, simply go to the sane-0.71 distribution<br>
directory and feed the rest of this message to "patch". If not, read<br>
on (it isn't all that much).<br>
<p>
<p>
Gcc gave up unless I did this (on Solaris too). Hope it was the right<br>
thing to do:<br>
<p>
--- sanei/sanei_ab306.c.org Tue Feb 24 22:13:38 1998<br>
+++ sanei/sanei_ab306.c Tue Feb 24 22:41:22 1998<br>
@@ -56,7 +56,7 @@<br>
static __inline__ void<br>
outb (u_char value, u_long port)<br>
{<br>
- __asm__ __volatile__ ("outb %0,%1" : : "a" value, "d" ((u_short) port));<br>
+ __asm__ __volatile__ ("outb %0,%1" : : "a" (value), "d" ((u_short) port));<br>
}<br>
<br>
static __inline__ u_char<br>
<p>
<p>
The "find-scanner" tool needed to be linked against the -lscsi lib,<br>
just like everything else (added $(LIBS) to link target):<br>
<p>
--- tools/Makefile.in.org Sat Feb 28 16:23:52 1998<br>
+++ tools/Makefile.in Sat Feb 28 16:25:07 1998<br>
@@ -32,6 +32,7 @@<br>
CPPFLAGS = @CPPFLAGS@<br>
CFLAGS = @CFLAGS@<br>
LDFLAGS = @LDFLAGS@<br>
+LIBS = @LIBS@<br>
DEFS = @DEFS@<br>
<br>
LIBTOOL = ../libtool<br>
@@ -63,7 +64,8 @@<br>
<br>
find-scanner: find-scanner.o \<br>
../sanei/sanei_scsi.lo ../sanei/sanei_init_debug.lo<br>
- @$(LIBTOOL) $(MLINK) $(LINK) find-scanner.o $(LIBSANEI) $(LIBLIB)<br>
+ @$(LIBTOOL) $(MLINK) $(LINK) find-scanner.o $(LIBSANEI) $(LIBLIB) \<br>
+ $(LIB)<br>
<br>
depend:<br>
makedepend $(INCLUDES) *.c<br>
<p>
<p>
A bit of a moot point -- anyone who has gotten around configuring the<br>
"unknown" scsi devices is likely to already have figured out where the<br>
scanner is. But I guess it doesn't hurt looking, so:<br>
<p>
--- tools/find-scanner.c.orig Tue Feb 24 06:23:17 1998<br>
+++ tools/find-scanner.c Sat Feb 28 10:05:15 1998<br>
@@ -347,7 +347,10 @@<br>
"/dev/scg2a", "/dev/scg2b", "/dev/scg2c", "/dev/scg2d",<br>
"/dev/scg2e", "/dev/scg2f", "/dev/scg2g",<br>
"/dev/sg/0", "/dev/sg/1", "/dev/sg/2", "/dev/sg/3",<br>
- "/dev/sg/4", "/dev/sg/5", "/dev/sg/6"<br>
+ "/dev/sg/4", "/dev/sg/5", "/dev/sg/6",<br>
+#elif defined(__FreeBSD__)<br>
+ "/dev/uk0", "/dev/uk1", "/dev/uk2", "/dev/uk3", "/dev/uk4",<br>
+ "/dev/uk5", "/dev/uk6",<br>
#endif<br>
0<br>
};<br>
<p>
The first changed line avoids a syntax error when building on Suns.<br>
<p>
<p>
Libtool kept printing out insults against the system linker, even<br>
though I know for a fact that it is possble to compile, link and<br>
install programs... After these changes it behaved more reasonably<br>
(it insisted on including the full path to the build directory for<br>
"libsane.so" in the binaries otherwise):<br>
<p>
--- ltconfig.org Tue Feb 24 22:23:48 1998<br>
+++ ltconfig Tue Feb 24 23:07:18 1998<br>
@@ -705,6 +705,15 @@<br>
hardcode_minus_L=yes<br>
;;<br>
<br>
+ freebsd2.2.[56]*) # The .6 is just a guess...<br>
+ runpath_var=LD_RUN_PATH<br>
+ archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs /usr/lib/c++rt0.o'<br>
+ hardcode_libdir_flag_spec='-R$libdir'<br>
+ hardcode_direct=yes<br>
+ hardcode_minus_L=no<br>
+ hardcode_shlibpath_var=no<br>
+ ;;<br>
+<br>
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor<br>
# support. Future versions do this automatically, but an explicit c++rt0.o<br>
# doesn't break anything, and helps significantly (at the cost of a little<br>
<p>
I suppose this should be sent to the "libtool" maintainer. I'm just<br>
including it for the benefit of any other FreeBSD users.<br>
<p>
On FreeBSD 3.0 it works directly out of the box, though.<br>
<p>
<p>
As I got a free SCSI card with the AGFA scanner, to my surprise I also<br>
found that it worked:<br>
<p>
--- doc/sane-scsi.man.org Tue Feb 24 22:33:09 1998<br>
+++ doc/sane-scsi.man Tue Feb 24 22:49:13 1998<br>
@@ -61,6 +61,16 @@<br>
.B aic<br>
driver.<br>
.TP<br>
+Adaptec 1505<br>
+Works on FreeBSD 2.2.5R and 3.0 using the<br>
+.B aic<br>
+driver, provided that Plug-and-Play support is disabled on the card.<br>
+If there are no<br>
+.I uk<br>
+devices, just do a "sh MAKEDEV uk0" in the "/dev" directory. The<br>
+scanner should then be accessible as "/dev/uk0" if it was probed<br>
+during boot.<br>
+.TP<br>
Tekram DC390<br>
Reported to work fine under FreeBSD 2.2.2R with the<br>
.B amd<br>
<p>
Now I'll have to find some other use for my old 1542B... Or, maybe<br>
not - the aic driver doesn't do dma, and the 1505 generates tons of<br>
interrupts, which slows down the system noticeably during scans.<br>
<p>
And last, xscanimage got floating exceptions on seemingly normal<br>
calculations when using the pnm backend. Recalling that there were<br>
similar problems with TCL, I dug up these lines from tcl-7.5:<br>
<p>
<p>
--- frontend/xscanimage.c.org Sat Feb 28 16:08:58 1998<br>
+++ frontend/xscanimage.c Sat Feb 28 10:46:01 1998<br>
@@ -59,6 +59,10 @@<br>
<br>
#include &lt;libgimp/gimp.h&gt;<br>
<br>
+#ifdef __FreeBSD__<br>
+# include &lt;floatingpoint.h&gt;<br>
+#endif<br>
+<br>
static void query (void);<br>
static void run (char *name, int nparams, GParam * param,<br>
int *nreturn_vals, GParam ** return_vals);<br>
@@ -1703,6 +1707,11 @@<br>
++prog_name;<br>
else<br>
prog_name = argv[0];<br>
+<br>
+#ifdef __FreeBSD__<br>
+ fpsetround(FP_RN);<br>
+ fpsetmask(0L);<br>
+#endif<br>
<br>
#ifdef HAVE_LIBGIMP_GIMP_H<br>
{<br>
<p>
<p>
Disclaimer: I have not bothered to look into all implications of this,<br>
but does seem to work.<br>
<p>
<p>
<p>
<pre>
--
Source code, list archive, and docs: <a href="http://www.mostang.com/sane/">http://www.mostang.com/sane/</a>
To unsubscribe: echo unsubscribe sane-devel | mail <a href="mailto:majordomo@mostang.com">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0001.html">Erdmann Bloch: "sane unable to find mustek scanner 1200SP"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>