The distclean target should only remove files that make creates. If
there are any that need taking care of, they should be added in on a
per file basis in the Makefile.am that creates it.
Several variables are considered "user variables" by the GNU Standards.
This means that the user can pass these to their ./configure and make
invocations as they see fit. These variables include CPPFLAGS, CFLAGS
and LDFLAGS.
This changeset pushes our use of these variables to the automake shadow
variables, AM_CPPFLAGS, AM_CFLAGS and AM_LDFLAGS, so that user variables
will no longer clobber flags required in order to build.
Here, we add a new env var (SANE_USB_WORKAROUND) to sanei_usb.c.
This allows end users to conditionally enable the workaround added
in commit 014b45d920. The default is
to not enable the workaround, because more recent Linux kernels no
longer seem to need it. Some users have even reported failure with
the workaround enabled.
Some parts of SANE used __FUNCTION__ while other parts used __func__.
Now, __func__ is used consistently throughout the SANE sources. This
fixes all occurrences of the following GCC warning:
warning: ISO C does not support '__FUNCTION__' predefined identifier
Various parts of SANE introduced their own compatibility macros for
old compilers that don't support __func__. Most of these definitions
are identical or have minor differences. This patch replaces them
with a single instance in the central header file for backends.
Up to now, on failure the sanei_magic_rotate function returned a
success status. This fixes the following GCC warning:
warning: variable 'ret' set but not used
The line variable is not (and cannot be) declared 'const'. The string
variable points to a location in line, hence it is safe to cast away
'const'ness of the sanei_config_skip_whitespace() return value.
Sample code that mimicks the offending code gave different run-time
results when compiled with gcc-4.9.2 and clang-3.5.0. Rewriting the
sample code so that results matched gcc-4.9.2 for both compilers was
used to determine how to "fix" the offending statement.
This commit adds support for (slide) scanners based
on Pacific Image Electronics (PIE) oem scan hardware.
It is known to match the following USB scanners
PIE PowerSlide 3600 Untested
PIE PowerSlide 3650 Untested
PIE PowerSlide 4000 Untested
PIE PowerSlide 5000 Untested
Reflecta CrystalScan 7200 Untested
Reflecta ProScan 7200 Untested
Reflecta DigitDia 4000 Untested
Reflecta DigitDia 5000 Untested
Reflecta DigitDia 6000 Ok
The backend is based on work by Jan Vleeshouwers and Michael Rickmann.
Special thanks to Stéphane Voltz for the code review.
Add pieusb to backend/Makefile.am
Add pieusb to doc/Makefile.am
Add missing sanei/sanei_ir.c, sanei/sanei_ir.h, adapt Makefile.am
configure.ac: Add 'pieusb' to ALL_BACKENDS
ChangeLog: Add pieusb as new backend
Mark infrared functions as internal: sane_ir_* -> sanei_ir_*
sanei/sanei_ir.c: fix memory leaks
pieusb: rename cmdGetMode and cmdSetScanHead
... to their sanei_pieusb_cmd_... equivalent
pieusb: rename definition_list_head to pieusb_definition_list_head
Add pieusb to AUTHORS
pieusb: copyright 2012-2015
pieusb: don't include sanei_thread.h
add calls to sanei_usb_set_altinterface in sanei_usb_close and
sanei_usb_clear_halt- hopefully work around USB3/xhci problems
in Linux. Also, remove some unused code, and fix debug messages.
This follows up on earlier USB3 fixes. It only addresses libusb-1.0
because there is no convenience API for libusb-0.1 to get the current
configuration.
This fixes USB3 issues for the epson and epson2 backends. Both these
backends already made sure to send an even number of reads and writes
but were affected nevertheless.
It also solves USB3 issues with the third party epkowa backend. This
one doesn't bother to ensure even counts of packets read and written.
It works fine when this fix is applied (and it no longer clears halts
w/o a stall condition). Note, there is no need to ensure even packet
counts.
libusb on my Linux box is returning EACCES error when invalid
permissions exist. Modify open to translate that into
SANE_STATUS_ECCESS_DENIED since that error description is
used for this case.
Modify sanei_usb_test.c to not treat access denied or busy
error codes as real failures since its expected to occur on
boxes that USB device is already claimed by another driver
and if that device uses default root only permissions.
Improving here means do not set LIBS/CFLAGS if library is not detected.
This prevents some unknown options based to ld when host is Linux and
target is mingw32/64. Further improvements are needed if one wants this
snmp support when cross compiling to really work.
Also, to make commit bisectable, updated all autofoo files using
'autoreconf -i -f' and repatching ltmain.sh.
Also, test-driver was missing from git repo but the Makefile.in
checked in expected it to exist.
- fixed a bug in sanei_constrain_value spotted by
viresh_shirol@yahoo.co.uk where range max was exceeded due to rounding
in quantization
- added test case for sane fixed values range
- move bus scanning for device to a new sanei_usb_scan_devices
- call this new function from sanei_usb_init to preserve current behaviour
- split bus device scanning into several smaller functions on a per scanning method
method basis
using backend debugging using SANE_DEBUG_xxx to be used for saned controlled
scanning when using socket activation. When only the socket is received we
use the existing code path.
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.