Fix --to-stdout option support

* src/copyin.c (copyin_link): Skip an appropriate number of bytes
when to_stdout_option flag is set.
* tests/symlink-to-stdout.at: New test case.
* tests/Makefile.am (TESTSUITE_AT): Add symlink-to-stdout.at.
* tests/testsuite.at: Include symlink-to-stdout.at.
Provide a tar-like --directory (-D) option.

* src/copyin.c (process_copy_in): Call change_dir.
* src/copyout.c (process_copy_out): Likewise.
* src/copypass.c (process_copy_pass): Likewise.
* src/extern.h (change_directory_option): New extern.
(change_dir): New proto.
* src/global.c (change_directory_option): New global.
* src/main.c (options): New option --directory.
(parse_opt): Handle the --directory option.
* src/util.c (change_dir): New proto.

* doc/cpio.texi: Document the --directory option.
Minor changes

* .gitignore: Update.
* am/.gitignore: New file.
* src/.gitignore: Add .gdbinit.
* tests/symlink-to-stdout.at: Fix keywords.
Minor fixes.

* src/copyout.c (count_defered_links_to_dev_ino): Return size_t.
(last_link): Do not use superfluous local variable.
* src/util.c (copy_files_disk_to_tape)
(copy_files_disk_to_disk): Shut down gcc warnings.
Minor fix.

* src/filetypes.h: Remove declarations of stat and lstat.
Fix bootstrapping.

* bootstrap (symlink_to_dir): Fix symlink calculation.
Improve handling of -D in copy-pass mode.

* gnulib.modules: Add xgetcwd.
* src/copypass.c (process_copy_pass): Convert directory_name
to absolute if -D option was given.
Housekeeping.

* .gitignore: Sort.
* src/cpiohdr.h: Fix indentation of preprocessor statements.
* src/filetypes.h: Likewise.
Fix setstat testcases to work on Darwin.

* tests/setstat01.at: Set write permission on the directory
before attempting to rename it.
* tests/setstat02.at: Likewise.
Bugfixes.

* gnulib.modules: Add getline, required by rmt.
* src/mt.c (fatal_exit): Change exit code to
MT_EXIT_FAILURE.
Minor fixes.

* configure.ac: Use gettext 0.18
* doc/.gitignore: Add parse-datetime.texi.
* lib/Makefile.am (libpax_a_SOURCES): Add exit-status.c
* src/copyin.c (read_pattern_file): Use open_fatal if opening
pattern file failed.
* src/util.c (set_file_times): Use fdutimens.
Fix error handling in disk_empty_output_buffer and sparse_write

* src/extern.h (delayed_seek_count): Remove.
(disk_empty_output_buffer): Change signature.
* src/util.c (disk_empty_output_buffer): Take two arguments.
Correctly handle partial writes (errno is not meaningful).
(delayed_seek_count): Remove variable.
(sparse_write): Change return type and signature.  Rewrite.
Return number actual number of bytes written or -1 on error.
Check returns from lseek and write.
* src/copyin.c (copyin_regular_file): Call disk_empty_output_buffer
with flush=true before closing the file.
* src/copypass.c (process_copy_pass): Likewise.
Always use 32 bit CRC

* src/cpiohdr.h (cpio_file_stat) <c_chksum>: Change type to
uint32_t.
* src/extern.h (crc): Change type to uint32_t.
* src/global.c: Likewise.
* src/copyout.c (read_for_checksum): Return uint32_t.
* src/copyin.c: Fix printf formats.
Clean build