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.
On mingw, O_NONBLOCK is not defined. Since we were always
redefining to an invalid FNDELAY, the compile failure message
would mislead you during debugging. Its better for compile
failure to point to real issue; which is missing O_NONBLOCK.
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)
* 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.
cygwin and mingw is now hiding M_PI_2 defines with -ansi flag.
Remove to fix cygwin compile.
Mingw doesn't support fork() so default to pthreads.
Add u_short to complete definition of u_* types which helps out mingw
when we define _BSDTYPES_DEFINED.
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
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>
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.
Global replace of u_int??_t with C9x standard based uintxx_t
in order to remove some tricky and overlapping portability logic
from acinclude.m4 and leave it in only m4/stdint.m4.
get latest fixes and use logic to not recreate _stdint.h if
no changes (to prevent unneeded recompiles).
* m4/byteorder.m4: Added support to reuse existing byteorder.h if
no changes to prevent timestamp causing a recompile.
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.
add cv_ prefix to cached variable. Remove AC_ARG_PROGRAM as
automake already invokes this. When prefered AC_USE_SYSTEM_EXTENSIONS
exists, use that instead of AC_GNU_SOURCE/AC_AIX/AC_MINUX.
Cleanup socket detection more by creating only a single
SOCKET_LIBS that contains list of all optional libraries
for any socket related funciton. Make sure that checks
for socket related functions use SOCKET_LIBS when searching.
Check for getopt_long() and getopt.h. Make OS/2 use
-no-undefined (same as windows).
* ltmain.sh, m4/libtool.m4: Upgrade to libtool 1.5.26.
* Makefile.am: Cleanups to match configure updates.
* frontend/scanimage.c, include/Makefile.in, lib/getopt.c
lib/getopt1.c, toosl/sane-desc.c, include/lgetopt.h:
Rename internal getopt.h to lgetopt.h to allow using
external getopt.h when it exists. This allows to go
back to optionally compiling getopt()/getopt_long() and its
prototypes and not have conflicts with external headers/symbols.
* configure.in: Group all USB logic together and all SCSI
logic together to aid understanding of whats no longer
valid. Allow sharing enable/disable options between all
USB drivers on multiple platforms. Combined CAM_LIBS and
SCSI_LIBS since they are mutually exclusive.
Skip some USB/SCSI checks when previous tests show it will always fail.
* backend/Makefile.am, tools/Makefile.in: Combine CAM_LIBS and
SCSI_LIBS. Add missing SOCKET_LIBS to epson2. Add USB_LIB.
* saned.c: Add limits.h for PATH_MAX.