FYI, I noticed that mkdir-p.c includes dirchownmod.c, rather than dirchownmod.h. I think that must have been unintentional, since it leads to warnings from ranlib on some systems. Once changed, I found that it also needs <unistd.h>, for its close prototype.
Here's the patch: 2006-09-28 Jim Meyering <[EMAIL PROTECTED]> * mkdir-p.c: Include "dirchownmod.h", not "dirchownmod.c". Include <unistd.h>. Index: mkdir-p.c =================================================================== RCS file: /sources/gnulib/gnulib/lib/mkdir-p.c,v retrieving revision 1.8 diff -u -r1.8 mkdir-p.c --- mkdir-p.c 16 Sep 2006 19:58:25 -0000 1.8 +++ mkdir-p.c 28 Sep 2006 12:18:54 -0000 @@ -25,11 +25,12 @@ #include <errno.h> #include <sys/stat.h> +#include <unistd.h> #include "gettext.h" #define _(msgid) gettext (msgid) -#include "dirchownmod.c" +#include "dirchownmod.h" #include "dirname.h" #include "error.h" #include "quote.h"