diff -ur -x Makefile.in -x configure -x aclocal.m4 -x config.h.in -x testsuite cpio-2.10/configure.ac cpio-2.10.new/configure.ac
--- cpio-2.10/configure.ac	2009-06-20 10:28:11.000000000 +0200
+++ cpio-2.10.new/configure.ac	2009-07-24 19:53:21.000000000 +0200
@@ -46,7 +46,7 @@
 
 AC_CHECK_FUNCS([fchmod fchown])
 # This is needed for mingw build
-AC_CHECK_FUNCS([setmode getpwuid getpwnam getgrgid getgrnam pipe fork getuid geteuid])
+AC_CHECK_FUNCS([setmode getpwuid getpwnam getgrgid getgrnam pipe fork getuid geteuid waitpid])
 
 # gnulib modules
 gl_INIT
diff -ur -x Makefile.in -x configure -x aclocal.m4 -x config.h.in -x testsuite cpio-2.10/gnu/unistd.in.h cpio-2.10.new/gnu/unistd.in.h
--- cpio-2.10/gnu/unistd.in.h	2009-06-19 11:11:58.000000000 +0200
+++ cpio-2.10.new/gnu/unistd.in.h	2009-07-24 19:44:27.000000000 +0200
@@ -107,6 +107,7 @@
 #endif
 
 
+#ifdef HAVE_CHOWN
 #if @GNULIB_CHOWN@
 # if @REPLACE_CHOWN@
 #  ifndef REPLACE_CHOWN
@@ -130,6 +131,7 @@
                       "use gnulib module chown for portability"), \
      chown (f, u, g))
 #endif
+#endif
 
 
 #if @GNULIB_CLOSE@
@@ -465,6 +467,7 @@
 #endif
 
 
+#ifdef HAVE_LCHOWN
 #if @GNULIB_LCHOWN@
 # if @REPLACE_LCHOWN@
 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
@@ -482,6 +485,7 @@
                       "systems - use gnulib module lchown for portability"), \
      lchown (f, u, g))
 #endif
+#endif
 
 
 #if @GNULIB_LINK@
diff -ur -x Makefile.in -x configure -x aclocal.m4 -x config.h.in -x testsuite cpio-2.10/tests/genfile.c cpio-2.10.new/tests/genfile.c
--- cpio-2.10/tests/genfile.c	2009-06-18 11:24:14.000000000 +0200
+++ cpio-2.10.new/tests/genfile.c	2009-07-24 19:58:43.000000000 +0200
@@ -601,9 +601,9 @@
       else if (strcmp (p, "size") == 0)
 	printf ("%s", umaxtostr (st.st_size, buf));
       else if (strcmp (p, "blksize") == 0)
-	printf ("%s", umaxtostr (st.st_blksize, buf));
+	printf ("%s", umaxtostr (ST_BLKSIZE (st), buf));
       else if (strcmp (p, "blocks") == 0)
-	printf ("%s", umaxtostr (st.st_blocks, buf));
+	printf ("%s", umaxtostr (ST_NBLOCKS (st), buf));
       else if (strcmp (p, "atime") == 0)
 	printf ("%lu", (unsigned long) st.st_atime);
       else if (strcmp (p, "atimeH") == 0)
@@ -794,6 +794,7 @@
       fprintf (stderr, "%s", buf);
     }
 
+#ifdef HAVE_WAITPID
   /* Collect exit status */
   waitpid (pid, &status, 0);
 
@@ -821,6 +822,8 @@
 
   if (WIFEXITED (status))
     exit (WEXITSTATUS (status));
+#endif
+
   exit (EXIT_FAILURE);
 }
 
diff -ur -x Makefile.in -x configure -x aclocal.m4 -x config.h.in -x testsuite cpio-2.10/tests/inout.at cpio-2.10.new/tests/inout.at
--- cpio-2.10/tests/inout.at	2009-02-14 19:15:50.000000000 +0100
+++ cpio-2.10.new/tests/inout.at	2009-07-24 20:26:37.000000000 +0200
@@ -32,9 +32,9 @@
 AT_CHECK([
 while read NAME LENGTH
 do
-	genfile --length $LENGTH > $NAME
+	genfile.exe --length $LENGTH > $NAME
 	echo $NAME
 done < filelist |
- cpio --quiet -o > archive])
+ cpio.exe --quiet -o > archive])
 
 AT_CLEANUP
diff -ur -x Makefile.in -x configure -x aclocal.m4 -x config.h.in -x testsuite cpio-2.10/tests/Makefile.am cpio-2.10.new/tests/Makefile.am
--- cpio-2.10/tests/Makefile.am	2009-06-19 11:24:04.000000000 +0200
+++ cpio-2.10.new/tests/Makefile.am	2009-07-24 20:45:23.000000000 +0200
@@ -83,3 +83,5 @@
 
 LDADD=../gnu/libgnu.a @LIB_CLOCK_GETTIME@ @INTLLIBS@
 
+# for sysdep.c
+LDADD+=../lib/libpax.a
