[sane-devel] compile sane snapshot under Freebsd 7.1

Chris Bagwell chris at cnpbagwell.com
Mon May 4 20:04:08 UTC 2009


On Mon, May 4, 2009 at 2:22 PM, Louis Lagendijk
<louis at lagendijk.xs4all.nl>wrote:

> On Sat, 2009-05-02 at 15:59 -0500, Chris Bagwell wrote:
>
> > > > canon_dr.c picks the wrong saneopts.h (from /usr/local/sane).
> possibly
> > > > other sources do the same, but I for now simply removed the old sane
> > > > includes
> > > >
> > >
> > > most backends seem to include the system sane files instead of the src
> > > ones. perhaps we should change that at some point?
> > >
> > I didn't worry about this because I assumed our -I options should
> > always force it to look for internal versions first.
> >
> > AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_builddir)/include -I
> > $(top_srcdir)/include -DLIBDIR="$(libdir)/sane"
> >
> > Somehow your still getting -I/usr/local/include with higher priority.
> > How was that specified?  "./configure CPPFLAGS=-I/usr/local/include"?
> >
> > Can you look at what command line options are being used to compile?
> > You will need to edit backend/Makefile and remove the "--silent" from
> > $LIBTOOL.
>
> > Generating umax1220u.conf from umax1220u.conf.in
> Generating umax.conf from umax.conf.in
> Generating umax_pp.conf from umax_pp.conf.in
> Generating v4l.conf from v4l.conf.in
> Generating xerox_mfp.conf from xerox_mfp.conf.in
> Generating dll.conf from dll.conf.in
> Generating saned.conf from saned.conf.in
> gmake  all-am
> gmake[1]: Entering directory
> `/usr/ports/graphics/sane-backends/sane-backends/backend'
> rm -f dll-s.c
> ln -s ./stubs.c dll-s.c
> /bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.
> -I../include/sane -I/usr/local/include -I. -I. -I../include -I../include
> -DLIBDIR="/usr/local/lib/sane" -DBACKEND_NAME=dll -D_REENTRANT
> -DPATH_SANE_CONFIG_DIR=/usr/local/etc/sane.d
> -DPATH_SANE_DATA_DIR=/usr/local/share
> -DPATH_SANE_LOCK_DIR=/usr/local/var/lock/sane     -DV_MAJOR=1 -DV_MINOR=1
> -g -O2 -W -Wall -Wcast-align -Wcast-qual -Wmissing-declarations
> -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prototypes
> -pedantic -ansi -MT libsane_la-dll-s.lo -MD -MP
> -MF .deps/libsane_la-dll-s.Tpo -c -o libsane_la-dll-s.lo `test -f
> 'dll-s.c' || echo './'`dll-s.c
> mkdir .libs
>


The above confirms we are setting up -I options correctly.

I believe I see the issue now... We have 3 versions of including saneopts.h
in various files.

#include <sane/getopts.h>
#include "sane/getopts.h"
#include "../include/sane/getopts.h"

I had trouble finding an official definition of difference between <> and""
but I finally found in GNU's cpp manual that <> means look in -I places and
then standard system header places as a fall back.

It then says that "" looks in current directory but falls back to standard
system header places.  It makes no mention of referencing -I values.  So
that seems the issue.

We need to get rid of all #include "sane/getopts.h" and also better to align
with just 1 way to do it such as also getting rid of all #include
<sane/getopts.h> as well.

I can align this soon if someone else doesn't want to take that up
themselves.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20090504/39b78925/attachment-0001.htm>


More information about the sane-devel mailing list