kopia lustrzana https://gitlab.com/sane-project/backends
Changes to support SANE on ZETA. Not all
patches have been applied yet, but it's a start. The backends are not installed as shared libs but as add-ons, which are shared libs but in a specific folder in [/system|~]/config/add-ons/ named SANE/. The install target has been changed to account for this, Some files don't exist in BeOS/ZETA (ipc.h, ...). Bbackend function names get a prefix, I suppose to avoid namespace clashes. Though we do have a libdl to implement dl_open, the native way is prefered. Added a --with-docdir= configure arg. BeOS has a broken get[name|addr]info() from bind. This is fixed in ZETA R1. libtool needs -no-undefined. Various VPATH fixes. Check for <be/drivers/USB_scanner.h>, but not used yet. No S_IFSOCK (sockets are fds to /dev/net/api). Stub pio code, untested. Patch from Francois Revol <revol@free.fr>.merge-requests/1/head
rodzic
2dd4b1822c
commit
6c3427c52d
19
ChangeLog
19
ChangeLog
|
@ -4,6 +4,25 @@
|
|||
Mattias Ellert <mattias.ellert@tsl.uu.se>).
|
||||
* sanei/sanei_usb.c: Fixed comment (we still use 30 seconds USB
|
||||
timeout by default).
|
||||
* README.zeta configure configure.in Makefile.in backend/Makefile.in
|
||||
backend/artec_eplus48u.h backend/dll.c backend/plustek-pp_scan.h
|
||||
doc/Makefile.in frontend/saned.c include/sane/config.h.in
|
||||
po/Makefile.in sanei/sanei_config.c sanei/sanei_config2.c
|
||||
sanei/sanei_init_debug.c sanei/sanei_pio.c sanei/sanei_thread.c
|
||||
sanei/sanei_usb.c: Changes to support SANE on ZETA. Not all
|
||||
patches have been applied yet, but it's a start. The backends
|
||||
are not installed as shared libs but as add-ons, which are shared libs
|
||||
but in a specific folder in [/system|~]/config/add-ons/ named SANE/.
|
||||
The install target has been changed to account for this,
|
||||
Some files don't exist in BeOS/ZETA (ipc.h, ...).
|
||||
Bbackend function names get a prefix, I suppose to avoid namespace clashes.
|
||||
Though we do have a libdl to implement dl_open, the native way is prefered.
|
||||
Added a --with-docdir= configure arg.
|
||||
BeOS has a broken get[name|addr]info() from bind. This is fixed in ZETA R1.
|
||||
libtool needs -no-undefined. Various VPATH fixes.
|
||||
Check for <be/drivers/USB_scanner.h>, but not used yet.
|
||||
No S_IFSOCK (sockets are fds to /dev/net/api). Stub pio code, untested.
|
||||
Patch from François Revol <revol@free.fr>.
|
||||
|
||||
2005-07-15 Oliver Schwartz <Oliver.Schwartz@gmx.de>
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ DISTFILES = AUTHORS COPYING ChangeLog ChangeLog-1.0.0 ChangeLog-1.0.1 \
|
|||
README.freebsd \
|
||||
README.hp-ux README.linux README.netbsd \
|
||||
README.openbsd README.os2 README.solaris README.unixware2 README.unixware7 \
|
||||
README.windows \
|
||||
README.windows README.zeta \
|
||||
acinclude.m4 aclocal.m4 config.guess config.sub configure \
|
||||
configure.in install-sh ltmain.sh mkinstalldirs \
|
||||
sane-backends.lsm
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
SANE and Zeta
|
||||
-------------
|
||||
|
||||
The Zeta port is based on existing BeOS port, with some changes
|
||||
to accomodate yellowTAB's internal build procedure, and some new
|
||||
conventions brought up by Zeta.
|
||||
|
||||
Cf. README.beos for more historical stuff.
|
||||
|
||||
SANE 1.0.9 was updated for Zeta by Ithamar Adema for yellowTAB.
|
||||
|
||||
SANE 1.0.15 was updated for BeOS and Zeta by François Revol for yellowTAB.
|
||||
|
||||
Zeta uses a modified version of Philippe Houdoin's Sanity GUI frontend.
|
||||
http://philippe.houdoin.free.fr/phil/beos/sanity/index-en.html
|
||||
|
||||
SANE was reported to work with the following configuration and features:
|
||||
|
||||
Platform: Zeta R1 (== BeOS R6.x) ix86
|
||||
Latest SANE version tested: 1.0.15
|
||||
Compiler: gcc 2.95.3
|
||||
User-level SCSI support: yes
|
||||
USB support: yes
|
||||
Shared library support: yes
|
||||
Dynamic loading support: yes
|
||||
X11 clients: no
|
|
@ -26,6 +26,7 @@ mandir = @mandir@
|
|||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
configdir = ${sysconfdir}/sane.d
|
||||
BEOS_ADDONDIR = @BEOS_ADDONDIR@
|
||||
|
||||
V_MAJOR = @V_MAJOR@
|
||||
V_MINOR = @V_MINOR@
|
||||
|
@ -213,8 +214,12 @@ install: $(INSTALL_LOCKPATH)
|
|||
# nn=`echo $$n | sed 's,^libsane-dll,libsane,'`; \
|
||||
# (cd ..; if test -f sane/$$n ; then $(LN_S) sane/$$n $$nn; fi; ); \
|
||||
# done || exit 1
|
||||
|
||||
install-libsane:
|
||||
$(LIBTOOL) $(MINST) $(INSTALL_PROGRAM) libsane.la \
|
||||
$(DESTDIR)$(libdir)/libsane.la
|
||||
|
||||
install-becfg:
|
||||
@list="$(CONFIGS)"; for cfg in $$list; do \
|
||||
if test ! -r $(srcdir)/$${cfg}; then continue; fi; \
|
||||
if test -f $(DESTDIR)$(configdir)/$${cfg}; then \
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
#include "../include/sane/sanei.h"
|
||||
#include "../include/sane/saneopts.h"
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_IPC_H
|
||||
#include <sys/ipc.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
|
108
backend/dll.c
108
backend/dll.c
|
@ -50,6 +50,13 @@
|
|||
# include "lalloca.h" /* MUST come first for AIX! */
|
||||
#endif
|
||||
|
||||
#ifdef __BEOS__
|
||||
#include <kernel/OS.h>
|
||||
#include <storage/FindDirectory.h>
|
||||
#include <kernel/image.h>
|
||||
#include <posix/dirent.h>
|
||||
#endif
|
||||
|
||||
#include "sane/config.h"
|
||||
#include "lalloca.h"
|
||||
|
||||
|
@ -199,7 +206,9 @@ struct backend
|
|||
} \
|
||||
}
|
||||
|
||||
#ifndef __BEOS__
|
||||
#include "dll-preload.c"
|
||||
#endif
|
||||
|
||||
struct meta_scanner
|
||||
{
|
||||
|
@ -224,11 +233,20 @@ static int devlist_size = 0, devlist_len = 0;
|
|||
static struct alias *first_alias;
|
||||
static SANE_Auth_Callback auth_callback;
|
||||
static struct backend *first_backend;
|
||||
|
||||
#ifndef __BEOS__
|
||||
static const char *op_name[] = {
|
||||
"init", "exit", "get_devices", "open", "close", "get_option_descriptor",
|
||||
"control_option", "get_parameters", "start", "read", "cancel",
|
||||
"set_io_mode", "get_select_fd"
|
||||
};
|
||||
#else
|
||||
static const char *op_name[] = {
|
||||
"sane_init", "sane_exit", "sane_get_devices", "sane_open", "sane_close", "sane_get_option_descriptor",
|
||||
"sane_control_option", "sane_get_parameters", "sane_start", "sane_read", "sane_cancel",
|
||||
"sane_set_io_mode", "sane_get_select_fd"
|
||||
};
|
||||
#endif /* __BEOS__ */
|
||||
|
||||
static void *
|
||||
op_unsupported (void)
|
||||
|
@ -298,6 +316,57 @@ dyld_get_error_str ()
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __BEOS__
|
||||
#include <FindDirectory.h>
|
||||
|
||||
static SANE_Status
|
||||
load (struct backend *be)
|
||||
{
|
||||
// use BeOS kernel function to load scanner addons from ~/config/add-ons/SANE/
|
||||
char path[PATH_MAX];
|
||||
image_id id = -1;
|
||||
int i, w;
|
||||
directory_which which[3] = { B_USER_ADDONS_DIRECTORY, B_COMMON_ADDONS_DIRECTORY, B_BEOS_ADDONS_DIRECTORY };
|
||||
|
||||
// look for config files in SANE/conf
|
||||
for (w = 0; (w < 3) && (id < 0) && (find_directory(which[w],0,true,path,PATH_MAX) == 0); w++)
|
||||
{
|
||||
strcat(path,"/SANE/");
|
||||
strcat(path,be->name);
|
||||
DBG(1, "loading backend %s\n", be->name);
|
||||
|
||||
/* initialize all ops to "unsupported" so we can "use" the backend
|
||||
even if the stuff later in this function fails */
|
||||
be->loaded = 1;
|
||||
be->handle = 0;
|
||||
for (i = 0; i < NUM_OPS; ++i) be->op[i] = op_unsupported;
|
||||
DBG(2, "dlopen()ing `%s'\n", path);
|
||||
id=load_add_on(path);
|
||||
if (id < 0)
|
||||
{
|
||||
continue; /* try next path */
|
||||
}
|
||||
be->handle=(void *)id;
|
||||
|
||||
for (i = 0; i < NUM_OPS; ++i)
|
||||
{
|
||||
void *(*op) ();
|
||||
op = NULL;
|
||||
/* Look for the symbol */
|
||||
if ((get_image_symbol(id, op_name[i],B_SYMBOL_TYPE_TEXT,(void **)&op) < 0) || !op)
|
||||
DBG(2, "unable to find %s\n", op_name[i]);
|
||||
else be->op[i]=op;
|
||||
}
|
||||
}
|
||||
if (id < 0)
|
||||
{
|
||||
DBG(2, "load: couldn't find %s\n",path);
|
||||
return SANE_STATUS_INVAL;
|
||||
}
|
||||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
|
||||
#else
|
||||
static SANE_Status
|
||||
load (struct backend *be)
|
||||
{
|
||||
|
@ -505,6 +574,7 @@ load (struct backend *be)
|
|||
return SANE_STATUS_UNSUPPORTED;
|
||||
#endif /* HAVE_DLL */
|
||||
}
|
||||
#endif /* __BEOS__ */
|
||||
|
||||
static SANE_Status
|
||||
init (struct backend *be)
|
||||
|
@ -545,6 +615,7 @@ init (struct backend *be)
|
|||
static void
|
||||
add_alias (const char *line_param)
|
||||
{
|
||||
#ifndef __BEOS__
|
||||
const char *command;
|
||||
enum
|
||||
{ CMD_ALIAS, CMD_HIDE }
|
||||
|
@ -628,17 +699,26 @@ add_alias (const char *line_param)
|
|||
free (alias);
|
||||
}
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
SANE_Status
|
||||
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
||||
{
|
||||
#ifndef __BEOS__
|
||||
char config_line[PATH_MAX];
|
||||
char *backend_name;
|
||||
size_t len;
|
||||
FILE *fp;
|
||||
int i;
|
||||
#else
|
||||
DIR *dir;
|
||||
struct dirent *dirent;
|
||||
char path[1024];
|
||||
directory_which which[3] = { B_USER_ADDONS_DIRECTORY, B_COMMON_ADDONS_DIRECTORY, B_BEOS_ADDONS_DIRECTORY };
|
||||
int i;
|
||||
#endif
|
||||
|
||||
DBG_INIT ();
|
||||
|
||||
|
@ -647,6 +727,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
DBG (1, "sane_init: SANE dll backend version %s from %s\n", DLL_VERSION,
|
||||
PACKAGE_STRING);
|
||||
|
||||
#ifndef __BEOS__
|
||||
/* chain preloaded backends together: */
|
||||
for (i = 0; i < NELEMS (preloaded_backends); ++i)
|
||||
{
|
||||
|
@ -718,6 +799,28 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
|
|||
add_alias (config_line);
|
||||
}
|
||||
fclose (fp);
|
||||
|
||||
#else
|
||||
// no ugly config files, just get scanners from their ~/config/add-ons/SANE
|
||||
// look for drivers
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
if (find_directory(which[i],0,true,path,1024) < B_OK)
|
||||
continue;
|
||||
strcat(path,"/SANE/");
|
||||
dir=opendir(path);
|
||||
if(!dir) continue;
|
||||
|
||||
while((dirent=readdir(dir)))
|
||||
{
|
||||
if((strcmp(dirent->d_name,".")==0) || (strcmp(dirent->d_name,"..")==0)) continue;
|
||||
if((strcmp(dirent->d_name,"dll")==0)) continue;
|
||||
add_backend(dirent->d_name,0);
|
||||
}
|
||||
closedir(dir);
|
||||
}
|
||||
#endif /* __BEOS__ */
|
||||
|
||||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
|
||||
|
@ -740,6 +843,10 @@ sane_exit (void)
|
|||
be->name);
|
||||
(*(op_exit_t)be->op[OP_EXIT]) ();
|
||||
}
|
||||
#ifdef __BEOS__
|
||||
// use BeOS kernel functions to unload add-ons
|
||||
if(be->handle) unload_add_on((image_id)be->handle);
|
||||
#else
|
||||
#ifdef HAVE_DLL
|
||||
|
||||
#ifdef HAVE_DLOPEN
|
||||
|
@ -760,6 +867,7 @@ sane_exit (void)
|
|||
#endif /* HAVE_DLOPEN */
|
||||
|
||||
#endif /* HAVE_DLL */
|
||||
#endif /* __BEOS__ */
|
||||
}
|
||||
if (!be->permanent)
|
||||
{
|
||||
|
|
|
@ -72,7 +72,11 @@
|
|||
# include <stdio.h>
|
||||
# include <unistd.h>
|
||||
# include <sys/time.h>
|
||||
# include <sys/signal.h>
|
||||
# ifdef HAVE_SYS_SIGNAL_H
|
||||
# include <sys/signal.h>
|
||||
# else
|
||||
# include <signal.h>
|
||||
# endif
|
||||
# include <sys/ioctl.h>
|
||||
# ifdef HAVE_SYS_IO_H
|
||||
# include <sys/io.h>
|
||||
|
|
|
@ -464,7 +464,7 @@ ac_includes_default="\
|
|||
# include <unistd.h>
|
||||
#endif"
|
||||
|
||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS V_MAJOR V_MINOR V_REV PACKAGE VERSION NUMBER_VERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE CPP EGREP SANE_CONFIG_PATH MSGFMT XGETTEXT MSGMERGE LATEX DVIPS MAKEINDEX INCLUDES LINKER_RPATH DL_LIB DYNAMIC_FLAG INSTALL_LOCKPATH LOCKPATH_GROUP HAVE_GPHOTO2 ac_ct_HAVE_GPHOTO2 GPHOTO2_LDFLAGS ALLOCA LIBOBJS LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBTOOL_LINK_EXTRA SANED SANEI_JPEG SANEI_JPEG_LO BACKENDS DLL_PRELOAD INSTALL_TRANSLATIONS USE_LATEX DISTCLEAN_FILES LTLIBOBJS'
|
||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS V_MAJOR V_MINOR V_REV PACKAGE VERSION NUMBER_VERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os docdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE CPP EGREP SANE_CONFIG_PATH MSGFMT XGETTEXT MSGMERGE LATEX DVIPS MAKEINDEX INCLUDES LINKER_RPATH DL_LIB DYNAMIC_FLAG INSTALL_LOCKPATH LOCKPATH_GROUP HAVE_GPHOTO2 ac_ct_HAVE_GPHOTO2 GPHOTO2_LDFLAGS ALLOCA LIBOBJS LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBTOOL_LINK_EXTRA SANED SANEI_JPEG SANEI_JPEG_LO BACKENDS DLL_PRELOAD BEOS_ADDONDIR BE_INSTALL_FLAVOR INSTALL_TRANSLATIONS USE_LATEX DISTCLEAN_FILES LTLIBOBJS'
|
||||
ac_subst_files=''
|
||||
|
||||
# Initialize some variables set by options.
|
||||
|
@ -1057,6 +1057,7 @@ Optional Features:
|
|||
Optional Packages:
|
||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
|
||||
--with-docdir=DIR documentation [PREFIX/doc/sane-VERSION]
|
||||
--with-group use the specified group for lock dir
|
||||
[default=uucp]
|
||||
--with-gphoto2 include the gphoto2 backend [default=yes]
|
||||
|
@ -1664,6 +1665,19 @@ host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
|||
|
||||
|
||||
|
||||
|
||||
# Check whether --with-docdir or --without-docdir was given.
|
||||
if test "${with_docdir+set}" = set; then
|
||||
withval="$with_docdir"
|
||||
|
||||
docdir="${withval}"
|
||||
|
||||
else
|
||||
|
||||
docdir='${prefix}/doc/sane-${VERSION}'
|
||||
|
||||
fi;
|
||||
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
|
@ -5092,14 +5106,13 @@ _ACEOF
|
|||
fi
|
||||
# FreeBSD 3+ needs this
|
||||
if test "`uname`" != "IRIX" -a "`uname`" != "IRIX64"; then
|
||||
|
||||
echo "$as_me:$LINENO: checking for gethostbyaddr in -lnsl" >&5
|
||||
echo $ECHO_N "checking for gethostbyaddr in -lnsl... $ECHO_C" >&6
|
||||
if test "${ac_cv_lib_nsl_gethostbyaddr+set}" = set; then
|
||||
echo "$as_me:$LINENO: checking for library containing gethostbyaddr" >&5
|
||||
echo $ECHO_N "checking for library containing gethostbyaddr... $ECHO_C" >&6
|
||||
if test "${ac_cv_search_gethostbyaddr+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lnsl $LIBS"
|
||||
ac_func_search_save_LIBS=$LIBS
|
||||
ac_cv_search_gethostbyaddr=no
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
|
@ -5143,36 +5156,87 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
|||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
ac_cv_lib_nsl_gethostbyaddr=yes
|
||||
ac_cv_search_gethostbyaddr="none required"
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_cv_lib_nsl_gethostbyaddr=no
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyaddr" >&5
|
||||
echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyaddr" >&6
|
||||
if test $ac_cv_lib_nsl_gethostbyaddr = yes; then
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_LIBNSL 1
|
||||
if test "$ac_cv_search_gethostbyaddr" = no; then
|
||||
for ac_lib in nsl bind; do
|
||||
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
LIBS="-lnsl $LIBS"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char gethostbyaddr ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
gethostbyaddr ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
(eval $ac_link) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } &&
|
||||
{ ac_try='test -s conftest$ac_exeext'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
ac_cv_search_gethostbyaddr="-l$ac_lib"
|
||||
break
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
done
|
||||
fi
|
||||
LIBS=$ac_func_search_save_LIBS
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyaddr" >&5
|
||||
echo "${ECHO_T}$ac_cv_search_gethostbyaddr" >&6
|
||||
if test "$ac_cv_search_gethostbyaddr" != no; then
|
||||
test "$ac_cv_search_gethostbyaddr" = "none required" || LIBS="$ac_cv_search_gethostbyaddr $LIBS"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
|
||||
echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6
|
||||
if test "${ac_cv_lib_socket_socket+set}" = set; then
|
||||
echo "$as_me:$LINENO: checking for library containing socket" >&5
|
||||
echo $ECHO_N "checking for library containing socket... $ECHO_C" >&6
|
||||
if test "${ac_cv_search_socket+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lsocket $LIBS"
|
||||
ac_func_search_save_LIBS=$LIBS
|
||||
ac_cv_search_socket=no
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
|
@ -5216,36 +5280,87 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
|||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
ac_cv_lib_socket_socket=yes
|
||||
ac_cv_search_socket="none required"
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_cv_lib_socket_socket=no
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
|
||||
echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6
|
||||
if test $ac_cv_lib_socket_socket = yes; then
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_LIBSOCKET 1
|
||||
if test "$ac_cv_search_socket" = no; then
|
||||
for ac_lib in socket; do
|
||||
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
LIBS="-lsocket $LIBS"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char socket ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
socket ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
(eval $ac_link) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } &&
|
||||
{ ac_try='test -s conftest$ac_exeext'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
ac_cv_search_socket="-l$ac_lib"
|
||||
break
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
done
|
||||
fi
|
||||
LIBS=$ac_func_search_save_LIBS
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5
|
||||
echo "${ECHO_T}$ac_cv_search_socket" >&6
|
||||
if test "$ac_cv_search_socket" != no; then
|
||||
test "$ac_cv_search_socket" = "none required" || LIBS="$ac_cv_search_socket $LIBS"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
echo "$as_me:$LINENO: checking for syslog in -lsyslog" >&5
|
||||
echo $ECHO_N "checking for syslog in -lsyslog... $ECHO_C" >&6
|
||||
if test "${ac_cv_lib_syslog_syslog+set}" = set; then
|
||||
echo "$as_me:$LINENO: checking for library containing syslog" >&5
|
||||
echo $ECHO_N "checking for library containing syslog... $ECHO_C" >&6
|
||||
if test "${ac_cv_search_syslog+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lsyslog $LIBS"
|
||||
ac_func_search_save_LIBS=$LIBS
|
||||
ac_cv_search_syslog=no
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
|
@ -5289,28 +5404,80 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
|||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
ac_cv_lib_syslog_syslog=yes
|
||||
ac_cv_search_syslog="none required"
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_cv_lib_syslog_syslog=no
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_lib_syslog_syslog" >&5
|
||||
echo "${ECHO_T}$ac_cv_lib_syslog_syslog" >&6
|
||||
if test $ac_cv_lib_syslog_syslog = yes; then
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_LIBSYSLOG 1
|
||||
if test "$ac_cv_search_syslog" = no; then
|
||||
for ac_lib in syslog be; do
|
||||
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
LIBS="-lsyslog $LIBS"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char syslog ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
syslog ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
(eval $ac_link) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } &&
|
||||
{ ac_try='test -s conftest$ac_exeext'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
ac_cv_search_syslog="-l$ac_lib"
|
||||
break
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
fi
|
||||
# OS/2 needs this
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
done
|
||||
fi
|
||||
LIBS=$ac_func_search_save_LIBS
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_search_syslog" >&5
|
||||
echo "${ECHO_T}$ac_cv_search_syslog" >&6
|
||||
if test "$ac_cv_search_syslog" != no; then
|
||||
test "$ac_cv_search_syslog" = "none required" || LIBS="$ac_cv_search_syslog $LIBS"
|
||||
|
||||
fi
|
||||
# OS/2 needs -lsyslog, BeOS needs -lbe
|
||||
fi
|
||||
|
||||
echo "$as_me:$LINENO: checking for jpeg_start_decompress in -ljpeg" >&5
|
||||
|
@ -6693,13 +6860,17 @@ fi
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for ac_header in fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \
|
||||
sys/time.h sys/shm.h \
|
||||
sys/time.h sys/shm.h sys/ipc.h sys/signal.h \
|
||||
sys/scanio.h scsi.h sys/scsi.h sys/scsicmd.h sys/scsiio.h \
|
||||
bsd/dev/scsireg.h scsi/sg.h /usr/src/linux/include/scsi/sg.h io/cam/cam.h \
|
||||
camlib.h os2.h sys/socket.h sys/io.h gscdds.h sys/hw.h \
|
||||
|
@ -6707,7 +6878,7 @@ for ac_header in fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \
|
|||
apollo/scsi.h sys/sdi_comm.h sys/passthrudef.h linux/ppdev.h \
|
||||
dev/ppbus/ppi.h machine/cpufunc.h usb.h sys/bitypes.h sys/sem.h sys/poll.h \
|
||||
IOKit/cdb/IOSCSILib.h IOKit/scsi-commands/SCSICommandOperationCodes.h \
|
||||
windows.h limits.h sys/ioctl.h asm/types.h
|
||||
windows.h be/kernel/OS.h be/drivers/USB_scanner.h limits.h sys/ioctl.h asm/types.h
|
||||
do
|
||||
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||
if eval "test \"\${$as_ac_Header+set}\" = set"; then
|
||||
|
@ -8636,6 +8807,10 @@ _ACEOF
|
|||
esac
|
||||
|
||||
|
||||
if test "$ac_cv_header_be_kernel_OS_h" = "yes" ; then
|
||||
ac_cv_func_getaddrinfo=no
|
||||
ac_cv_func_getnameinfo=no
|
||||
fi
|
||||
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
|
||||
# for constant arguments. Useless!
|
||||
echo "$as_me:$LINENO: checking for working alloca.h" >&5
|
||||
|
@ -10546,7 +10721,7 @@ ia64-*-hpux*)
|
|||
;;
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '#line 10549 "configure"' > conftest.$ac_ext
|
||||
echo '#line 10724 "configure"' > conftest.$ac_ext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
|
@ -11779,7 +11954,7 @@ fi
|
|||
|
||||
|
||||
# Provide some information about the compiler.
|
||||
echo "$as_me:11782:" \
|
||||
echo "$as_me:11957:" \
|
||||
"checking for Fortran 77 compiler version" >&5
|
||||
ac_compiler=`set X $ac_compile; echo $2`
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
|
||||
|
@ -12838,11 +13013,11 @@ else
|
|||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:12841: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:13016: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:12845: \$? = $ac_status" >&5
|
||||
echo "$as_me:13020: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
|
@ -13081,11 +13256,11 @@ else
|
|||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:13084: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:13259: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:13088: \$? = $ac_status" >&5
|
||||
echo "$as_me:13263: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
|
@ -13141,11 +13316,11 @@ else
|
|||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:13144: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:13319: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:13148: \$? = $ac_status" >&5
|
||||
echo "$as_me:13323: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
|
@ -15317,7 +15492,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 15320 "configure"
|
||||
#line 15495 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -15415,7 +15590,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 15418 "configure"
|
||||
#line 15593 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -17610,11 +17785,11 @@ else
|
|||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:17613: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:17788: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:17617: \$? = $ac_status" >&5
|
||||
echo "$as_me:17792: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
|
@ -17670,11 +17845,11 @@ else
|
|||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:17673: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:17848: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:17677: \$? = $ac_status" >&5
|
||||
echo "$as_me:17852: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
|
@ -19024,7 +19199,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 19027 "configure"
|
||||
#line 19202 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -19122,7 +19297,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 19125 "configure"
|
||||
#line 19300 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -19959,11 +20134,11 @@ else
|
|||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:19962: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:20137: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:19966: \$? = $ac_status" >&5
|
||||
echo "$as_me:20141: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
|
@ -20019,11 +20194,11 @@ else
|
|||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:20022: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:20197: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:20026: \$? = $ac_status" >&5
|
||||
echo "$as_me:20201: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
|
@ -22056,11 +22231,11 @@ else
|
|||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:22059: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:22234: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:22063: \$? = $ac_status" >&5
|
||||
echo "$as_me:22238: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
|
@ -22299,11 +22474,11 @@ else
|
|||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:22302: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:22477: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:22306: \$? = $ac_status" >&5
|
||||
echo "$as_me:22481: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
|
@ -22359,11 +22534,11 @@ else
|
|||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:22362: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:22537: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:22366: \$? = $ac_status" >&5
|
||||
echo "$as_me:22541: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
|
@ -24535,7 +24710,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 24538 "configure"
|
||||
#line 24713 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -24633,7 +24808,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 24636 "configure"
|
||||
#line 24811 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -25648,7 +25823,7 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
|||
|
||||
|
||||
|
||||
if test "$ac_cv_header_windows_h" = "yes" ; then
|
||||
if test "$ac_cv_header_windows_h" = "yes" -o "$ac_cv_header_be_kernel_OS_h" = "yes" ; then
|
||||
LIBTOOL_LINK_EXTRA=-no-undefined
|
||||
|
||||
fi
|
||||
|
@ -25762,7 +25937,7 @@ fi;
|
|||
else
|
||||
BACKENDS="${BACKENDS} sm3600"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
@ -25778,6 +25953,13 @@ else
|
|||
fi
|
||||
|
||||
|
||||
if test "$ac_cv_header_be_kernel_OS_h" = "yes" ; then
|
||||
BEOS_ADDONDIR="${libdir}/../add-ons/SANE"
|
||||
|
||||
BE_INSTALL_FLAVOR=-beos
|
||||
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-scsibuffersize or --disable-scsibuffersize was given.
|
||||
if test "${enable_scsibuffersize+set}" = set; then
|
||||
|
@ -26492,6 +26674,7 @@ s,@host@,$host,;t t
|
|||
s,@host_cpu@,$host_cpu,;t t
|
||||
s,@host_vendor@,$host_vendor,;t t
|
||||
s,@host_os@,$host_os,;t t
|
||||
s,@docdir@,$docdir,;t t
|
||||
s,@CC@,$CC,;t t
|
||||
s,@CFLAGS@,$CFLAGS,;t t
|
||||
s,@LDFLAGS@,$LDFLAGS,;t t
|
||||
|
@ -26551,6 +26734,8 @@ s,@SANEI_JPEG@,$SANEI_JPEG,;t t
|
|||
s,@SANEI_JPEG_LO@,$SANEI_JPEG_LO,;t t
|
||||
s,@BACKENDS@,$BACKENDS,;t t
|
||||
s,@DLL_PRELOAD@,$DLL_PRELOAD,;t t
|
||||
s,@BEOS_ADDONDIR@,$BEOS_ADDONDIR,;t t
|
||||
s,@BE_INSTALL_FLAVOR@,$BE_INSTALL_FLAVOR,;t t
|
||||
s,@INSTALL_TRANSLATIONS@,$INSTALL_TRANSLATIONS,;t t
|
||||
s,@USE_LATEX@,$USE_LATEX,;t t
|
||||
s,@DISTCLEAN_FILES@,$DISTCLEAN_FILES,;t t
|
||||
|
|
41
configure.in
41
configure.in
|
@ -33,6 +33,17 @@ AC_SUBST(NUMBER_VERSION)
|
|||
AC_CANONICAL_BUILD
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
dnl no bloody way to have a decent --docdir...
|
||||
AC_ARG_WITH(docdir,
|
||||
AC_HELP_STRING([--with-docdir=DIR],
|
||||
[documentation @<:@PREFIX/doc/sane-VERSION@:>@]),
|
||||
[
|
||||
docdir="${withval}"
|
||||
AC_SUBST([docdir])dnl
|
||||
], [
|
||||
AC_SUBST([docdir], ['${prefix}/doc/sane-${VERSION}'])dnl
|
||||
])
|
||||
|
||||
dnl ***********************************************************************
|
||||
dnl Checks for programs.
|
||||
dnl ***********************************************************************
|
||||
|
@ -86,9 +97,9 @@ AC_CHECK_LIB(cam, cam_open_device) # FreeBSD 3+ needs this
|
|||
dnl IRIX sometimes has SYSVR3/4 network DSOs, but we do not need or want
|
||||
dnl to use them!
|
||||
if test "`uname`" != "IRIX" -a "`uname`" != "IRIX64"; then
|
||||
AC_CHECK_LIB(nsl, gethostbyaddr)
|
||||
AC_CHECK_LIB(socket, socket)
|
||||
AC_CHECK_LIB(syslog, syslog) # OS/2 needs this
|
||||
AC_SEARCH_LIBS(gethostbyaddr, nsl bind)
|
||||
AC_SEARCH_LIBS(socket, socket)
|
||||
AC_SEARCH_LIBS(syslog, syslog be) # OS/2 needs -lsyslog, BeOS needs -lbe
|
||||
fi
|
||||
SANE_CHECK_JPEG
|
||||
SANE_CHECK_IEEE1284
|
||||
|
@ -103,7 +114,7 @@ dnl Checks for header files.
|
|||
dnl ***********************************************************************
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \
|
||||
sys/time.h sys/shm.h \
|
||||
sys/time.h sys/shm.h sys/ipc.h sys/signal.h \
|
||||
sys/scanio.h scsi.h sys/scsi.h sys/scsicmd.h sys/scsiio.h \
|
||||
bsd/dev/scsireg.h scsi/sg.h /usr/src/linux/include/scsi/sg.h io/cam/cam.h \
|
||||
camlib.h os2.h sys/socket.h sys/io.h gscdds.h sys/hw.h \
|
||||
|
@ -111,7 +122,7 @@ AC_CHECK_HEADERS(fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \
|
|||
apollo/scsi.h sys/sdi_comm.h sys/passthrudef.h linux/ppdev.h \
|
||||
dev/ppbus/ppi.h machine/cpufunc.h usb.h sys/bitypes.h sys/sem.h sys/poll.h \
|
||||
IOKit/cdb/IOSCSILib.h IOKit/scsi-commands/SCSICommandOperationCodes.h \
|
||||
windows.h limits.h sys/ioctl.h asm/types.h)
|
||||
windows.h be/kernel/OS.h be/drivers/USB_scanner.h limits.h sys/ioctl.h asm/types.h)
|
||||
AC_CHECK_HEADERS([asm/io.h],,,[#include <sys/types.h>])
|
||||
SANE_CHECK_MISSING_HEADERS
|
||||
|
||||
|
@ -204,6 +215,11 @@ AC_C_INLINE
|
|||
dnl ***********************************************************************
|
||||
dnl Checks for library functions
|
||||
dnl ***********************************************************************
|
||||
if test "$ac_cv_header_be_kernel_OS_h" = "yes" ; then
|
||||
dnl those are known to be broken in BeOS (BONE)
|
||||
ac_cv_func_getaddrinfo=no
|
||||
ac_cv_func_getnameinfo=no
|
||||
fi
|
||||
AC_FUNC_ALLOCA
|
||||
AC_FUNC_MMAP
|
||||
AC_CHECK_FUNCS(atexit inet_addr inet_aton inet_ntoa ioperm i386_set_ioperm mkdir \
|
||||
|
@ -270,7 +286,8 @@ AC_DISABLE_STATIC
|
|||
AC_PROG_LIBTOOL
|
||||
|
||||
dnl Windows/Cygwin needs this, else the library creation fails
|
||||
if test "$ac_cv_header_windows_h" = "yes" ; then
|
||||
dnl BeOS also needs this (why isnt it the default anyway ???)
|
||||
if test "$ac_cv_header_windows_h" = "yes" -o "$ac_cv_header_be_kernel_OS_h" = "yes" ; then
|
||||
LIBTOOL_LINK_EXTRA=-no-undefined
|
||||
AC_SUBST(LIBTOOL_LINK_EXTRA)
|
||||
fi
|
||||
|
@ -384,7 +401,7 @@ else
|
|||
else
|
||||
BACKENDS="${BACKENDS} sm3600"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(BACKENDS)
|
||||
|
@ -400,6 +417,16 @@ else
|
|||
fi
|
||||
AC_SUBST(DLL_PRELOAD)
|
||||
|
||||
dnl in BeOS, backends are not installed in lib/sane, but add-ons/SANE/
|
||||
dnl we account for both installing in /boot/beos and ~/config
|
||||
dnl faster than: if test "`uname`" = "BeOS" -o "`uname`" = "Zeta" ; then
|
||||
if test "$ac_cv_header_be_kernel_OS_h" = "yes" ; then
|
||||
BEOS_ADDONDIR="${libdir}/../add-ons/SANE"
|
||||
AC_SUBST(BEOS_ADDONDIR)
|
||||
BE_INSTALL_FLAVOR=-beos
|
||||
AC_SUBST(BE_INSTALL_FLAVOR)
|
||||
fi
|
||||
|
||||
|
||||
AC_ARG_ENABLE(scsibuffersize,
|
||||
AC_HELP_STRING([--enable-scsibuffersize=N],
|
||||
|
|
|
@ -25,7 +25,7 @@ mandir = @mandir@
|
|||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
configdir = ${sysconfdir}/sane.d
|
||||
docdir=$(prefix)/doc/sane-@VERSION@
|
||||
docdir = @docdir@
|
||||
|
||||
MKDIR = $(top_srcdir)/mkinstalldirs
|
||||
INSTALL = @INSTALL@
|
||||
|
@ -60,7 +60,7 @@ READMES = README AUTHORS COPYING ChangeLog LICENSE NEWS PROBLEMS \
|
|||
PROJECTS README README.aix README.beos README.darwin README.freebsd \
|
||||
README.djpeg \
|
||||
README.hp-ux README.linux README.netbsd README.openbsd README.os2 \
|
||||
README.solaris README.unixware2 README.unixware7 README.windows
|
||||
README.solaris README.unixware2 README.unixware7 README.windows README.zeta
|
||||
DOCS = backend-writing.txt sane.ps sane.dvi
|
||||
BACKDIRS= canon leo matsushita mustek mustek_usb plustek u12 umax sceptre teco gt68xx niash
|
||||
LATEX = TEXINPUTS=$(srcdir):$$TEXINPUTS @LATEX@
|
||||
|
@ -204,14 +204,14 @@ html-man: $(MANPAGES)
|
|||
cd ../tools ; $(MAKE) sane-desc
|
||||
|
||||
sane-backends.html: $(wildcard descriptions/*.desc) ../tools/sane-desc
|
||||
@../tools/sane-desc -m html-backends-split -s descriptions \
|
||||
@../tools/sane-desc -m html-backends-split -s ${srcdir}/descriptions \
|
||||
-i "The following table summarizes the backends/drivers distributed \
|
||||
with $(PACKAGE)-$(VERSION), and the hardware or software they \
|
||||
support." -d 1 > sane-backends.html
|
||||
|
||||
sane-backends-external.html: $(wildcard descriptions-external/*.desc) \
|
||||
../tools/sane-desc
|
||||
@../tools/sane-desc -m html-backends-split -s descriptions-external \
|
||||
@../tools/sane-desc -m html-backends-split -s ${srcdir}/descriptions-external \
|
||||
-i "The following table summarizes the backends/drivers that \
|
||||
have not yet been included in the SANE distribution, and the \
|
||||
hardware or software they support." \
|
||||
|
@ -219,14 +219,14 @@ sane-backends-external.html: $(wildcard descriptions-external/*.desc) \
|
|||
> sane-backends-external.html
|
||||
|
||||
sane-mfgs.html: $(wildcard descriptions/*.desc) ../tools/sane-desc
|
||||
@../tools/sane-desc -m html-mfgs -s descriptions \
|
||||
@../tools/sane-desc -m html-mfgs -s ${srcdir}/descriptions \
|
||||
-i "The following table summarizes the devices supported \
|
||||
by $(PACKAGE)-$(VERSION)." \
|
||||
-d 1 > sane-mfgs.html
|
||||
|
||||
sane-mfgs-external.html: $(wildcard descriptions-external/*.desc) \
|
||||
../tools/sane-desc
|
||||
@../tools/sane-desc -m html-mfgs -s descriptions-external \
|
||||
@../tools/sane-desc -m html-mfgs -s ${srcdir}/descriptions-external \
|
||||
-i "The following table summarizes the devices that \
|
||||
are supported by external backends." \
|
||||
-t "SANE: Devices Supported by External Backends" -d 1 \
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "../include/sane/config.h"
|
||||
#include "../include/lalloca.h"
|
||||
#include "../include/sys/types.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(HAVE_GETADDRINFO) && defined (HAVE_GETNAMEINFO)
|
||||
# define SANED_USES_AF_INDEP
|
||||
|
|
|
@ -43,6 +43,12 @@
|
|||
/* Define to 1 if you have the `atexit' function. */
|
||||
#undef HAVE_ATEXIT
|
||||
|
||||
/* Define to 1 if you have the <be/drivers/USB_scanner.h> header file. */
|
||||
#undef HAVE_BE_DRIVERS_USB_SCANNER_H
|
||||
|
||||
/* Define to 1 if you have the <be/kernel/OS.h> header file. */
|
||||
#undef HAVE_BE_KERNEL_OS_H
|
||||
|
||||
/* Define to 1 if you have the <bsd/dev/scsireg.h> header file. */
|
||||
#undef HAVE_BSD_DEV_SCSIREG_H
|
||||
|
||||
|
@ -140,21 +146,12 @@
|
|||
/* Define to 1 if you have the `m' library (-lm). */
|
||||
#undef HAVE_LIBM
|
||||
|
||||
/* Define to 1 if you have the `nsl' library (-lnsl). */
|
||||
#undef HAVE_LIBNSL
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#undef HAVE_LIBPTHREAD
|
||||
|
||||
/* Define to 1 if you have the `scsi' library (-lscsi). */
|
||||
#undef HAVE_LIBSCSI
|
||||
|
||||
/* Define to 1 if you have the `socket' library (-lsocket). */
|
||||
#undef HAVE_LIBSOCKET
|
||||
|
||||
/* Define to 1 if you have the `syslog' library (-lsyslog). */
|
||||
#undef HAVE_LIBSYSLOG
|
||||
|
||||
/* Define to 1 if you have the `usb' library (-lusb). */
|
||||
#undef HAVE_LIBUSB
|
||||
|
||||
|
@ -287,6 +284,9 @@
|
|||
/* Define to 1 if you have the <sys/io.h> header file. */
|
||||
#undef HAVE_SYS_IO_H
|
||||
|
||||
/* Define to 1 if you have the <sys/ipc.h> header file. */
|
||||
#undef HAVE_SYS_IPC_H
|
||||
|
||||
/* Define to 1 if you have the <sys/passthrudef.h> header file. */
|
||||
#undef HAVE_SYS_PASSTHRUDEF_H
|
||||
|
||||
|
@ -326,6 +326,9 @@
|
|||
/* Define to 1 if you have the <sys/shm.h> header file. */
|
||||
#undef HAVE_SYS_SHM_H
|
||||
|
||||
/* Define to 1 if you have the <sys/signal.h> header file. */
|
||||
#undef HAVE_SYS_SIGNAL_H
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#undef HAVE_SYS_SOCKET_H
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ localedir = $(datadir)/locale
|
|||
gnulocaledir = $(prefix)/share/locale
|
||||
top_srcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
|
|
@ -72,6 +72,10 @@
|
|||
|
||||
#define DEFAULT_DIRS "." DIR_SEP STRINGIFY(PATH_SANE_CONFIG_DIR)
|
||||
|
||||
#ifdef __BEOS__
|
||||
#include <FindDirectory.h>
|
||||
#endif
|
||||
|
||||
static const char *dir_list;
|
||||
|
||||
FILE *
|
||||
|
@ -87,6 +91,18 @@ sanei_config_open (const char *filename)
|
|||
DBG_INIT();
|
||||
|
||||
dir_list = getenv ("SANE_CONFIG_DIR");
|
||||
#ifdef __BEOS__
|
||||
/* ~/config/settings/SANE takes precedence over /etc/sane.d/ */
|
||||
if (!dir_list)
|
||||
{
|
||||
if (find_directory(B_USER_SETTINGS_DIRECTORY, 0, true, result, PATH_MAX) == B_OK)
|
||||
{
|
||||
strcat(result,"/SANE");
|
||||
strcat(result,DIR_SEP); /* do append the default ones */
|
||||
dir_list = result;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (dir_list)
|
||||
{
|
||||
len = strlen (dir_list);
|
||||
|
|
|
@ -47,6 +47,12 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __BEOS__
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#include <drivers/USB_scanner.h>
|
||||
#endif
|
||||
|
||||
#include "sane/sanei.h"
|
||||
#include "sane/sanei_config.h"
|
||||
#include "sane/sanei_scsi.h"
|
||||
|
|
|
@ -100,6 +100,7 @@ sanei_debug_msg
|
|||
|
||||
if (max_level >= level)
|
||||
{
|
||||
#ifdef S_IFSOCK
|
||||
if ( 1 == isfdtype(fileno(stderr), S_IFSOCK) )
|
||||
{
|
||||
msg = (char *)malloc (sizeof(char) * (strlen(be) + strlen(fmt) + 4));
|
||||
|
@ -116,6 +117,7 @@ sanei_debug_msg
|
|||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
fprintf (stderr, "[%s] ", be);
|
||||
vfprintf (stderr, fmt, ap);
|
||||
|
|
|
@ -524,6 +524,45 @@ sanei_pio_write (int fd, const u_char * buf, int n)
|
|||
|
||||
#else /* !HAVE_IOPERM */
|
||||
|
||||
#ifdef __BEOS__
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
SANE_Status
|
||||
sanei_pio_open (const char *dev, int *fdp)
|
||||
{
|
||||
int fp;
|
||||
|
||||
// open internal parallel port
|
||||
fp=open("/dev/parallel/parallel1",O_RDWR);
|
||||
|
||||
*fdp=fp;
|
||||
if(fp<0) return SANE_STATUS_INVAL;
|
||||
return(SANE_STATUS_GOOD);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
sanei_pio_close (int fd)
|
||||
{
|
||||
close(fd);
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
sanei_pio_read (int fd, u_char * buf, int n)
|
||||
{
|
||||
return(read(fd,buf,n));
|
||||
}
|
||||
|
||||
int
|
||||
sanei_pio_write (int fd, const u_char * buf, int n)
|
||||
{
|
||||
return(write(fd,buf,n));
|
||||
}
|
||||
|
||||
#else /* !__BEOS__ */
|
||||
|
||||
SANE_Status
|
||||
sanei_pio_open (const char *dev, int *fdp)
|
||||
{
|
||||
|
@ -549,5 +588,6 @@ sanei_pio_write (int fd, const u_char * buf, int n)
|
|||
{
|
||||
return -1;
|
||||
}
|
||||
#endif /* __BEOS__ */
|
||||
|
||||
#endif /* !HAVE_IOPERM */
|
||||
|
|
|
@ -64,7 +64,11 @@
|
|||
# define INCL_DOSPROCESS
|
||||
# include <os2.h>
|
||||
#endif
|
||||
#if !defined USE_PTHREAD && !defined HAVE_OS2_H
|
||||
#ifdef __BEOS__
|
||||
# undef USE_PTHREAD /* force */
|
||||
# include <kernel/OS.h>
|
||||
#endif
|
||||
#if !defined USE_PTHREAD && !defined HAVE_OS2_H && !defined __BEOS__
|
||||
# include <sys/wait.h>
|
||||
#endif
|
||||
#if defined USE_PTHREAD
|
||||
|
@ -105,7 +109,7 @@ sanei_thread_init( void )
|
|||
SANE_Bool
|
||||
sanei_thread_is_forked( void )
|
||||
{
|
||||
#if defined USE_PTHREAD || defined HAVE_OS2_H
|
||||
#if defined USE_PTHREAD || defined HAVE_OS2_H || defined __BEOS__
|
||||
return SANE_FALSE;
|
||||
#else
|
||||
return SANE_TRUE;
|
||||
|
@ -182,7 +186,69 @@ sanei_thread_sendsig( int pid, int sig )
|
|||
return 0;
|
||||
}
|
||||
|
||||
#else /* HAVE_OS2_H */
|
||||
#elif defined __BEOS__
|
||||
|
||||
static int32
|
||||
local_thread( void *arg )
|
||||
{
|
||||
pThreadDataDef ltd = (pThreadDataDef)arg;
|
||||
|
||||
DBG( 2, "thread started, calling func() now...\n" );
|
||||
ltd->status = ltd->func( ltd->func_data );
|
||||
|
||||
DBG( 2, "func() done - status = %d\n", ltd->status );
|
||||
return ltd->status;
|
||||
}
|
||||
|
||||
/*
|
||||
* starts a new thread or process
|
||||
* parameters:
|
||||
* star address of reader function
|
||||
* args pointer to scanner data structure
|
||||
*
|
||||
*/
|
||||
int
|
||||
sanei_thread_begin( int (*func)(void *args), void* args )
|
||||
{
|
||||
int pid;
|
||||
|
||||
td.func = func;
|
||||
td.func_data = args;
|
||||
|
||||
pid = spawn_thread( local_thread, "sane thread (yes they can be)", B_NORMAL_PRIORITY, (void*)&td );
|
||||
if ( pid < B_OK ) {
|
||||
DBG( 1, "spawn_thread() failed\n" );
|
||||
return -1;
|
||||
}
|
||||
if ( resume_thread(pid) < B_OK ) {
|
||||
DBG( 1, "resume_thread() failed\n" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
DBG( 2, "spawn_thread() created thread %d\n", pid );
|
||||
return pid;
|
||||
}
|
||||
|
||||
int
|
||||
sanei_thread_waitpid( int pid, int *status )
|
||||
{
|
||||
int32 st;
|
||||
if ( wait_for_thread(pid, &st) < B_OK )
|
||||
return -1;
|
||||
if ( status )
|
||||
*status = (int)st;
|
||||
return pid;
|
||||
}
|
||||
|
||||
int
|
||||
sanei_thread_sendsig( int pid, int sig )
|
||||
{
|
||||
if (sig == SIGKILL)
|
||||
sig = SIGKILLTHR;
|
||||
return kill(pid, sig);
|
||||
}
|
||||
|
||||
#else /* HAVE_OS2_H, __BEOS__ */
|
||||
|
||||
#ifdef USE_PTHREAD
|
||||
|
||||
|
@ -404,7 +470,7 @@ sanei_thread_waitpid( int pid, int *status )
|
|||
SANE_Status
|
||||
sanei_thread_get_status( int pid )
|
||||
{
|
||||
#if defined USE_PTHREAD || defined HAVE_OS2_H
|
||||
#if defined USE_PTHREAD || defined HAVE_OS2_H || defined __BEOS__
|
||||
_VAR_NOT_USED( pid );
|
||||
|
||||
return td.status;
|
||||
|
|
|
@ -138,6 +138,9 @@ struct ctrlmsg_ioctl
|
|||
void *data;
|
||||
}
|
||||
cmsg;
|
||||
#elif defined(__BEOS__)
|
||||
#include <drivers/USB_scanner.h>
|
||||
#include <kernel/OS.h>
|
||||
#endif /* __linux__ */
|
||||
|
||||
static SANE_Bool inited = SANE_FALSE;
|
||||
|
@ -202,7 +205,20 @@ kernel_get_vendor_product (int fd, int *vendorID, int *productID)
|
|||
DBG (3, "sanei_usb_get_vendor_product: ioctl (product) "
|
||||
"of device %d failed: %s\n", fd, strerror (errno));
|
||||
}
|
||||
#endif /* defined (__linux__) */
|
||||
#elif defined(__BEOS__)
|
||||
{
|
||||
uint16 vendor, product;
|
||||
if (ioctl (fd, B_SCANNER_IOCTL_VENDOR, &vendor) != B_OK)
|
||||
DBG (3, "kernel_get_vendor_product: ioctl (vendor) "
|
||||
"of device %d failed: %s\n", fd, strerror (errno));
|
||||
if (ioctl (fd, B_SCANNER_IOCTL_PRODUCT, &product) != B_OK)
|
||||
DBG (3, "sanei_usb_get_vendor_product: ioctl (product) "
|
||||
"of device %d failed: %s\n", fd, strerror (errno));
|
||||
/* copy from 16 to 32 bit value */
|
||||
*vendorID = vendor;
|
||||
*productID = product;
|
||||
}
|
||||
#endif /* defined (__linux__), defined(__BEOS__) */
|
||||
/* put more os-dependant stuff ... */
|
||||
}
|
||||
|
||||
|
@ -216,6 +232,8 @@ sanei_usb_init (void)
|
|||
"/dev/usb/", "scanner",
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined (__OpenBSD__)
|
||||
"/dev/", "uscanner",
|
||||
#elif defined(__BEOS__)
|
||||
"/dev/scanner/usb/", "",
|
||||
#endif
|
||||
0, 0
|
||||
};
|
||||
|
@ -272,6 +290,10 @@ sanei_usb_init (void)
|
|||
|
||||
while ((dir_entry = readdir (dir)) != 0)
|
||||
{
|
||||
/* skip standard dir entries */
|
||||
if (strcmp (dir_entry->d_name, ".") == 0 || strcmp (dir_entry->d_name, "..") == 0)
|
||||
continue;
|
||||
|
||||
if (strncmp (base_name, dir_entry->d_name, strlen (base_name)) == 0)
|
||||
{
|
||||
if (strlen (dir_name) + strlen (dir_entry->d_name) + 1 >
|
||||
|
@ -1101,6 +1123,26 @@ sanei_usb_control_msg (SANE_Int dn, SANE_Int rtype, SANE_Int req,
|
|||
if ((rtype & 0x80) && debug_level > 10)
|
||||
print_buffer (data, len);
|
||||
return SANE_STATUS_GOOD;
|
||||
#elif defined(__BEOS__)
|
||||
struct usb_scanner_ioctl_ctrlmsg c;
|
||||
|
||||
c.req.request_type = rtype;
|
||||
c.req.request = req;
|
||||
c.req.value = value;
|
||||
c.req.index = index;
|
||||
c.req.length = len;
|
||||
c.data = data;
|
||||
|
||||
if (ioctl (devices[dn].fd, B_SCANNER_IOCTL_CTRLMSG, &c) < 0)
|
||||
{
|
||||
DBG (5, "sanei_usb_control_msg: SCANNER_IOCTL_CTRLMSG error - %s\n",
|
||||
strerror (errno));
|
||||
return SANE_STATUS_IO_ERROR;
|
||||
}
|
||||
if ((rtype & 0x80) && debug_level > 10)
|
||||
print_buffer (data, len);
|
||||
|
||||
return SANE_STATUS_GOOD;
|
||||
#else /* not __linux__ */
|
||||
DBG (5, "sanei_usb_control_msg: not supported on this OS\n");
|
||||
return SANE_STATUS_UNSUPPORTED;
|
||||
|
|
Ładowanie…
Reference in New Issue