From 929c5c9e75feb21c86db5112f4900eaaf996dd5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Voltz?= Date: Thu, 18 Sep 2003 05:17:23 +0000 Subject: [PATCH] * backend/sane-umax_pp.c: fix default port address handling (patch from Malcolm Parsons ) * configure.in configure include/sane/config.h.in: added detection of machine/cpufunc.h and i386_set_ioperm() for FreeBSD support. --- ChangeLog | 8 ++++++ backend/umax_pp.c | 22 ++++++++------ configure | 62 +++++++++++++++++++++------------------- configure.in | 4 +-- include/sane/config.h.in | 6 ++++ 5 files changed, 62 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index 99fd2bd39..cabbf484f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-09-18 Stéphane Voltz + + * backend/sane-umax_pp.c: fix default port address handling + (patch from Malcolm Parsons ) + * configure.in configure include/sane/config.h.in: added detection of + machine/cpufunc.h and i386_set_ioperm() for FreeBSD support. + + 2003-09-16 Stéphane Voltz * doc/sane-umax_pp_low.man: updated man page diff --git a/backend/umax_pp.c b/backend/umax_pp.c index 19c8987ab..4d53c58ed 100644 --- a/backend/umax_pp.c +++ b/backend/umax_pp.c @@ -1130,10 +1130,18 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) DBG (3, "open: trying default device %s, port=%s,ppdev=%s\n", devlist[0].sane.name, devlist[0].port, devlist[0].ppdevice); if (devlist[0].port != NULL) - rc = sanei_umax_pp_open (atoi (devlist[0].port), NULL); + { + if ((devlist[0].port[0] == '0') + && ((devlist[0].port[1] == 'x') || (devlist[0].port[1] == 'X'))) + prt = strtol (devlist[0].port + 2, NULL, 16); + else + prt = atoi (devlist[0].port); + rc = sanei_umax_pp_open (prt, NULL); + } else - rc = sanei_umax_pp_open (0, devlist[0].ppdevice); - + { + rc = sanei_umax_pp_open (0, devlist[0].ppdevice); + } desc = &devlist[0]; } switch (rc) @@ -1141,8 +1149,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) case UMAX1220P_TRANSPORT_FAILED: if (name == NULL) { - DBG (1, "failed to init transport layer on port 0x%03X\n", - atoi (desc->port)); + DBG (1, "failed to init transport layer on port 0x%03X\n", prt); } else { @@ -1153,8 +1160,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) case UMAX1220P_SCANNER_FAILED: if (name == NULL) { - DBG (1, "failed to initialize scanner on port 0x%03X\n", - atoi (desc->port)); + DBG (1, "failed to initialize scanner on port 0x%03X\n", prt); } else { @@ -1164,7 +1170,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) case UMAX1220P_BUSY: if (name == NULL) { - DBG (1, "busy scanner on port 0x%03X\n", atoi (desc->port)); + DBG (1, "busy scanner on port 0x%03X\n", prt); } else { diff --git a/configure b/configure index 8f7d67105..417dc925a 100755 --- a/configure +++ b/configure @@ -5779,6 +5779,7 @@ fi + for ac_header in fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \ @@ -5788,7 +5789,7 @@ for ac_header in fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \ camlib.h os2.h sys/socket.h sys/io.h gscdds.h sys/hw.h \ sys/types.h sys/scsi/scsi.h sys/scsi/sgdefs.h sys/scsi/targets/scgio.h \ apollo/scsi.h sys/sdi_comm.h sys/passthrudef.h linux/ppdev.h \ - dev/ppbus/ppi.h usb.h sys/bitypes.h sys/sem.h sys/poll.h IOKit/IOKitLib.h + dev/ppbus/ppi.h machine/cpufunc.h usb.h sys/bitypes.h sys/sem.h sys/poll.h IOKit/IOKitLib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -8179,7 +8180,8 @@ rm -f conftest.mmap -for ac_func in atexit inet_addr inet_aton inet_ntoa ioperm mkdir \ + +for ac_func in atexit inet_addr inet_aton inet_ntoa ioperm i386_set_ioperm mkdir \ scsireq_enter strftime strstr strtod \ cfmakeraw tcsendbreak strcasecmp strncasecmp _portaccess \ getaddrinfo getnameinfo poll @@ -9230,7 +9232,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 9233 "configure"' > conftest.$ac_ext + echo '#line 9235 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -10409,7 +10411,7 @@ fi # Provide some information about the compiler. -echo "$as_me:10412:" \ +echo "$as_me:10414:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -11414,11 +11416,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:11417: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11419: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11421: \$? = $ac_status" >&5 + echo "$as_me:11423: \$? = $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 @@ -11646,11 +11648,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:11649: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11651: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11653: \$? = $ac_status" >&5 + echo "$as_me:11655: \$? = $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 @@ -11713,11 +11715,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:11716: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11718: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:11720: \$? = $ac_status" >&5 + echo "$as_me:11722: \$? = $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 @@ -13725,7 +13727,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:15960: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15962: \$? = $ac_status" >&5 + echo "$as_me:15964: \$? = $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 @@ -16022,11 +16024,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:16025: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16027: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16029: \$? = $ac_status" >&5 + echo "$as_me:16031: \$? = $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 @@ -17265,7 +17267,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:18190: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18192: \$? = $ac_status" >&5 + echo "$as_me:18194: \$? = $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 @@ -18252,11 +18254,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:18255: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18257: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18259: \$? = $ac_status" >&5 + echo "$as_me:18261: \$? = $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 @@ -20192,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:20195: $lt_compile\"" >&5) + (eval echo "\"\$as_me:20197: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:20199: \$? = $ac_status" >&5 + echo "$as_me:20201: \$? = $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 @@ -20424,11 +20426,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:20427: $lt_compile\"" >&5) + (eval echo "\"\$as_me:20429: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:20431: \$? = $ac_status" >&5 + echo "$as_me:20433: \$? = $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 @@ -20491,11 +20493,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:20494: $lt_compile\"" >&5) + (eval echo "\"\$as_me:20496: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:20498: \$? = $ac_status" >&5 + echo "$as_me:20500: \$? = $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 @@ -22503,7 +22505,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <]) SANE_CHECK_MISSING_HEADERS SANE_V4L_VERSION @@ -183,7 +183,7 @@ dnl Checks for library functions dnl *********************************************************************** AC_FUNC_ALLOCA AC_FUNC_MMAP -AC_CHECK_FUNCS(atexit inet_addr inet_aton inet_ntoa ioperm mkdir \ +AC_CHECK_FUNCS(atexit inet_addr inet_aton inet_ntoa ioperm i386_set_ioperm mkdir \ scsireq_enter strftime strstr strtod \ cfmakeraw tcsendbreak strcasecmp strncasecmp _portaccess \ getaddrinfo getnameinfo poll) diff --git a/include/sane/config.h.in b/include/sane/config.h.in index 0262532f3..0e66a1dc3 100644 --- a/include/sane/config.h.in +++ b/include/sane/config.h.in @@ -49,6 +49,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DEV_PPBUS_PPI_H +/* Define to 1 if you have the header file. */ +#undef HAVE_MACHINE_CPUFUNC_H + /* Is /dev/urandom available? */ #undef HAVE_DEV_URANDOM @@ -103,6 +106,9 @@ /* Define to 1 if you have the `ioperm' function. */ #undef HAVE_IOPERM +/* Define to 1 if you have the `i386_set_ioperm' function. */ +#undef HAVE_I386_SET_IOPERM + /* Define to 1 if you have the header file. */ #undef HAVE_IO_CAM_CAM_H