kopia lustrzana https://gitlab.com/sane-project/backends
use SCSITaskSGElement if available
rodzic
71f9081904
commit
71be983cdd
|
@ -7,15 +7,18 @@
|
|||
* configure.in: move the byteorder test to after AC_GNU_SOURCE et al.
|
||||
to avoid warnings when running autoconf,
|
||||
add AC_SUBST(CROSS_COMPILING),
|
||||
add a check for IOKit/scsi/SCSICommandOperationCodes.h
|
||||
add a check for IOKit/scsi/SCSICommandOperationCodes.h,
|
||||
add a check for SCSITaskSGElement (for darwin 64 bit support)
|
||||
* doc/Makefile.in, tools/Makefile.in: disable things that need the
|
||||
built binaries to run when doing cross-compilations
|
||||
* sanei/sanei_scsi.c, tools/sane-find-scanner.c: IOKit/scsi-commands
|
||||
has moved to IOKit/scsi - support both locations of headers
|
||||
* sanei/sanei_scsi.c: IOKit/scsi-commands has moved to IOKit/scsi -
|
||||
support both locations of headers, use SCSITaskSGElement if available
|
||||
* aclocal.m4, config.guess, config.sub, configure,
|
||||
include/sane/config.h.in: update autogenerated files
|
||||
* backends/Makefile.in: remove sanei_config2 from cardscan deps
|
||||
* backends/dll.c: add MacOS X naming convention for dlopen
|
||||
* tools/sane-find-scanner.c: IOKit/scsi-commands has moved to
|
||||
IOKit/scsi - support both locations of headers, fix some warnings
|
||||
|
||||
2007-11-08 Gerhard Jaeger <gerhard@gjaeger.de>
|
||||
|
||||
|
|
|
@ -10049,6 +10049,63 @@ fi
|
|||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
{ echo "$as_me:$LINENO: checking for SCSITaskSGElement in IOKit/scsi/SCSITaskLib.h" >&5
|
||||
echo $ECHO_N "checking for SCSITaskSGElement in IOKit/scsi/SCSITaskLib.h... $ECHO_C" >&6; }
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
#undef VERSION
|
||||
#include <IOKit/scsi/SCSITaskLib.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
SCSITaskSGElement range;
|
||||
return 0;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext
|
||||
if { (ac_try="$ac_compile"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_compile") 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); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest.$ac_objext; then
|
||||
{ echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6; };
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_SCSITASKSGELEMENT 1
|
||||
_ACEOF
|
||||
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
{ echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6; }
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
|
||||
echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
|
||||
if test "${ac_cv_c_bigendian+set}" = set; then
|
||||
|
@ -12365,7 +12422,7 @@ ia64-*-hpux*)
|
|||
;;
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '#line 12368 "configure"' > conftest.$ac_ext
|
||||
echo '#line 12425 "configure"' > conftest.$ac_ext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
|
@ -14808,11 +14865,11 @@ else
|
|||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:14811: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:14868: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:14815: \$? = $ac_status" >&5
|
||||
echo "$as_me:14872: \$? = $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 other than the usual output.
|
||||
|
@ -15076,11 +15133,11 @@ else
|
|||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:15079: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:15136: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:15083: \$? = $ac_status" >&5
|
||||
echo "$as_me:15140: \$? = $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 other than the usual output.
|
||||
|
@ -15180,11 +15237,11 @@ else
|
|||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:15183: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:15240: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:15187: \$? = $ac_status" >&5
|
||||
echo "$as_me:15244: \$? = $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
|
||||
|
@ -17488,7 +17545,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 17491 "configure"
|
||||
#line 17548 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -17588,7 +17645,7 @@ else
|
|||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 17591 "configure"
|
||||
#line 17648 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -19928,11 +19985,11 @@ else
|
|||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:19931: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:19988: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:19935: \$? = $ac_status" >&5
|
||||
echo "$as_me:19992: \$? = $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 other than the usual output.
|
||||
|
@ -20032,11 +20089,11 @@ else
|
|||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:20035: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:20092: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:20039: \$? = $ac_status" >&5
|
||||
echo "$as_me:20096: \$? = $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
|
||||
|
@ -21602,11 +21659,11 @@ else
|
|||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:21605: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:21662: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:21609: \$? = $ac_status" >&5
|
||||
echo "$as_me:21666: \$? = $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 other than the usual output.
|
||||
|
@ -21706,11 +21763,11 @@ else
|
|||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:21709: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:21766: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:21713: \$? = $ac_status" >&5
|
||||
echo "$as_me:21770: \$? = $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
|
||||
|
@ -23908,11 +23965,11 @@ else
|
|||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:23911: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:23968: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:23915: \$? = $ac_status" >&5
|
||||
echo "$as_me:23972: \$? = $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 other than the usual output.
|
||||
|
@ -24176,11 +24233,11 @@ else
|
|||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:24179: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:24236: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:24183: \$? = $ac_status" >&5
|
||||
echo "$as_me:24240: \$? = $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 other than the usual output.
|
||||
|
@ -24280,11 +24337,11 @@ else
|
|||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:24283: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:24340: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:24287: \$? = $ac_status" >&5
|
||||
echo "$as_me:24344: \$? = $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
|
||||
|
|
11
configure.in
11
configure.in
|
@ -226,6 +226,17 @@ __u32 houba = _IOR('v',14, unsigned long);
|
|||
],[AC_MSG_RESULT(yes);
|
||||
have_linux_ioctl_defines="yes";],AC_MSG_RESULT(no))
|
||||
|
||||
AC_MSG_CHECKING([for SCSITaskSGElement in IOKit/scsi/SCSITaskLib.h])
|
||||
AC_TRY_COMPILE([
|
||||
#undef VERSION
|
||||
#include <IOKit/scsi/SCSITaskLib.h>
|
||||
],[
|
||||
SCSITaskSGElement range;
|
||||
return 0;
|
||||
],[AC_MSG_RESULT(yes);
|
||||
AC_DEFINE(HAVE_SCSITASKSGELEMENT,1,[Define if SCSITaskSGElement is available.])],
|
||||
AC_MSG_RESULT(no))
|
||||
|
||||
dnl ***********************************************************************
|
||||
dnl Checks for compiler characteristics
|
||||
dnl ***********************************************************************
|
||||
|
|
|
@ -222,6 +222,9 @@
|
|||
/* Define to 1 if you have the `scsireq_enter' function. */
|
||||
#undef HAVE_SCSIREQ_ENTER
|
||||
|
||||
/* Define if SCSITaskSGElement is available. */
|
||||
#undef HAVE_SCSITASKSGELEMENT
|
||||
|
||||
/* Define to 1 if you have the <scsi.h> header file. */
|
||||
#undef HAVE_SCSI_H
|
||||
|
||||
|
|
|
@ -5401,7 +5401,7 @@ sanei_scsi_find_devices (const char *findvendor, const char *findmodel,
|
|||
if (plugInResult != S_OK)
|
||||
{
|
||||
DBG (5, "Couldn't create SCSI device interface (%ld)\n",
|
||||
plugInResult);
|
||||
(long) plugInResult);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5421,10 +5421,14 @@ sanei_scsi_find_devices (const char *findvendor, const char *findmodel,
|
|||
SCSI_Sense_Data senseData;
|
||||
SCSICommandDescriptorBlock cdb;
|
||||
IOReturn ioReturnValue;
|
||||
#ifdef HAVE_SCSITASKSGELEMENT
|
||||
SCSITaskSGElement range;
|
||||
#else
|
||||
IOVirtualRange range;
|
||||
#endif
|
||||
UInt64 transferCount = 0;
|
||||
size_t data_length = 0;
|
||||
int transferType = 0;
|
||||
UInt64 data_length = 0;
|
||||
UInt8 transferType = 0;
|
||||
|
||||
if (dst && dst_size) /* isRead */
|
||||
{
|
||||
|
@ -5434,7 +5438,7 @@ sanei_scsi_find_devices (const char *findvendor, const char *findmodel,
|
|||
bzero (dst, *dst_size);
|
||||
|
||||
/* Configure the virtual range for the buffer. */
|
||||
range.address = (IOVirtualAddress) dst;
|
||||
range.address = (long) dst;
|
||||
range.length = *dst_size;
|
||||
|
||||
data_length = *dst_size;
|
||||
|
@ -5445,7 +5449,7 @@ sanei_scsi_find_devices (const char *findvendor, const char *findmodel,
|
|||
DBG (6, "isWrite src_size:%ld\n", src_size);
|
||||
|
||||
/* Configure the virtual range for the buffer. */
|
||||
range.address = (IOVirtualAddress) src;
|
||||
range.address = (long) src;
|
||||
range.length = src_size;
|
||||
|
||||
data_length = src_size;
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
#include "../include/sane/sanei.h"
|
||||
#include "../include/sane/sanei_scsi.h"
|
||||
#include "../include/sane/sanei_usb.h"
|
||||
#include "../include/sane/sanei_pa4s2.h"
|
||||
#include "../include/sane/sanei_config.h"
|
||||
|
||||
|
@ -47,6 +46,8 @@
|
|||
extern char * check_usb_chip (struct usb_device *dev, int verbosity, SANE_Bool from_file);
|
||||
#endif
|
||||
|
||||
#include "../include/sane/sanei_usb.h"
|
||||
|
||||
#ifndef PATH_MAX
|
||||
# define PATH_MAX 1024
|
||||
#endif
|
||||
|
@ -721,7 +722,7 @@ get_next_file (char *dir_name, DIR * dir)
|
|||
|
||||
#if defined (HAVE_WINDOWS_H)
|
||||
/* Return a list of potential scanners. There's a lot of hardcoded values here that might break on a system with lots of scsi devices. */
|
||||
static char **build_scsi_dev_list()
|
||||
static char **build_scsi_dev_list(void)
|
||||
{
|
||||
char **dev_list;
|
||||
int dev_list_index;
|
||||
|
@ -834,7 +835,7 @@ static SANE_Status AddToSCSIDeviceList (const char *dev) {
|
|||
return SANE_STATUS_NO_MEM;
|
||||
}
|
||||
|
||||
static char **build_scsi_dev_list()
|
||||
static char **build_scsi_dev_list(void)
|
||||
{
|
||||
scsi_dev_list_index = 0;
|
||||
scsi_dev_list = malloc (100 * sizeof(char *));
|
||||
|
|
Ładowanie…
Reference in New Issue