Subject: Re: Cross compiling current fails
To: None <current-users@netbsd.org>
From: R. Huvendiek <netbsd@kaervek.net>
List: current-users
Date: 09/09/2005 15:33:34
> 
> From my observations the preprocessor will pull in files from the host
> machine in /usr/include (/usr/include/dirent.h in this case), which of
> course does not intermix very well with the netbsd sources :(

After fiddling around a litte bit more, I found out that dirent.h is pulled
in from tools/compat/compat_defs.h. I modified that file, and it works.
Below is the version I came up with. I compiled a whole release and got
no problems.
Maybe other architectures need the #include <dirent.h>, but on linux it
seems to be superfluous.

Ralf


RCS file: /cvsroot/src/tools/compat/compat_defs.h,v
retrieving revision 1.47
diff -u -u -r1.47 compat_defs.h
--- compat_defs.h       27 Aug 2005 22:08:58 -0000      1.47
+++ compat_defs.h       9 Sep 2005 13:24:10 -0000
@@ -115,7 +115,9 @@
 /* Dirent support. */
 
 #if HAVE_DIRENT_H
-# include <dirent.h>
+# if ! defined(__linux__)
+#  include <dirent.h>
+# endif
 # define NAMLEN(dirent) (strlen((dirent)->d_name))
 #else
 # define dirent direct