sane-project-website/old-archive/2000-01/0131.html

871 wiersze
18 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: Libtool ltdl patch</TITLE>
<META NAME="Author" CONTENT="Petter Reinholdtsen (pere@hungry.com)">
<META NAME="Subject" CONTENT="Libtool ltdl patch">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Libtool ltdl patch</H1>
<!-- received="Mon Jan 17 17:31:16 2000" -->
<!-- isoreceived="20000118013116" -->
<!-- sent="Tue, 18 Jan 2000 09:35:20 +0800" -->
<!-- isosent="20000118013520" -->
<!-- name="Petter Reinholdtsen" -->
<!-- email="pere@hungry.com" -->
<!-- subject="Libtool ltdl patch" -->
<!-- id="200001180135.JAA29100@minerva.cc.uit.no" -->
<STRONG>From:</STRONG> Petter Reinholdtsen (<A HREF="mailto:pere@hungry.com?Subject=Re:%20Libtool%20ltdl%20patch&In-Reply-To=&lt;200001180135.JAA29100@minerva.cc.uit.no&gt;"><EM>pere@hungry.com</EM></A>)<BR>
<STRONG>Date:</STRONG> Mon Jan 17 2000 - 17:35:20 PST
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0132.html">Henry Miller: "Re: Microtek V6USL"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0130.html">Petter Reinholdtsen: "Re: forwarded message from Karl Heinz Kremer"</A>
<!-- nextthread="start" -->
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#131">[ date ]</A>
<A HREF="index.html#131">[ thread ]</A>
<A HREF="subject.html#131">[ subject ]</A>
<A HREF="author.html#131">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
Here is a patch to the dll backend to use libtool ltdl instead of
<BR>
native DLL methods. To test it, fetch the latest libtool distribution
<BR>
(or v1.3.3 which I used for testing), copy libltdl/ into the sane
<BR>
directory, applyl this patch and compile.
<BR>
<P>Please let me know which platforms you test this patch on.
<BR>
<P>Index: configure.in
<BR>
===================================================================
<BR>
RCS file: /cvsroot/external/sane/configure.in,v
<BR>
retrieving revision 1.1.1.1.2.6
<BR>
diff -u -r1.1.1.1.2.6 configure.in
<BR>
--- configure.in 2000/01/05 01:05:52 1.1.1.1.2.6
<BR>
+++ configure.in 2000/01/18 01:29:29
<BR>
@@ -91,8 +91,23 @@
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cfmakeraw tcsendbreak usleep strcasecmp strncasecmp _portaccess)
<BR>
&nbsp;
<BR>
&nbsp;dnl initialize libtool
<BR>
+dnl From Libtool v1.3.3 documentation, with addition of
<BR>
+dnl AC_LIBTOOL_WIN32_DLL
<BR>
+dnl
<BR>
+
<BR>
+dnl Enable building of the convenience library
<BR>
+dnl and set LIBLTDL accordingly
<BR>
+AC_LIBLTDL_CONVENIENCE
<BR>
+dnl Substitute INCLTDL and LIBLTDL in the Makefiles
<BR>
+AC_SUBST(INCLTDL)
<BR>
+AC_SUBST(LIBLTDL)
<BR>
+dnl Check for dlopen support
<BR>
+AC_LIBTOOL_DLOPEN
<BR>
+dnl Configure libtool
<BR>
&nbsp;AC_LIBTOOL_WIN32_DLL
<BR>
&nbsp;AM_PROG_LIBTOOL
<BR>
+dnl Configure libltdl
<BR>
+AC_CONFIG_SUBDIRS(libltdl)
<BR>
&nbsp;
<BR>
&nbsp;dnl Checks for libraries.
<BR>
&nbsp;
<BR>
Index: backend/Makefile.in
<BR>
===================================================================
<BR>
RCS file: /cvsroot/external/sane/backend/Makefile.in,v
<BR>
retrieving revision 1.1.1.1.2.1
<BR>
diff -u -r1.1.1.1.2.1 Makefile.in
<BR>
--- Makefile.in 1999/09/12 21:54:13 1.1.1.1.2.1
<BR>
+++ Makefile.in 2000/01/18 01:29:29
<BR>
@@ -36,10 +36,11 @@
<BR>
&nbsp;LN_S = @LN_S@
<BR>
&nbsp;
<BR>
&nbsp;CC = @CC@
<BR>
-INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include
<BR>
+INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include \
<BR>
+ -I$(top_srcdir)/libltdl
<BR>
&nbsp;CPPFLAGS = @CPPFLAGS@
<BR>
-CFLAGS = @CFLAGS@
<BR>
-LDFLAGS = @LDFLAGS@
<BR>
+CFLAGS = @CFLAGS@ @INCLTDL@
<BR>
+LDFLAGS = @LDFLAGS@ @LIBLTDL@
<BR>
&nbsp;DEFS = @DEFS@
<BR>
&nbsp;
<BR>
&nbsp;LIBTOOL = ../libtool
<BR>
@@ -66,7 +68,7 @@
<BR>
&nbsp;LIBOBJS = $(addprefix ../lib/,$(addsuffix .lo,$(LIBLIB_FUNCS)))
<BR>
&nbsp;
<BR>
&nbsp;libsane-%.la: %.lo %-s.lo $(EXTRA) $(LIBOBJS)
<BR>
- @$(LIBTOOL) $(MLINK) $(CC) -export-dynamic -o $@ $($*_LIBS) \
<BR>
+ @$(LIBTOOL) $(MLINK) $(CC) -export-dynamic -module -o $@ $($*_LIBS) \
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(LDFLAGS) $^ -rpath $(libsanedir) \
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-version-info $(V_MAJOR):$(V_REV):$(V_MINOR)
<BR>
&nbsp;
<BR>
@@ -124,28 +126,9 @@
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi; \
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;done
<BR>
&nbsp;
<BR>
-dll.lo: dll-preload.c
<BR>
-
<BR>
-dll-preload.c:
<BR>
- rm -f $@
<BR>
- list=&quot;$(DLL_PRELOAD)&quot;; for be in $$list; do \
<BR>
- echo &quot;PRELOAD_DECL($$be)&quot; &gt;&gt; $@; \
<BR>
- done
<BR>
- echo &quot;static struct backend preloaded_backends[] = {&quot; &gt;&gt; $@
<BR>
- sep=&quot;&quot;; \
<BR>
- list=&quot;$(DLL_PRELOAD)&quot;; \
<BR>
- if test -z &quot;$${list}&quot;; then \
<BR>
- echo { 0 } &gt;&gt; $@; \
<BR>
- else \
<BR>
- for be in $$list; do \
<BR>
- echo &quot;$${sep}PRELOAD_DEFN($$be)&quot; &gt;&gt; $@; \
<BR>
- sep=&quot;,&quot;; \
<BR>
- done; \
<BR>
- fi
<BR>
- echo &quot;};&quot; &gt;&gt; $@
<BR>
-
<BR>
&nbsp;libsane.la: dll.lo dll-s.lo $(EXTRA) $(addsuffix .lo,$(DLL_PRELOAD)) $(LIBOBJS)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@$(LIBTOOL) $(MLINK) $(CC) -o $@ $(LDFLAGS) $^ \
<BR>
+ -module -dlopen libsane-net.la \
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(addsuffix .lo,$(DLL_PRELOAD_EXTRAS)) \
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-rpath $(libdir) -version-info $(V_MAJOR):$(V_REV):$(V_MINOR)
<BR>
&nbsp;
<BR>
Index: backend/dll.c
<BR>
===================================================================
<BR>
RCS file: /cvsroot/external/sane/backend/dll.c,v
<BR>
retrieving revision 1.1.1.1.2.1
<BR>
diff -u -r1.1.1.1.2.1 dll.c
<BR>
--- dll.c 1999/08/12 09:53:03 1.1.1.1.2.1
<BR>
+++ dll.c 2000/01/18 01:29:31
<BR>
@@ -55,28 +55,8 @@
<BR>
&nbsp;#include &lt;stdlib.h&gt;
<BR>
&nbsp;#include &lt;string.h&gt;
<BR>
&nbsp;
<BR>
-#if defined(HAVE_DLOPEN) &amp;&amp; defined(HAVE_DLFCN_H)
<BR>
-# include &lt;dlfcn.h&gt;
<BR>
+#include &lt;ltdl.h&gt;
<BR>
&nbsp;
<BR>
- /* Older versions of dlopen() don't define RTLD_NOW and RTLD_LAZY.
<BR>
- They all seem to use a mode of 1 to indicate RTLD_NOW and some do
<BR>
- not support RTLD_LAZY at all. Hence, unless defined, we define
<BR>
- both macros as 1 to play it safe. */
<BR>
-# ifndef RTLD_NOW
<BR>
-# define RTLD_NOW 1
<BR>
-# endif
<BR>
-# ifndef RTLD_LAZY
<BR>
-# define RTLD_LAZY 1
<BR>
-# endif
<BR>
-# define HAVE_DLL
<BR>
-#endif
<BR>
-
<BR>
-/* HP/UX DLL support */
<BR>
-#if defined (HAVE_SHL_LOAD) &amp;&amp; defined(HAVE_DL_H)
<BR>
-# include &lt;dl.h&gt;
<BR>
-# define HAVE_DLL
<BR>
-#endif
<BR>
-
<BR>
&nbsp;#include &lt;sys/types.h&gt;
<BR>
&nbsp;
<BR>
&nbsp;#include &lt;sane/sane.h&gt;
<BR>
@@ -114,56 +94,12 @@
<BR>
&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct backend *next;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const char *name;
<BR>
- u_int permanent : 1; /* is the backend preloaded? */
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;u_int loaded : 1; /* are the functions available? */
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;u_int inited : 1; /* has the backend been initialized? */
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void *handle; /* handle returned by dlopen() */
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void *(*op[NUM_OPS]) ();
<BR>
&nbsp;&nbsp;&nbsp;};
<BR>
&nbsp;
<BR>
-#define BE_ENTRY(be,func) sane_##be##_##func
<BR>
-
<BR>
-#define PRELOAD_DECL(name) \
<BR>
- extern void *BE_ENTRY(name,init) (); \
<BR>
- extern void *BE_ENTRY(name,exit) (); \
<BR>
- extern void *BE_ENTRY(name,get_devices) (); \
<BR>
- extern void *BE_ENTRY(name,open) (); \
<BR>
- extern void *BE_ENTRY(name,close) (); \
<BR>
- extern void *BE_ENTRY(name,get_option_descriptor) (); \
<BR>
- extern void *BE_ENTRY(name,control_option) (); \
<BR>
- extern void *BE_ENTRY(name,get_parameters) (); \
<BR>
- extern void *BE_ENTRY(name,start) (); \
<BR>
- extern void *BE_ENTRY(name,read) (); \
<BR>
- extern void *BE_ENTRY(name,cancel) (); \
<BR>
- extern void *BE_ENTRY(name,set_io_mode) (); \
<BR>
- extern void *BE_ENTRY(name,get_select_fd) ();
<BR>
-
<BR>
-#define PRELOAD_DEFN(name) \
<BR>
-{ \
<BR>
- 0 /* next */, #name, \
<BR>
- 1 /* permanent */, \
<BR>
- 1 /* loaded */, \
<BR>
- 0 /* inited */, \
<BR>
- 0 /* handle */, \
<BR>
- { \
<BR>
- BE_ENTRY(name,init), \
<BR>
- BE_ENTRY(name,exit), \
<BR>
- BE_ENTRY(name,get_devices), \
<BR>
- BE_ENTRY(name,open), \
<BR>
- BE_ENTRY(name,close), \
<BR>
- BE_ENTRY(name,get_option_descriptor), \
<BR>
- BE_ENTRY(name,control_option), \
<BR>
- BE_ENTRY(name,get_parameters), \
<BR>
- BE_ENTRY(name,start), \
<BR>
- BE_ENTRY(name,read), \
<BR>
- BE_ENTRY(name,cancel), \
<BR>
- BE_ENTRY(name,set_io_mode), \
<BR>
- BE_ENTRY(name,get_select_fd) \
<BR>
- } \
<BR>
-}
<BR>
-
<BR>
-#include &quot;dll-preload.c&quot;
<BR>
-
<BR>
&nbsp;struct meta_scanner
<BR>
&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct backend *be;
<BR>
@@ -224,28 +160,19 @@
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*bep = be;
<BR>
&nbsp;&nbsp;&nbsp;return SANE_STATUS_GOOD;
<BR>
&nbsp;}
<BR>
+/* Generate the dll name to load. */
<BR>
+static void
<BR>
+map_dll_filename(char *buf, int bufsize, char *backendname)
<BR>
+{
<BR>
+ snprintf(buf, bufsize, &quot;libsane-%s&quot;, backendname);
<BR>
+}
<BR>
&nbsp;
<BR>
&nbsp;static SANE_Status
<BR>
&nbsp;load (struct backend *be)
<BR>
&nbsp;{
<BR>
-#ifdef HAVE_DLL
<BR>
- int mode = 0;
<BR>
- char *funcname, *src, *dir, *path = 0;
<BR>
+ char *funcname;
<BR>
&nbsp;&nbsp;&nbsp;char libname[PATH_MAX];
<BR>
&nbsp;&nbsp;&nbsp;int i;
<BR>
- FILE *fp = 0;
<BR>
-
<BR>
-#if defined(HAVE_DLOPEN)
<BR>
-# define PREFIX &quot;libsane-&quot;
<BR>
-# define POSTFIX &quot;.so.%u&quot;
<BR>
- mode = getenv (&quot;LD_BIND_NOW&quot;) ? RTLD_NOW : RTLD_LAZY;
<BR>
-#elif defined(HAVE_SHL_LOAD)
<BR>
-# define PREFIX &quot;libsane-&quot;
<BR>
-# define POSTFIX &quot;.sl.%u&quot;
<BR>
- mode = BIND_DEFERRED;
<BR>
-#else
<BR>
-# error &quot;Tried to compile unsupported DLL.&quot;
<BR>
-#endif /* HAVE_DLOPEN */
<BR>
&nbsp;
<BR>
&nbsp;&nbsp;&nbsp;DBG(1, &quot;loading backend %s\n&quot;, be-&gt;name);
<BR>
&nbsp;
<BR>
@@ -256,56 +183,15 @@
<BR>
&nbsp;&nbsp;&nbsp;for (i = 0; i &lt; NUM_OPS; ++i)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be-&gt;op[i] = op_unsupported;
<BR>
&nbsp;
<BR>
- dir = STRINGIFY(LIBDIR);
<BR>
- while (dir)
<BR>
- {
<BR>
- snprintf (libname, sizeof (libname), &quot;%s/&quot;PREFIX&quot;%s&quot;POSTFIX,
<BR>
- dir, be-&gt;name, V_MAJOR);
<BR>
- fp = fopen (libname, &quot;r&quot;);
<BR>
- if (fp)
<BR>
- break;
<BR>
-
<BR>
- if (!path)
<BR>
- {
<BR>
- path = getenv (&quot;LD_LIBRARY_PATH&quot;);
<BR>
- if (!path)
<BR>
- {
<BR>
- path = getenv (&quot;SHLIB_PATH&quot;); /* for HP-UX */
<BR>
- if (!path)
<BR>
- path = getenv (&quot;LIBPATH&quot;); /* for AIX */
<BR>
- }
<BR>
- if (!path)
<BR>
- break;
<BR>
+ map_dll_filename(libname, sizeof(libname), be-&gt;name);
<BR>
&nbsp;
<BR>
- path = strdup (path);
<BR>
- src = path;
<BR>
- }
<BR>
- dir = strsep (&amp;src, &quot;:&quot;);
<BR>
- }
<BR>
- if (path)
<BR>
- free (path);
<BR>
- if (!fp)
<BR>
- {
<BR>
- DBG(2, &quot;load: couldn't find %s (%s)\n&quot;,
<BR>
- libname, strerror (errno));
<BR>
- return SANE_STATUS_INVAL;
<BR>
- }
<BR>
&nbsp;&nbsp;&nbsp;DBG(2, &quot;dlopen()ing `%s'\n&quot;, libname);
<BR>
&nbsp;
<BR>
-#ifdef HAVE_DLOPEN
<BR>
- be-&gt;handle = dlopen (libname, mode);
<BR>
-#elif defined(HAVE_SHL_LOAD)
<BR>
- be-&gt;handle = (shl_t)shl_load (libname, mode, 0L);
<BR>
-#else
<BR>
-# error &quot;Tried to compile unsupported DLL.&quot;
<BR>
-#endif /* HAVE_DLOPEN */
<BR>
+ be-&gt;handle = lt_dlopenext(libname);
<BR>
+
<BR>
&nbsp;&nbsp;&nbsp;if (!be-&gt;handle)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
-#ifdef HAVE_DLOPEN
<BR>
- DBG(2, &quot;dlopen() failed (%s)\n&quot;, dlerror());
<BR>
-#else
<BR>
- DBG(2, &quot;dlopen() failed (%s)\n&quot;, strerror (errno));
<BR>
-#endif
<BR>
+ DBG(2, &quot;dlopen() failed (%s)\n&quot;, lt_dlerror());
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return SANE_STATUS_INVAL;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
&nbsp;
<BR>
@@ -314,45 +200,15 @@
<BR>
&nbsp;&nbsp;&nbsp;for (i = 0; i &lt; NUM_OPS; ++i)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void *(*op) ();
<BR>
-
<BR>
- sprintf (funcname, &quot;_sane_%s_%s&quot;, be-&gt;name, op_name[i]);
<BR>
-
<BR>
- /* First try looking up the symbol without a leading underscore. */
<BR>
-#ifdef HAVE_DLOPEN
<BR>
- op = (void *(*)()) dlsym (be-&gt;handle, funcname + 1);
<BR>
-#elif defined(HAVE_SHL_LOAD)
<BR>
- shl_findsym ((shl_t*)&amp;(be-&gt;handle), funcname + 1, TYPE_UNDEFINED, &amp;op);
<BR>
-#else
<BR>
-# error &quot;Tried to compile unsupported DLL.&quot;
<BR>
-#endif /* HAVE_DLOPEN */
<BR>
+ sprintf (funcname, &quot;sane_%s_%s&quot;, be-&gt;name, op_name[i]);
<BR>
+ op = lt_dlsym(be-&gt;handle, funcname);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (op)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be-&gt;op[i] = op;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else
<BR>
- {
<BR>
- /* Try again, with an underscore prepended. */
<BR>
-#ifdef HAVE_DLOPEN
<BR>
- op = (void *(*)()) dlsym (be-&gt;handle, funcname);
<BR>
-#elif defined(HAVE_SHL_LOAD)
<BR>
- shl_findsym (be-&gt;handle, funcname, TYPE_UNDEFINED, &amp;op);
<BR>
-#else
<BR>
-# error &quot;Tried to compile unsupported DLL.&quot;
<BR>
-#endif /* HAVE_DLOPEN */
<BR>
- if (op)
<BR>
- be-&gt;op[i] = op;
<BR>
- }
<BR>
- if (NULL == op)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DBG(2, &quot;unable to find %s\n&quot;, funcname);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
&nbsp;
<BR>
&nbsp;&nbsp;&nbsp;return SANE_STATUS_GOOD;
<BR>
-
<BR>
-# undef PREFIX
<BR>
-# undef POSTFIX
<BR>
-#else /* HAVE_DLL */
<BR>
- DBG(1, &quot;load: ignoring attempt to load `%s'; compiled without dl support\n&quot;,
<BR>
- be-&gt;name);
<BR>
- return SANE_STATUS_UNSUPPORTED;
<BR>
-#endif /* HAVE_DLL */
<BR>
&nbsp;}
<BR>
&nbsp;
<BR>
&nbsp;static SANE_Status
<BR>
@@ -388,24 +244,20 @@
<BR>
&nbsp;&nbsp;&nbsp;char backend_name[PATH_MAX];
<BR>
&nbsp;&nbsp;&nbsp;size_t len;
<BR>
&nbsp;&nbsp;&nbsp;FILE *fp;
<BR>
- int i;
<BR>
&nbsp;
<BR>
&nbsp;&nbsp;&nbsp;DBG_INIT();
<BR>
&nbsp;
<BR>
&nbsp;&nbsp;&nbsp;auth_callback = authorize;
<BR>
&nbsp;
<BR>
- /* chain preloaded backends together: */
<BR>
- for (i = 0; i &lt; NELEMS(preloaded_backends); ++i)
<BR>
- {
<BR>
- if (!preloaded_backends[i].name)
<BR>
- continue;
<BR>
- preloaded_backends[i].next = first_backend;
<BR>
- first_backend = &amp;preloaded_backends[i];
<BR>
- }
<BR>
-
<BR>
&nbsp;&nbsp;&nbsp;if (version_code)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*version_code = SANE_VERSION_CODE (V_MAJOR, V_MINOR, 0);
<BR>
&nbsp;
<BR>
+ lt_dlinit();
<BR>
+ lt_dladdsearchdir(STRINGIFY(LIBDIR));
<BR>
+
<BR>
+ DBG(1, &quot;entering (added %s)\n result path %s\n&quot;, STRINGIFY(LIBDIR),
<BR>
+ lt_dlgetsearchpath());
<BR>
+
<BR>
&nbsp;&nbsp;&nbsp;fp = sanei_config_open (DLL_CONFIG_FILE);
<BR>
&nbsp;&nbsp;&nbsp;if (!fp)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return SANE_STATUS_GOOD; /* don't insist on config file */
<BR>
@@ -442,28 +294,15 @@
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DBG(2, &quot;calling backend `%s's exit function\n&quot;, be-&gt;name);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(*be-&gt;op[OP_EXIT]) ();
<BR>
-#ifdef HAVE_DLL
<BR>
-
<BR>
-#ifdef HAVE_DLOPEN
<BR>
- if (be-&gt;handle)
<BR>
- dlclose (be-&gt;handle);
<BR>
-#elif defined(HAVE_SHL_LOAD)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (be-&gt;handle)
<BR>
- shl_unload(be-&gt;handle);
<BR>
-#else
<BR>
-# error &quot;Tried to compile unsupported DLL.&quot;
<BR>
-#endif /* HAVE_DLOPEN */
<BR>
-
<BR>
-#endif /* HAVE_DLL */
<BR>
- }
<BR>
- if (!be-&gt;permanent)
<BR>
- {
<BR>
- if (be-&gt;name)
<BR>
- free ((void *) be-&gt;name);
<BR>
- free (be);
<BR>
+ {
<BR>
+ lt_dlclose(be-&gt;handle);
<BR>
+ be-&gt;handle = NULL;
<BR>
+ }
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
&nbsp;&nbsp;&nbsp;first_backend = 0;
<BR>
+ lt_dlexit();
<BR>
&nbsp;}
<BR>
&nbsp;
<BR>
&nbsp;/* Note that a call to get_devices() implies that we'll have to load
<BR>
<P><PRE>
--
##&gt; Petter Reinholdtsen &lt;## | <A HREF="mailto:pere@td.org.uit.no?Subject=Re:%20Libtool%20ltdl%20patch&In-Reply-To=&lt;200001180135.JAA29100@minerva.cc.uit.no&gt;">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:%20Libtool%20ltdl%20patch&In-Reply-To=&lt;200001180135.JAA29100@minerva.cc.uit.no&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0132.html">Henry Miller: "Re: Microtek V6USL"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0130.html">Petter Reinholdtsen: "Re: forwarded message from Karl Heinz Kremer"</A>
<!-- nextthread="start" -->
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#131">[ date ]</A>
<A HREF="index.html#131">[ thread ]</A>
<A HREF="subject.html#131">[ subject ]</A>
<A HREF="author.html#131">[ 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>Mon Jan 17 2000 - 17:38:12 PST</EM>
</EM>
</SMALL>
</BODY>
</HTML>