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.
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 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.
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.
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.
doc/Makefile to use automake. Main difference is that
no longer installs man pages for backends that are not
compiled. Moved install ownership of $top_srcdir docs
to $top_srcdir's Makefile.
optionally linking in sanei_jpeg.lo under backend directory;
but using configure and not with GNU make extensions.
Move back to libtool's -version-info instead of -version-number
because the later has known bugs on platforms such as OS/2.
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.
own *_LIB variables instead of $LIB so that we do not have to
link in the world to all executables. Modified SANE_CHECK_U_TYPES
to be a little more portable to platforms that use #define
for u_* types. Create SANE_CHECK_BACKENDS macro so that
PRELOADABLE_BACKENDS can also be valided. Auto-populated
PRELAODABLE_BACKENDS when detect dlopen() won't work.
Various protability cleanups.
* backend/dll.c: Make dll-preload.c a .h since its an include and
not compilable byitself.
* frontend/Makefile.in, frontend/scanimage.c, include/laaloca.h,
lib/Makefile.am, lib/alloca.c, strcasestr.c, tools/Makefile.in,
tools/sane-desc.c: Convert lib/ to automake. Create a liblib.la
for everyone to use and a libfelib.la for only frontend programs.
Make all internal programs be prefixed with sanei_ as not to conflict
with other programs libsane is linked in with that will also most
likely create similar internal utils on problem platforms.
* include/getopt.h, lib/getopt.c, lib/getopt1.c: Always compile
and link in getopt_long() but prefix it with sanei_. Its
easier to always use internal version then try to figure out what
platforms support getopt_long() and what header files to use.
* backend/Makefile.am: Convert backend makefile to automake.
Initial version that is feature parity with original but uses
specific rules instead of wildcards and only links in libraries/objs
really required. Room for more cleanup of whats linked in once
all makefiles have been converted to automake.
sanei/sanei_tcp.c, sanie/sanei_udp.c: Improve portablity by
removing usage of MSG_WAITALL since not all platforms support
that (cygwin). Default is to be blocking anyways. Changed
usage of MSG_NOTWAIT to use fcntl() function as needed as well.
* configure.in, lib/Makefile.in, lib/strcasestr.c: Add internal
strcasestr() for platforms missing it (cygwin).
* pixma_common.c: My source match header prototype for picky
compilers (cygwin).
* backend/umax_pp_mid.c: Allow BACKEND_NAME to be filename
yet debug to be SANE_DEBUG_UMAX_PP to match man page.
Fix a few bugs with "all" and "uninstall" targets to work when
$(builddir) != $(srcdir). Added $(DESTDIR) to uninstall target.
Made $(distdir) related to current directory to match automake.
is now mentioned in both compile & link stages to tell 'libtool' that static
library is being built (static libraries are disabled by default when
configure produces libtool from ltmain.sh).
backends correctly even if only included files (e.g. headers) are
changed. Don't be too verbose when running makedepend.
Create links libsane-*.so.1 to the real library files if the
links are not there. This fixes dynamic loading on OpenBSD. The
links are not created for MacOS X as they don't work there.
Remove any libsane.* links in /usr/local/lib/sane. Such links
are created by libtool. As they point to libsane-v4l.so,
scanimage -L doesn't find any scanner in case of ld.so
misconfigurations.
The install target is much quiter now and prints the libtool
message only once now.