From 1dd768d5340eb7e85abfec401321b5523ddf8284 Mon Sep 17 00:00:00 2001 From: Chris Bagwell Date: Sun, 6 Nov 2011 16:39:06 -0600 Subject: [PATCH] Do not link in preload backends for libsane-dll Current backend/Makefile.am states difference between libsane and libsane-dll as: > libsane.la and libsane-dll.la are the same thing except for > the addition of backends listed by PRELOADABLE_BACKENDS that are > statically linked in. We were (mistakenly) linking in dll-preload.h and thus symbols for all preload backends for both libraries but we were only linking in those symbols for libsane. This mistake became obvious on mingw which does not allow for any unresolved symbols. Resolve by forcing an empty preload backend list for libsane-dll. --- backend/Makefile.am | 2 +- backend/Makefile.in | 2 +- backend/dll.c | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/Makefile.am b/backend/Makefile.am index a48d5ab71..8a13a87ce 100644 --- a/backend/Makefile.am +++ b/backend/Makefile.am @@ -1107,7 +1107,7 @@ EXTRA_DIST += dll.aliases # Need to update configure to build a list of only what needs to go into # LIBADD based on whats being preloaded. nodist_libsane_la_SOURCES = dll-s.c -libsane_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll +libsane_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll -DENABLE_PRELOAD libsane_la_LDFLAGS = $(DIST_LIBS_LDFLAGS) libsane_la_LIBADD = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo $(DL_LIBS) $(LIBV4L_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(GPHOTO2_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(AVAHI_LIBS) $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) diff --git a/backend/Makefile.in b/backend/Makefile.in index 555ad67ca..39bebe750 100644 --- a/backend/Makefile.in +++ b/backend/Makefile.in @@ -2439,7 +2439,7 @@ libsane_dll_la_LIBADD = $(COMMON_LIBS) libdll.la ../sanei/sanei_init_debug.lo .. # Need to update configure to build a list of only what needs to go into # LIBADD based on whats being preloaded. nodist_libsane_la_SOURCES = dll-s.c -libsane_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll +libsane_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll -DENABLE_PRELOAD libsane_la_LDFLAGS = $(DIST_LIBS_LDFLAGS) libsane_la_LIBADD = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo $(DL_LIBS) $(LIBV4L_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(GPHOTO2_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(AVAHI_LIBS) $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) diff --git a/backend/dll.c b/backend/dll.c index b6ba9afd6..8e893e622 100644 --- a/backend/dll.c +++ b/backend/dll.c @@ -211,7 +211,13 @@ struct backend } #ifndef __BEOS__ +#ifdef ENABLE_PRELOAD #include "dll-preload.h" +#else +static struct backend preloaded_backends[] = { + { 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }} +}; +#endif #endif struct meta_scanner