[sane-devel] Odd compile problem

Michael Carmack karmak@karmak.org
Thu, 21 Mar 2002 01:57:58 +0000


I ran into an odd problem compiling Sane. The build environment is:

Linux 2.4.17
gcc 2.95.3
glibc 2.1.3

The problem occurs when I try to specify a target directory 
(via --prefix=...) that is of the following form:

    /some/path/.i686-pc-linux-gnu/prefix/dir

It's the .i686-pc-linux-gnu directory that's causing problems. Apparently
the binaries get paths compiled into them that have .i686-pc-linux-gnu
replaced with .1-pc-1-gnu, i.e. the "i686" and "linux" strings are
being replaced with 1's. This is shown in the following strace of
scanimage:

personality(0 /* PER_??? */)            = 0
getpid()                                = 1084
brk(0)                                  = 0x8050fe0
brk(0x8051030)                          = 0x8051030
brk(0x8052000)                          = 0x8052000
open("./dll.conf", O_RDONLY)            = -1 ENOENT (No such file or directory)
open("/pkg/sane/1.0.7/.1-pc-1-gnu/etc/sane.d/dll.conf", O_RDONLY) = -1 ENOENT (No such file or directory)


At this point scanimage fails. 

Creating the symlink .1-pc-1-gnu -> .i686-pc-linux-gnu fixes the problem
and then scanimage will work fine, but that's not exactly the solution 
I'm looking for. Something's happing during compilation that's causing
my path to get twisted, and I'd like to fix the problem there.

Any ideas here? Note that I've compiled hundreds of programs using that
particular directory name in the prefix path (.i686-pc-linux-gnu), and
Sane is the first one that's had problems with it.

Thanks,
m.