[sane-devel] long option format not recognized (Was: Epson Perfection 610 Issue with 150 dpi scan)
Rainer Dorsch
rdorsch at web.de
Sun Jan 3 21:14:48 UTC 2010
Hi Chris,
Am Sonntag, 3. Januar 2010 schrieb Chris Bagwell:
> On Sun, Jan 3, 2010 at 7:01 AM, Rainer Dorsch <rdorsch at web.de> wrote:
> > For the long options issue:
> > I rebuild git sane on another machine (also Debian stable aka Debian 5.0)
> > and
> > the long options error is still there. Even --help has problems. Which
> > library is sane using to process the command line options? Does Debian
> > stable
> > maybe ship with a different version than your system?
>
> After running configure, can you look at the file include/sane/config.h?
> Check if HAVE_GETOPT_H and HAVE_GETOPT_LONG are defined. On debian, I
> would expect them to be defined. In that case, it uses standard libc
> version of getopt.
As you expected, it is there:
rd at blackbox:~/SW.nobackup/sane-backends$ grep HAVE_GETOPT
include/sane/config.h
#define HAVE_GETOPT_H 1
#define HAVE_GETOPT_LONG 1
rd at blackbox:~/SW.nobackup/sane-backends$
> I do see one suspicious line in lib/getopt.c and lib/getopt1.c. They do a
> #include <config.h> instead of #include "../include/sane/config.h" and so
> in certain cases it may be including the wrong config.h file. In that
> case, it would mistakenly compile a conflicting version of getopt_long()
> (which can explain the problem your seeing).
Hmm...that does solve the problem:
I did this modification
rd at blackbox:~/SW.nobackup/sane-backends$ git diff
diff --git a/lib/getopt.c b/lib/getopt.c
index 9dabb82..b8715e3 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -20,7 +20,7 @@
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-# include <config.h>
+# include "../include/sane/config.h"
#if !defined(HAVE_GETOPT_H) || !defined(HAVE_GETOPT_LONG)
^L
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
diff --git a/lib/getopt1.c b/lib/getopt1.c
index 5ace00a..082998c 100644
--- a/lib/getopt1.c
+++ b/lib/getopt1.c
@@ -17,7 +17,7 @@
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <config.h>
+#include "../include/sane/config.h"
#if !defined(HAVE_GETOPT_H) || !defined(HAVE_GETOPT_LONG)
^L
#ifdef HAVE_CONFIG_H
rd at blackbox:~/SW.nobackup/sane-backends$
recompiled, set the paths again
rd at blackbox:~/SW.nobackup/sane-backends$ export |grep PATH
declare -x LD_LIBRARY_PATH="/opt/sane-backends-091230/lib"
declare -x
PATH="/opt/sane-backends-091230/bin:/usr/local/bin:/usr/bin:/bin:/usr/games"
rd at blackbox:~/SW.nobackup/sane-backends$
and --help is still not recognized
rd at blackbox:~/SW.nobackup/sane-backends$ which scanimage
/opt/sane-backends-091230/bin/scanimage
rd at blackbox:~/SW.nobackup/sane-backends$
and --help is still not recogniced
rd at blackbox:~/SW.nobackup/sane-backends$ scanimage --help
Usage: scanimage [OPTION]...
Start image acquisition on a scanner device and write image data to
standard output.
Parameters are separated by a blank from single-character options (e.g.
-d epson) and by a "=" from multi-character options
(e.g. --device-name=epson).
-d, --device-name=DEVICE use a given scanner device (e.g. hp:/dev/scanner)
--format=pnm|tiff file format of output file
-i, --icc-profile=PROFILE include this ICC profile into TIFF file
-L, --list-devices show available scanner devices
-f, --formatted-device-list=FORMAT similar to -L, but the FORMAT of the output
can be specified: %d (device name), %v (vendor),
%m (model), %t (type), %i (index number), and
%n (newline)
-b, --batch[=FORMAT] working in batch mode, FORMAT is `out%d.pnm' or
`out%d.tif' by default depending on --format
--batch-start=# page number to start naming files with
--batch-count=# how many pages to scan in batch mode
--batch-increment=# increase page number in filename by #
--batch-double increment page number by two, same as
--batch-increment=2
--batch-prompt ask for pressing a key before scanning a page
--accept-md5-only only accept authorization requests using md5
-p, --progress print progress messages
-n, --dont-scan only set options, don't actually scan
-T, --test test backend thoroughly
-h, --help display this help message and exit
-v, --verbose give even more status messages
-B, --buffer-size=# change input buffer size (in kB, default 32)
-V, --version print version information
scanimage: unrecognized option `--help'
rd at blackbox:~/SW.nobackup/sane-backends$
Thanks,
Rainer
--
Rainer Dorsch
Lärchenstr. 6
D-72135 Dettenhausen
07157-734133
email: rdorsch at web.de
jabber: rdorsch at jabber.org
GPG Fingerprint: 5966 C54C 2B3C 42CC 1F4F 8F59 E3A8 C538 7519 141E
Full GPG key: http://pgp.mit.edu/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20100103/22dac8d0/attachment.pgp>
More information about the sane-devel
mailing list