sane-backends: import from oldpackages and update

Changes since oldpackages:
- updated to 1.0.25
  * most of openwrt patches are upstreamed now
- cups dependency was completely removed
- small musl patch
- small uclibc patch
- removed link to extra libraries in libsane (used only
  for preload backends)
- sane-libs and sane-backends merged and exploded into
  individual packages for each backend:
  * libsane for sane library (which backends should dep on)
  * sane-daemon for saned daemon
  * sane-xxx for sane backend for xxx
  ** each backend has its own custom dep libraries
  * sane-backends-all (with no files) that deps on all backends
  * sane-qcam is only available for x86/x86_64
  ** other archs does not implement inb/outb (at least in musl)

Now it is possible to use SANE with much less FS space (KB
instead of MB).

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
This commit is contained in:
Luiz Angelo Daros de Luca
2015-08-21 15:07:01 -03:00
committed by Jo-Philipp Wich
parent 04d79438d2
commit 752590d266
7 changed files with 507 additions and 0 deletions
@@ -0,0 +1,11 @@
--- a/Makefile.in
+++ b/Makefile.in
@@ -400,7 +400,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = include lib sanei backend frontend tools doc po testsuite
+SUBDIRS = include lib sanei backend frontend
DIST_SUBDIRS = include lib sanei backend frontend tools doc po japi testsuite
dist_doc_DATA = AUTHORS ChangeLog COPYING LICENSE NEWS PROBLEMS PROJECTS \
README README.aix README.beos README.darwin README.djpeg README.freebsd \
@@ -0,0 +1,16 @@
--- a/backend/pieusb_buffer.c
+++ b/backend/pieusb_buffer.c
@@ -104,11 +104,13 @@
/* When creating the release backend, make complains about unresolved external
* le16toh, although it finds the include <endian.h> */
+#ifndef le16toh
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define le16toh(x) (x)
#else
#define le16toh(x) __bswap_16 (x)
#endif
+#endif
static void buffer_update_read_index(struct Pieusb_Read_Buffer* buffer, int increment);
@@ -0,0 +1,61 @@
--- a/include/sane/sanei_udp.h
+++ b/include/sane/sanei_udp.h
@@ -27,6 +27,7 @@
#include <netinet/in.h>
#include <netdb.h>
#endif
+#include <sys/types.h>
extern SANE_Status sanei_udp_open(const char *host, int port, int *fdp);
extern SANE_Status sanei_udp_open_broadcast(int *fdp);
--- a/backend/kvs20xx_cmd.h
+++ b/backend/kvs20xx_cmd.h
@@ -9,6 +9,8 @@
Panasonic KV-S20xx USB-SCSI scanners.
*/
+#include <sys/types.h>
+
#define COMMAND_BLOCK 1
#define DATA_BLOCK 2
#define RESPONSE_BLOCK 3
--- a/backend/kvs40xx.h
+++ b/backend/kvs40xx.h
@@ -10,6 +10,7 @@
#include "../include/sane/config.h"
#include <semaphore.h>
+#include <sys/types.h>
#undef BACKEND_NAME
#define BACKEND_NAME kvs40xx
--- a/backend/hp5400.c
+++ b/backend/hp5400.c
@@ -67,6 +67,7 @@
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memcpy */
#include <stdio.h>
+#include <sys/types.h>
#define HP5400_CONFIG_FILE "hp5400.conf"
--- a/backend/hp5590.c
+++ b/backend/hp5590.c
@@ -48,6 +48,7 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include <sys/types.h>
#include "../include/sane/sane.h"
#define BACKEND_NAME hp5590
--- a/backend/epsonds-io.c
+++ b/backend/epsonds-io.c
@@ -16,6 +16,7 @@
#include "sane/config.h"
#include <ctype.h>
#include <unistd.h> /* sleep */
+#include <sys/types.h>
#include "epsonds.h"
#include "epsonds-io.h"
@@ -0,0 +1,38 @@
--- a/configure.in
+++ b/configure.in
@@ -279,6 +279,9 @@ dnl ************************************
dnl Checks for library functions
dnl ***********************************************************************
+dnl Check mkostemp (missing in uclibc)
+AC_CHECK_FUNC(mkostemp)
+
dnl Define SOCKET_LIB, NSL_LIB, BIND_LIB, and RESOLV_LIB when required
dnl for functions we use.
AC_CHECK_FUNC(gethostbyaddr,, [AC_CHECK_LIB(bind, gethostbyaddr, BIND_LIB="-lbind")])
--- a/include/sane/config.h.in
+++ b/include/sane/config.h.in
@@ -207,6 +207,9 @@
/* Define to 1 if you have the `mkdir' function. */
#undef HAVE_MKDIR
+/* Define to 1 if you have a working `mkostemp' function. */
+#undef HAVE_MKOSTEMP
+
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
--- a/backend/pieusb_buffer.c
+++ b/backend/pieusb_buffer.c
@@ -112,6 +112,11 @@
#endif
#endif
+#ifndef HAVE_MKOSTEMP
+/* uclibc might not implement mkostemp GNU extension */
+#define mkostemp(template, flags) mkstemp(template)
+#endif
+
static void buffer_update_read_index(struct Pieusb_Read_Buffer* buffer, int increment);
/* READER */
@@ -0,0 +1,11 @@
--- a/backend/Makefile.am
+++ b/backend/Makefile.am
@@ -1142,7 +1142,7 @@ EXTRA_DIST += dll.aliases
nodist_libsane_la_SOURCES = dll-s.c
libsane_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll
libsane_la_LDFLAGS = $(DIST_LIBS_LDFLAGS)
-libsane_la_LIBADD = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll_preload.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 ../sanei/sanei_magic.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)
+libsane_la_LIBADD = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll_preload.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 ../sanei/sanei_magic.lo $(DL_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS)
# WARNING: Automake is getting this wrong so have to do it ourselves.
libsane_la_DEPENDENCIES = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll_preload.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 ../sanei/sanei_magic.lo @SANEI_SANEI_JPEG_LO@