Findutils-4.1

Gerard Beekmans gerard at linuxfromscratch.org
Fri Oct 5 06:36:06 PDT 2001


On Fri, Oct 05, 2001 at 12:40:11PM +0200, Nils Magnus Eide Englund wrote:
> I re-ran the configure script after I had added som environment
> variables (got a tip from someone on IRC), and it seemed to fix
> the error I first got. However, I still can't compile correctly.
> 
> I have added various output (export, configure and make) on
> http://nmee.net/lfs/, thought it would be more practical to put
> it there than here, since it's quite a number of lines.

I've found the problem.

The export-as-lfs-root file shows these lines:

declare -x CFLAGS="-I/usr/include/linux"
declare -x CPPFLAGS="-I/usr/include/linux"
declare -x CXXFLAGS="-I/usr/include/linux"

Setting CFLAGS, CXXFLAGS and CPPFLAGS may not always work properly and in
this case they are causing all the errors you are getting. The reason:

Your configure output shows:

checking for dirent.h that defines DIR... no
checking for sys/ndir.h that defines DIR... no
checking for sys/dir.h that defines DIR... no
checking for ndir.h that defines DIR... no

The problem is you have included CFLAGS=-I/usr/include/linux - there is a
dirent.h in /usr/include/linux but it's the wrong dirent.h file. What
findutils needs, is the /usr/include/dirent.h file. But -I options take
precedence of the default patch that gcc has hard-wired into it (like
/usr/include), so a dirent.h file is found, but in a different location.
GCC won't look for other dirent.h files

I've confirmed this by setting CFLAGS myself and compile findutils. My
errors are identical to yours. Unsetting CFLAGS, and start the findutils
compile from scratch fixed it.

So, remove source directory, unpack it again, apply the patch, make sure
CFLAGS, CXXFLAGS and CPPFLAGS are all unset, unless you absolutely need
them. If a package needs kernel headers they are always mentioned like
this:

#include <linux/somefile.h>

/usr/include is one of the default header include paths, 'linux' is a
subdirectory of a default header include path, so kernel headers will be
found automatically.

Good luck,

-- 
Gerard Beekmans
www.linuxfromscratch.org

-*- If Linux doesn't have the solution, you have the wrong problem -*-
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message



More information about the lfs-support mailing list