epson2-commands.c: Include <sys/types.h> to resolve u_long.
epson2.c, magicolor.c, xerox_mfp-tcp.c: Include <sys/types.h>
and to <sys/socket.h> for anyone using setsockopt().
sanei_tcp.h: Include <sys/types.h> since ssize_t is referenced.
sanei_usb.c: Newer FreeBSD version checks.
All changes in this patch set come from FreeBSD ports patches.
Bug #312503.
Not all platforms use an integer for pthread_t and so
couldn't compile on those; namely mingw.
This is least riskest version I could come up with. Backends
that do things like "SANE_Pid pid = -1" or "if (pid == -1)" will
need to switch to sanei_thread_set_invalid()
sanei_thread_is_invalid() to be able to compile on mingw.
Options were in README but removed at some point. They
are useful so add them back.
Document BACKENDS and PRELOADABLE_BACKENDS variables in
README as well as in configure --help output.
Add missing WSAStartup() and WSACleanup() code required
on windows to use ws2_32 library.
Also, O_NONBLOCK is tricky even on other platforms so create
a function to set that so portability logic doesn't need to be
done in every backend. Windows requires using a non standard
function to enable nonblocking mode and also doesn't support
querying current state.
Add check for winsock2.h for socket.h replancement. Also, use this
check to add ws2_32 library. Also, switch all winsock.h references
to winsock2.h.
Add check for getuid and getpass; which are not on mingw.
Add a syslog() replacement that is basically a print(). This
is also used by vsyslog() replacement.
Comment out parts of replacement sigprocmask.c on mingw.
To support these configure.in changes, I need to rebuild all
related files with autoconf 2.68 and libtool 2.4. Hand ported
our sane-backend specific changes to newer ltmain.sh.
The following updates were made to all directories but backends.
That still needs work. There are also still some pthread issues
and syslog is missing.
Windows doesn't support SIGHUP or SIGPIPE so make that optional.
Only include socket header files when sys/socket.h is detected.
Use winsock.h on windows.
Only include syslog.h when vsyslog() was detect by configure.
Skip FD_CLOEXEC when not supported by OS (not defined).
Only include sys/ioctl.h on platforms that define it.
Since we now have the possibility to change the endpoint used for a particular USB communication type,
we also need a way to retrieve the current endpoint, so that one can e.g. reset the endpoint to the
old value after a single usb operation on a different endpoint.
Added
void sanei_usb_set_endpoint (SANE_Int dn, SANE_Int ep_type, SANE_Int ep);
This function allows the user to set the endpoint to use on
the given device for the given endpoint type (e.g. bulk in).
Some scanners have multiple bulk in/out endpoints but use
only one for communication (not the one detected during auto-detection),
so one call to the new function will change the used endpoint.
Some scanners use two different endpoint for different purposes,
so in that case each read/write call needs to be preceeded
by a call to that function to set the proper endpoint.
ep_type is a bitmask and is usually of the form
(USB_DIR_IN|USB_ENDPOINT_TYPE_BULK)
Allow "make dist" when translations are disabled.
Allow "make check" to work by linking in liblib.la.
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
* include/sane/sanei_config.h sanei/sanei_config.c: Add function
sanei_config_get_paths to obtain all configuration pathes (from env var
SANE_CONFIG_DIR and default paths); fix pointers to invalid/freed
strings when SANE_CONFIG_DIR is set
* backend/dll.c: When searching for the dll.d/ directory, also use
the SANE_CONFIG_DIR env variable.
resmgr library is only used (optionally) by
sanei_usb and sanei_scsi. So only need to
link it in for those backends. This was
a stray piece from initial cleanup of LIBS
in sane-backends 1.0.20.
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
* sanei/sanie_tcp.c, backend/epson2_net.c: Update
sanei_tcp_read() to better simulate old behavior of MSG_WAITALL.
recv() tends to return MTU sized chunks of data without that option. And at
least cygwin doesn't support MSG_WAITALL. Re-enable epson2 using that
function for big recieves.
* libgetopt.c, libgetopt1.c:
Revert some logic meant to be used only when we were always compiling
interal getopt() functions. Fix header filename.
This commit adds some debug verbosity to the last committed sanei_usb.c patch
id 5b69fa8c6d
for fixing the choice of usb endpoints, in the sanei_usb_open() seek for endpoints loop.
Updated following files for Pixma MP730 support:
- backend/pixma_mp730.c:
Add width scan area fitting
Fix end scan sequence protocol
- sanei/sanei_usb.c:
In sanei_usb_open(), changed the "seek for endpoints" loop
so that it first looks for those interfaces (in config 0)
that have been detected as potential scanners in
sanei_usb_init()
Source code was inconsistent on how they were referencing
include files in include/sane. In certain cases, sane/sane.h
and sane/saneopts.h was really including external copies (with
some preprocessor implementations anyways).
with newer automake.
* backend/Makefile.am, tools/sane-config.in: Add missing
$GPHOTO2_LDFLAGS so library can be found.
* tools/Makefile.am: Add mising $SCSI_LIBS to sane-find-scanner.
to sane-config missed during fix to stop using LIBS to link everything.
Add back in code to move LDFLAGS out of $GPHOTO2_LIBS and into
GPHOTO2_LDFLAGS.
Add tools/openbsd to distribution package.
* include/Makefile.am: include files should have been installed
under sane/ directory when converted to automake.
* doc/Makefile.am: Cleanup. Use automake's built in support to
install docs within subdirectories.