Replace cp -a with cp -RpP.
Fix build on NetBSD/i386 5.2 with java option.
Noticed by John D. Baker.