[sane-devel] MacOS X SCSI support and other changes in SANE CVS

Peter O'Gorman peter@pogma.com
Sat, 3 May 2003 00:05:03 +0900


--Apple-Mail-4-566259865
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed


On Friday, May 2, 2003, at 06:44  PM, Henning Meier-Geinitz wrote:
>
> About which symbol is the linker complaining if you use the old link
> order?

Fails to build with the original posters error (multiple definitions of 
the getopt symbols).

> Oh well, I thought Darwin some sort of Unix? :-)

It is, there seems to be a poll emulation library available at 
<http://www.clapper.org/software/poll/> which might do the right thing 
here.

The attached patch builds against the latest Mac OS X snapshot. Don't 
know if it works as my scanner is in the baby's room and the baby is 
sleeping :)

Should build fine on linux et. al. too. Basically just adds the 
"-all_load" flag to the link line when liblib.a is there so that all 
members of the static archive are loaded ( I am not really sure why 
this is necessary ).

Thanks,
Peter



--Apple-Mail-4-566259865
Content-Disposition: attachment;
	filename=sane.2.diff
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="sane.2.diff"

diff -urN sane-backends.orig/configure.in sane-backends/configure.in
--- sane-backends.orig/configure.in	Fri May  2 17:51:22 2003
+++ sane-backends/configure.in	Fri May  2 23:28:00 2003
@@ -89,6 +89,11 @@
     AC_CHECK_LIB(socket, socket)
     AC_CHECK_LIB(syslog, syslog)            # OS/2 needs this
 fi
+dnl ugh bad test...
+if test "`uname`" = "Darwin" ; then
+LIBLIBFLAGS="-all_load"
+fi
+AC_SUBST(LIBLIBFLAGS)
 SANE_CHECK_JPEG
 SANE_CHECK_IEEE1284
 SANE_CHECK_GPHOTO2
diff -urN sane-backends.orig/frontend/Makefile.in sane-backends/frontend/Makefile.in
--- sane-backends.orig/frontend/Makefile.in	Fri May  2 17:45:11 2003
+++ sane-backends/frontend/Makefile.in	Fri May  2 23:29:44 2003
@@ -38,6 +38,7 @@
 CFLAGS = @CFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
+LIBLIBFLAGS = @LIBLIBFLAGS@
 
 LIBTOOL = ../libtool
 MINST	= --mode=install
@@ -90,19 +91,19 @@
 	done
 
 test: test.o $(LIBSANE) $(LIBLIB)
-	@$(LIBTOOL) $(MLINK) $(LINK) test.o $(LIBSANE) $(LIBLIB) $(LIBS)
+	@$(LIBTOOL) $(MLINK) $(LINK) test.o $(LIBSANE) $(LIBLIBFLAGS) $(LIBLIB) $(LIBS)
 
 saned: saned.o $(LIBSANEI) $(LIBSANE) $(LIBLIB)
-	@$(LIBTOOL) $(MLINK) $(LINK) saned.o $(LIBSANEI) $(LIBSANE) $(LIBLIB) \
+	@$(LIBTOOL) $(MLINK) $(LINK) saned.o $(LIBSANEI) $(LIBSANE) $(LIBLIBFLAGS) $(LIBLIB) \
 		$(LIBS)
 
 scanimage: $(SCAN_OBJS) $(LIBSANE) $(LIBLIB)
-	@$(LIBTOOL) $(MLINK) $(LINK) $(SCAN_OBJS) $(LIBSANE) $(LIBLIB) $(LIBS)
+	@$(LIBTOOL) $(MLINK) $(LINK) $(SCAN_OBJS) $(LIBSANE) $(LIBLIBFLAGS) $(LIBLIB) $(LIBS)
 
 # tstbackend is not compiled by default. 
 # To compile it, add tstbackend to BINPROGS.
 tstbackend: tstbackend.o $(LIBSANE) $(LIBLIB)
-	@$(LIBTOOL) $(MLINK) $(LINK) tstbackend.o $(LIBSANE) $(LIBLIB) $(LIBS)
+	@$(LIBTOOL) $(MLINK) $(LINK) tstbackend.o $(LIBSANE) $(LIBLIBFLAGS) $(LIBLIB) $(LIBS)
 
 clean:
 	rm -f *.o tstbackend
diff -urN sane-backends.orig/tools/Makefile.in sane-backends/tools/Makefile.in
--- sane-backends.orig/tools/Makefile.in	Thu May  1 08:12:56 2003
+++ sane-backends/tools/Makefile.in	Fri May  2 23:30:05 2003
@@ -39,6 +39,7 @@
 CFLAGS = @CFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
+LIBLIBFLAGS = @LIBLIBFLAGS@
 DEFS = @DEFS@
 
 LIBTOOL = ../libtool
@@ -92,7 +93,7 @@
 sane-find-scanner: sane-find-scanner.o ../backend/sane_strstatus.lo \
 	../sanei/sanei_scsi.lo ../sanei/sanei_usb.lo ../sanei/sanei_init_debug.lo
 	@$(LIBTOOL) $(MLINK) $(LINK) sane-find-scanner.o \
-	  ../backend/sane_strstatus.lo $(LIBSANEI) $(LIBLIB) $(LIBS)
+	  ../backend/sane_strstatus.lo $(LIBSANEI) $(LIBLIBFLAGS) $(LIBLIB) $(LIBS)
 
 gamma4scanimage: gamma4scanimage.o
 	@$(LIBTOOL) $(MLINK) $(LINK) gamma4scanimage.o -lm
@@ -103,9 +104,9 @@
 
 umax_pp: umax_pp.o ../backend/umax_pp_low.o
 	@$(LIBTOOL) $(MLINK) $(LINK) umax_pp.o ../backend/umax_pp_low.o \
-	   $(LIBSANEI) $(LIBLIB) $(LIBS)
+	   $(LIBSANEI) $(LIBLIBFLAGS) $(LIBLIB) $(LIBS)
 sane-desc: sane-desc.o
-	@$(LIBTOOL) $(MLINK) $(LINK) sane-desc.o $(LIBSANEI) $(LIBLIB) $(LIBS)
+	@$(LIBTOOL) $(MLINK) $(LINK) sane-desc.o $(LIBSANEI) $(LIBLIBFLAGS) $(LIBLIB) $(LIBS)
 
 depend:
 	makedepend $(INCLUDES) *.c

--Apple-Mail-4-566259865--