kopia lustrzana https://gitlab.com/sane-project/website
871 wiersze
18 KiB
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=<200001180135.JAA29100@minerva.cc.uit.no>"><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>
|
|
cfmakeraw tcsendbreak usleep strcasecmp strncasecmp _portaccess)
|
|
<BR>
|
|
|
|
<BR>
|
|
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>
|
|
AC_LIBTOOL_WIN32_DLL
|
|
<BR>
|
|
AM_PROG_LIBTOOL
|
|
<BR>
|
|
+dnl Configure libltdl
|
|
<BR>
|
|
+AC_CONFIG_SUBDIRS(libltdl)
|
|
<BR>
|
|
|
|
<BR>
|
|
dnl Checks for libraries.
|
|
<BR>
|
|
|
|
<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>
|
|
LN_S = @LN_S@
|
|
<BR>
|
|
|
|
<BR>
|
|
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>
|
|
CPPFLAGS = @CPPFLAGS@
|
|
<BR>
|
|
-CFLAGS = @CFLAGS@
|
|
<BR>
|
|
-LDFLAGS = @LDFLAGS@
|
|
<BR>
|
|
+CFLAGS = @CFLAGS@ @INCLTDL@
|
|
<BR>
|
|
+LDFLAGS = @LDFLAGS@ @LIBLTDL@
|
|
<BR>
|
|
DEFS = @DEFS@
|
|
<BR>
|
|
|
|
<BR>
|
|
LIBTOOL = ../libtool
|
|
<BR>
|
|
@@ -66,7 +68,7 @@
|
|
<BR>
|
|
LIBOBJS = $(addprefix ../lib/,$(addsuffix .lo,$(LIBLIB_FUNCS)))
|
|
<BR>
|
|
|
|
<BR>
|
|
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>
|
|
$(LDFLAGS) $^ -rpath $(libsanedir) \
|
|
<BR>
|
|
-version-info $(V_MAJOR):$(V_REV):$(V_MINOR)
|
|
<BR>
|
|
|
|
<BR>
|
|
@@ -124,28 +126,9 @@
|
|
<BR>
|
|
fi; \
|
|
<BR>
|
|
done
|
|
<BR>
|
|
|
|
<BR>
|
|
-dll.lo: dll-preload.c
|
|
<BR>
|
|
-
|
|
<BR>
|
|
-dll-preload.c:
|
|
<BR>
|
|
- rm -f $@
|
|
<BR>
|
|
- list="$(DLL_PRELOAD)"; for be in $$list; do \
|
|
<BR>
|
|
- echo "PRELOAD_DECL($$be)" >> $@; \
|
|
<BR>
|
|
- done
|
|
<BR>
|
|
- echo "static struct backend preloaded_backends[] = {" >> $@
|
|
<BR>
|
|
- sep=""; \
|
|
<BR>
|
|
- list="$(DLL_PRELOAD)"; \
|
|
<BR>
|
|
- if test -z "$${list}"; then \
|
|
<BR>
|
|
- echo { 0 } >> $@; \
|
|
<BR>
|
|
- else \
|
|
<BR>
|
|
- for be in $$list; do \
|
|
<BR>
|
|
- echo "$${sep}PRELOAD_DEFN($$be)" >> $@; \
|
|
<BR>
|
|
- sep=","; \
|
|
<BR>
|
|
- done; \
|
|
<BR>
|
|
- fi
|
|
<BR>
|
|
- echo "};" >> $@
|
|
<BR>
|
|
-
|
|
<BR>
|
|
libsane.la: dll.lo dll-s.lo $(EXTRA) $(addsuffix .lo,$(DLL_PRELOAD)) $(LIBOBJS)
|
|
<BR>
|
|
@$(LIBTOOL) $(MLINK) $(CC) -o $@ $(LDFLAGS) $^ \
|
|
<BR>
|
|
+ -module -dlopen libsane-net.la \
|
|
<BR>
|
|
$(addsuffix .lo,$(DLL_PRELOAD_EXTRAS)) \
|
|
<BR>
|
|
-rpath $(libdir) -version-info $(V_MAJOR):$(V_REV):$(V_MINOR)
|
|
<BR>
|
|
|
|
<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>
|
|
#include <stdlib.h>
|
|
<BR>
|
|
#include <string.h>
|
|
<BR>
|
|
|
|
<BR>
|
|
-#if defined(HAVE_DLOPEN) && defined(HAVE_DLFCN_H)
|
|
<BR>
|
|
-# include <dlfcn.h>
|
|
<BR>
|
|
+#include <ltdl.h>
|
|
<BR>
|
|
|
|
<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) && defined(HAVE_DL_H)
|
|
<BR>
|
|
-# include <dl.h>
|
|
<BR>
|
|
-# define HAVE_DLL
|
|
<BR>
|
|
-#endif
|
|
<BR>
|
|
-
|
|
<BR>
|
|
#include <sys/types.h>
|
|
<BR>
|
|
|
|
<BR>
|
|
#include <sane/sane.h>
|
|
<BR>
|
|
@@ -114,56 +94,12 @@
|
|
<BR>
|
|
{
|
|
<BR>
|
|
struct backend *next;
|
|
<BR>
|
|
const char *name;
|
|
<BR>
|
|
- u_int permanent : 1; /* is the backend preloaded? */
|
|
<BR>
|
|
u_int loaded : 1; /* are the functions available? */
|
|
<BR>
|
|
u_int inited : 1; /* has the backend been initialized? */
|
|
<BR>
|
|
void *handle; /* handle returned by dlopen() */
|
|
<BR>
|
|
void *(*op[NUM_OPS]) ();
|
|
<BR>
|
|
};
|
|
<BR>
|
|
|
|
<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 "dll-preload.c"
|
|
<BR>
|
|
-
|
|
<BR>
|
|
struct meta_scanner
|
|
<BR>
|
|
{
|
|
<BR>
|
|
struct backend *be;
|
|
<BR>
|
|
@@ -224,28 +160,19 @@
|
|
<BR>
|
|
*bep = be;
|
|
<BR>
|
|
return SANE_STATUS_GOOD;
|
|
<BR>
|
|
}
|
|
<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, "libsane-%s", backendname);
|
|
<BR>
|
|
+}
|
|
<BR>
|
|
|
|
<BR>
|
|
static SANE_Status
|
|
<BR>
|
|
load (struct backend *be)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
-#ifdef HAVE_DLL
|
|
<BR>
|
|
- int mode = 0;
|
|
<BR>
|
|
- char *funcname, *src, *dir, *path = 0;
|
|
<BR>
|
|
+ char *funcname;
|
|
<BR>
|
|
char libname[PATH_MAX];
|
|
<BR>
|
|
int i;
|
|
<BR>
|
|
- FILE *fp = 0;
|
|
<BR>
|
|
-
|
|
<BR>
|
|
-#if defined(HAVE_DLOPEN)
|
|
<BR>
|
|
-# define PREFIX "libsane-"
|
|
<BR>
|
|
-# define POSTFIX ".so.%u"
|
|
<BR>
|
|
- mode = getenv ("LD_BIND_NOW") ? RTLD_NOW : RTLD_LAZY;
|
|
<BR>
|
|
-#elif defined(HAVE_SHL_LOAD)
|
|
<BR>
|
|
-# define PREFIX "libsane-"
|
|
<BR>
|
|
-# define POSTFIX ".sl.%u"
|
|
<BR>
|
|
- mode = BIND_DEFERRED;
|
|
<BR>
|
|
-#else
|
|
<BR>
|
|
-# error "Tried to compile unsupported DLL."
|
|
<BR>
|
|
-#endif /* HAVE_DLOPEN */
|
|
<BR>
|
|
|
|
<BR>
|
|
DBG(1, "loading backend %s\n", be->name);
|
|
<BR>
|
|
|
|
<BR>
|
|
@@ -256,56 +183,15 @@
|
|
<BR>
|
|
for (i = 0; i < NUM_OPS; ++i)
|
|
<BR>
|
|
be->op[i] = op_unsupported;
|
|
<BR>
|
|
|
|
<BR>
|
|
- dir = STRINGIFY(LIBDIR);
|
|
<BR>
|
|
- while (dir)
|
|
<BR>
|
|
- {
|
|
<BR>
|
|
- snprintf (libname, sizeof (libname), "%s/"PREFIX"%s"POSTFIX,
|
|
<BR>
|
|
- dir, be->name, V_MAJOR);
|
|
<BR>
|
|
- fp = fopen (libname, "r");
|
|
<BR>
|
|
- if (fp)
|
|
<BR>
|
|
- break;
|
|
<BR>
|
|
-
|
|
<BR>
|
|
- if (!path)
|
|
<BR>
|
|
- {
|
|
<BR>
|
|
- path = getenv ("LD_LIBRARY_PATH");
|
|
<BR>
|
|
- if (!path)
|
|
<BR>
|
|
- {
|
|
<BR>
|
|
- path = getenv ("SHLIB_PATH"); /* for HP-UX */
|
|
<BR>
|
|
- if (!path)
|
|
<BR>
|
|
- path = getenv ("LIBPATH"); /* for AIX */
|
|
<BR>
|
|
- }
|
|
<BR>
|
|
- if (!path)
|
|
<BR>
|
|
- break;
|
|
<BR>
|
|
+ map_dll_filename(libname, sizeof(libname), be->name);
|
|
<BR>
|
|
|
|
<BR>
|
|
- path = strdup (path);
|
|
<BR>
|
|
- src = path;
|
|
<BR>
|
|
- }
|
|
<BR>
|
|
- dir = strsep (&src, ":");
|
|
<BR>
|
|
- }
|
|
<BR>
|
|
- if (path)
|
|
<BR>
|
|
- free (path);
|
|
<BR>
|
|
- if (!fp)
|
|
<BR>
|
|
- {
|
|
<BR>
|
|
- DBG(2, "load: couldn't find %s (%s)\n",
|
|
<BR>
|
|
- libname, strerror (errno));
|
|
<BR>
|
|
- return SANE_STATUS_INVAL;
|
|
<BR>
|
|
- }
|
|
<BR>
|
|
DBG(2, "dlopen()ing `%s'\n", libname);
|
|
<BR>
|
|
|
|
<BR>
|
|
-#ifdef HAVE_DLOPEN
|
|
<BR>
|
|
- be->handle = dlopen (libname, mode);
|
|
<BR>
|
|
-#elif defined(HAVE_SHL_LOAD)
|
|
<BR>
|
|
- be->handle = (shl_t)shl_load (libname, mode, 0L);
|
|
<BR>
|
|
-#else
|
|
<BR>
|
|
-# error "Tried to compile unsupported DLL."
|
|
<BR>
|
|
-#endif /* HAVE_DLOPEN */
|
|
<BR>
|
|
+ be->handle = lt_dlopenext(libname);
|
|
<BR>
|
|
+
|
|
<BR>
|
|
if (!be->handle)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
-#ifdef HAVE_DLOPEN
|
|
<BR>
|
|
- DBG(2, "dlopen() failed (%s)\n", dlerror());
|
|
<BR>
|
|
-#else
|
|
<BR>
|
|
- DBG(2, "dlopen() failed (%s)\n", strerror (errno));
|
|
<BR>
|
|
-#endif
|
|
<BR>
|
|
+ DBG(2, "dlopen() failed (%s)\n", lt_dlerror());
|
|
<BR>
|
|
return SANE_STATUS_INVAL;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
|
|
<BR>
|
|
@@ -314,45 +200,15 @@
|
|
<BR>
|
|
for (i = 0; i < NUM_OPS; ++i)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
void *(*op) ();
|
|
<BR>
|
|
-
|
|
<BR>
|
|
- sprintf (funcname, "_sane_%s_%s", be->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->handle, funcname + 1);
|
|
<BR>
|
|
-#elif defined(HAVE_SHL_LOAD)
|
|
<BR>
|
|
- shl_findsym ((shl_t*)&(be->handle), funcname + 1, TYPE_UNDEFINED, &op);
|
|
<BR>
|
|
-#else
|
|
<BR>
|
|
-# error "Tried to compile unsupported DLL."
|
|
<BR>
|
|
-#endif /* HAVE_DLOPEN */
|
|
<BR>
|
|
+ sprintf (funcname, "sane_%s_%s", be->name, op_name[i]);
|
|
<BR>
|
|
+ op = lt_dlsym(be->handle, funcname);
|
|
<BR>
|
|
if (op)
|
|
<BR>
|
|
be->op[i] = op;
|
|
<BR>
|
|
else
|
|
<BR>
|
|
- {
|
|
<BR>
|
|
- /* Try again, with an underscore prepended. */
|
|
<BR>
|
|
-#ifdef HAVE_DLOPEN
|
|
<BR>
|
|
- op = (void *(*)()) dlsym (be->handle, funcname);
|
|
<BR>
|
|
-#elif defined(HAVE_SHL_LOAD)
|
|
<BR>
|
|
- shl_findsym (be->handle, funcname, TYPE_UNDEFINED, &op);
|
|
<BR>
|
|
-#else
|
|
<BR>
|
|
-# error "Tried to compile unsupported DLL."
|
|
<BR>
|
|
-#endif /* HAVE_DLOPEN */
|
|
<BR>
|
|
- if (op)
|
|
<BR>
|
|
- be->op[i] = op;
|
|
<BR>
|
|
- }
|
|
<BR>
|
|
- if (NULL == op)
|
|
<BR>
|
|
DBG(2, "unable to find %s\n", funcname);
|
|
<BR>
|
|
}
|
|
<BR>
|
|
|
|
<BR>
|
|
return SANE_STATUS_GOOD;
|
|
<BR>
|
|
-
|
|
<BR>
|
|
-# undef PREFIX
|
|
<BR>
|
|
-# undef POSTFIX
|
|
<BR>
|
|
-#else /* HAVE_DLL */
|
|
<BR>
|
|
- DBG(1, "load: ignoring attempt to load `%s'; compiled without dl support\n",
|
|
<BR>
|
|
- be->name);
|
|
<BR>
|
|
- return SANE_STATUS_UNSUPPORTED;
|
|
<BR>
|
|
-#endif /* HAVE_DLL */
|
|
<BR>
|
|
}
|
|
<BR>
|
|
|
|
<BR>
|
|
static SANE_Status
|
|
<BR>
|
|
@@ -388,24 +244,20 @@
|
|
<BR>
|
|
char backend_name[PATH_MAX];
|
|
<BR>
|
|
size_t len;
|
|
<BR>
|
|
FILE *fp;
|
|
<BR>
|
|
- int i;
|
|
<BR>
|
|
|
|
<BR>
|
|
DBG_INIT();
|
|
<BR>
|
|
|
|
<BR>
|
|
auth_callback = authorize;
|
|
<BR>
|
|
|
|
<BR>
|
|
- /* chain preloaded backends together: */
|
|
<BR>
|
|
- for (i = 0; i < NELEMS(preloaded_backends); ++i)
|
|
<BR>
|
|
- {
|
|
<BR>
|
|
- if (!preloaded_backends[i].name)
|
|
<BR>
|
|
- continue;
|
|
<BR>
|
|
- preloaded_backends[i].next = first_backend;
|
|
<BR>
|
|
- first_backend = &preloaded_backends[i];
|
|
<BR>
|
|
- }
|
|
<BR>
|
|
-
|
|
<BR>
|
|
if (version_code)
|
|
<BR>
|
|
*version_code = SANE_VERSION_CODE (V_MAJOR, V_MINOR, 0);
|
|
<BR>
|
|
|
|
<BR>
|
|
+ lt_dlinit();
|
|
<BR>
|
|
+ lt_dladdsearchdir(STRINGIFY(LIBDIR));
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ DBG(1, "entering (added %s)\n result path %s\n", STRINGIFY(LIBDIR),
|
|
<BR>
|
|
+ lt_dlgetsearchpath());
|
|
<BR>
|
|
+
|
|
<BR>
|
|
fp = sanei_config_open (DLL_CONFIG_FILE);
|
|
<BR>
|
|
if (!fp)
|
|
<BR>
|
|
return SANE_STATUS_GOOD; /* don't insist on config file */
|
|
<BR>
|
|
@@ -442,28 +294,15 @@
|
|
<BR>
|
|
{
|
|
<BR>
|
|
DBG(2, "calling backend `%s's exit function\n", be->name);
|
|
<BR>
|
|
(*be->op[OP_EXIT]) ();
|
|
<BR>
|
|
-#ifdef HAVE_DLL
|
|
<BR>
|
|
-
|
|
<BR>
|
|
-#ifdef HAVE_DLOPEN
|
|
<BR>
|
|
- if (be->handle)
|
|
<BR>
|
|
- dlclose (be->handle);
|
|
<BR>
|
|
-#elif defined(HAVE_SHL_LOAD)
|
|
<BR>
|
|
if (be->handle)
|
|
<BR>
|
|
- shl_unload(be->handle);
|
|
<BR>
|
|
-#else
|
|
<BR>
|
|
-# error "Tried to compile unsupported DLL."
|
|
<BR>
|
|
-#endif /* HAVE_DLOPEN */
|
|
<BR>
|
|
-
|
|
<BR>
|
|
-#endif /* HAVE_DLL */
|
|
<BR>
|
|
- }
|
|
<BR>
|
|
- if (!be->permanent)
|
|
<BR>
|
|
- {
|
|
<BR>
|
|
- if (be->name)
|
|
<BR>
|
|
- free ((void *) be->name);
|
|
<BR>
|
|
- free (be);
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ lt_dlclose(be->handle);
|
|
<BR>
|
|
+ be->handle = NULL;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
}
|
|
<BR>
|
|
}
|
|
<BR>
|
|
first_backend = 0;
|
|
<BR>
|
|
+ lt_dlexit();
|
|
<BR>
|
|
}
|
|
<BR>
|
|
|
|
<BR>
|
|
/* Note that a call to get_devices() implies that we'll have to load
|
|
<BR>
|
|
<P><PRE>
|
|
--
|
|
##> Petter Reinholdtsen <## | <A HREF="mailto:pere@td.org.uit.no?Subject=Re:%20Libtool%20ltdl%20patch&In-Reply-To=<200001180135.JAA29100@minerva.cc.uit.no>">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=<200001180135.JAA29100@minerva.cc.uit.no>">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>
|