kopia lustrzana https://gitlab.com/sane-project/website
196 wiersze
7.6 KiB
HTML
196 wiersze
7.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
|
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>sane-devel: Re: backends and external libraries</TITLE>
|
|
<META NAME="Author" CONTENT="Petter Reinholdtsen (pere@hungry.com)">
|
|
<META NAME="Subject" CONTENT="Re: backends and external libraries">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
|
|
<H1>Re: backends and external libraries</H1>
|
|
<!-- received="Fri Mar 10 17:54:50 2000" -->
|
|
<!-- isoreceived="20000311015450" -->
|
|
<!-- sent="Sat, 11 Mar 2000 09:58:56 +0800" -->
|
|
<!-- isosent="20000311015856" -->
|
|
<!-- name="Petter Reinholdtsen" -->
|
|
<!-- email="pere@hungry.com" -->
|
|
<!-- subject="Re: backends and external libraries" -->
|
|
<!-- id="200003110158.JAA27125@minerva.ee.uwa.edu.au" -->
|
|
<!-- inreplyto="backends and external libraries" -->
|
|
<STRONG>From:</STRONG> Petter Reinholdtsen (<A HREF="mailto:pere@hungry.com?Subject=Re:%20backends%20and%20external%20libraries&In-Reply-To=<200003110158.JAA27125@minerva.ee.uwa.edu.au>"><EM>pere@hungry.com</EM></A>)<BR>
|
|
<STRONG>Date:</STRONG> Fri Mar 10 2000 - 17:58:56 PST
|
|
<P>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0095.html">Anne Merritt: "HP4C + Symbios SCSI card"</A>
|
|
<UL>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0093.html">Oliver Rauch: "Re: xsane-0.57 freezes"</A>
|
|
<LI><STRONG>Maybe in reply to:</STRONG> <A HREF="0013.html">David Paschal: "backends and external libraries"</A>
|
|
<!-- nextthread="start" -->
|
|
<LI><STRONG>Next in thread:</STRONG> <A HREF="0095.html">Anne Merritt: "HP4C + Symbios SCSI card"</A>
|
|
<LI><STRONG>Reply:</STRONG> <A HREF="0095.html">Anne Merritt: "HP4C + Symbios SCSI card"</A>
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#94">[ date ]</A>
|
|
<A HREF="index.html#94">[ thread ]</A>
|
|
<A HREF="subject.html#94">[ subject ]</A>
|
|
<A HREF="author.html#94">[ author ]</A>
|
|
</UL>
|
|
<HR NOSHADE><P>
|
|
<!-- body="start" -->
|
|
<P>
|
|
<EM>> - Modify the configure.in (and generate a new ./configure) to check
|
|
</EM><BR>
|
|
<EM>> for the existence, version, and location of this external library
|
|
</EM><BR>
|
|
<EM>> (which I'm currently calling PTAL, for "Peripheral Transport
|
|
</EM><BR>
|
|
<EM>> Abstraction Library"). ./configure currently does something similar
|
|
</EM><BR>
|
|
<EM>> to check for GTK.
|
|
</EM><BR>
|
|
<P>To check the existence, add 'AC_CHECK_LIB(<lib>, <function_needed>)'
|
|
<BR>
|
|
and 'AC_CHECK_HEADERS(<libheader.h>)' in 'configure.in'. Update
|
|
<BR>
|
|
'include/sane/config.h.in' with the new defines. Then run 'autoconf'
|
|
<BR>
|
|
to make a new configure file.
|
|
<BR>
|
|
<P>To check the version, you can either check for two different functions
|
|
<BR>
|
|
using 'AC_CHECK_FUNCS(<function>) after you checked for the library to
|
|
<BR>
|
|
see which one of them are present, write your own test program to
|
|
<BR>
|
|
compare the library version against the requred version, or write a
|
|
<BR>
|
|
test program to return a header define and do the comparing in
|
|
<BR>
|
|
configure.in. I suggest the first method.
|
|
<BR>
|
|
<P><EM>> - If the library is not found, then build the HP SCL backend as usual
|
|
</EM><BR>
|
|
<EM>> to support the usual connection methods (SCSI, device, PIO). Disable
|
|
</EM><BR>
|
|
<EM>> the new HP DTF backend I'm working on to support the sheetfed
|
|
</EM><BR>
|
|
<EM>> OfficeJets and the LaserJet 1100A (which could be connected either
|
|
</EM><BR>
|
|
<EM>> to a LAN via an HP JetDirect external print server, or eventually to
|
|
</EM><BR>
|
|
<EM>> the parallel port on a workstation using a Linux kernel module).
|
|
</EM><BR>
|
|
<P>Check for the define HAVE_LIB<lib> to include code requiring the
|
|
<BR>
|
|
library.
|
|
<BR>
|
|
<P><EM>> - If the library is found, then enable the DTF backend. Use the gcc
|
|
</EM><BR>
|
|
<EM>> -D switch to pass in an extra #define to the HP SCL backend that
|
|
</EM><BR>
|
|
<EM>> enables my added code that interfaces with PTAL to support the
|
|
</EM><BR>
|
|
<EM>> SCL-based flatbed HP OfficeJets. What should I call this #define?
|
|
</EM><BR>
|
|
<EM>> "PTAL"? Or "HAVE_PTAL"?
|
|
</EM><BR>
|
|
<P>It will be called HAVE_LIBPTAL if the library is called libptal.a.
|
|
<BR>
|
|
<P><EM>> - When building PTAL-enabled backends, as well as versions of Peter
|
|
</EM><BR>
|
|
<EM>> Kirchgessner's hpinq and hpscan utilities that I've hacked to
|
|
</EM><BR>
|
|
<EM>> support PTAL, either statically or dynamically link the PTAL
|
|
</EM><BR>
|
|
<EM>> library to the corresponding backend or executable. I imagine
|
|
</EM><BR>
|
|
<EM>> dynamic linking would be preferable, but isn't it unavailable on
|
|
</EM><BR>
|
|
<EM>> certain platforms?
|
|
</EM><BR>
|
|
<P><EM>> And what would happen if both the SCL and DTF backends were
|
|
</EM><BR>
|
|
<EM>> running at the same time (i.e. under saned)?
|
|
</EM><BR>
|
|
<P>I'm not sure if I understand which problem you are describing here.
|
|
<BR>
|
|
<P><EM>> (Does PTAL need to be thread-safe, even through AFAIK none of its
|
|
</EM><BR>
|
|
<EM>> intended clients will be multi-threaded?)
|
|
</EM><BR>
|
|
<P>Why should it not be thread safe? All libraries should be thread
|
|
<BR>
|
|
safe. :-) It is currently not a requirement for SANE.
|
|
<BR>
|
|
<P><EM>> So are the above items all I need to do, or can somebody tell me
|
|
</EM><BR>
|
|
<EM>> what else I need to do?
|
|
</EM><BR>
|
|
<P>If your backend source is one set of files which conditional compile,
|
|
<BR>
|
|
the above should be work. If you have two set of backend files
|
|
<BR>
|
|
producing two different backends, you will need to add things like
|
|
<BR>
|
|
this to configure.in:
|
|
<BR>
|
|
<P> if test "${ac_cv_header_sys_socket_h}" = "no"; then
|
|
<BR>
|
|
echo "disabling NET backend"
|
|
<BR>
|
|
NET=
|
|
<BR>
|
|
else
|
|
<BR>
|
|
echo "enabling NET backend"
|
|
<BR>
|
|
NET=net
|
|
<BR>
|
|
fi
|
|
<BR>
|
|
AC_SUBST(NET)
|
|
<BR>
|
|
<P>The 'test'-part is checkig for a specific header file. It can also
|
|
<BR>
|
|
check for functions and libraries. The 'NET' keyword need to be in
|
|
<BR>
|
|
backend/Makefile.in, with '@' around it to be substituted when the
|
|
<BR>
|
|
backend is enabled.
|
|
<BR>
|
|
<PRE>
|
|
--
|
|
##> Petter Reinholdtsen <## | <A HREF="mailto:pere@td.org.uit.no?Subject=Re:%20backends%20and%20external%20libraries&In-Reply-To=<200003110158.JAA27125@minerva.ee.uwa.edu.au>">pere@td.org.uit.no</A>
|
|
<P>--
|
|
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?Subject=Re:%20backends%20and%20external%20libraries&In-Reply-To=<200003110158.JAA27125@minerva.ee.uwa.edu.au>">majordomo@mostang.com</A>
|
|
</PRE>
|
|
<P><!-- body="end" -->
|
|
<HR NOSHADE>
|
|
<UL>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0095.html">Anne Merritt: "HP4C + Symbios SCSI card"</A>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0093.html">Oliver Rauch: "Re: xsane-0.57 freezes"</A>
|
|
<LI><STRONG>Maybe in reply to:</STRONG> <A HREF="0013.html">David Paschal: "backends and external libraries"</A>
|
|
<!-- nextthread="start" -->
|
|
<LI><STRONG>Next in thread:</STRONG> <A HREF="0095.html">Anne Merritt: "HP4C + Symbios SCSI card"</A>
|
|
<LI><STRONG>Reply:</STRONG> <A HREF="0095.html">Anne Merritt: "HP4C + Symbios SCSI card"</A>
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#94">[ date ]</A>
|
|
<A HREF="index.html#94">[ thread ]</A>
|
|
<A HREF="subject.html#94">[ subject ]</A>
|
|
<A HREF="author.html#94">[ author ]</A>
|
|
</UL>
|
|
<!-- trailer="footer" -->
|
|
<HR NOSHADE>
|
|
<P>
|
|
<SMALL>
|
|
<EM>
|
|
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
|
|
: <EM>Fri Mar 10 2000 - 17:55:57 PST</EM>
|
|
</EM>
|
|
</SMALL>
|
|
</BODY>
|
|
</HTML>
|