libarchive 3.1.2 (reduced)

Extract upstream libarchive using the following shell code.

url=git://github.com/libarchive/libarchive.git &&
v=3.1.2 &&
r=19f23e19 &&
paths="
  CMakeLists.txt
  COPYING
  CTestConfig.cmake
  build/cmake
  build/pkgconfig
  build/utils
  build/version
  libarchive/*.*
" &&
mkdir libarchive-$v-g$r-reduced &&
git clone $url libarchive-git &&
date=$(cd libarchive-git && git log -n 1 --format='%cd' $r) &&
(cd libarchive-git && git archive --format=tar $r -- $paths) |
(cd libarchive-$v-g$r-reduced && tar xv) &&
echo "g$r date: $date"
Merge branch 'libarchive-upstream' into update-libarchive

Conflicts:
	Utilities/cmlibarchive/CMakeLists.txt
	Utilities/cmlibarchive/libarchive/archive.h
	Utilities/cmlibarchive/libarchive/archive_entry.h
	Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c
	Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c
	Utilities/cmlibarchive/libarchive/archive_windows.h
	Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c
libarchive: Update README-CMake.txt for new snapshot
libarchive: Include cm_zlib.h to get zlib used by CMake

Follow up change from commit ffa6faa4 (libarchive: Include cm_zlib.h to
get zlib used by CMake, 2011-12-20) for new includes of zlib.h in
updated libarchive.
libarchive: Silence API deprecation warnings

CMake uses old libarchive APIs for now.
libarchive: Avoid struct init with variable on Borland

The Borland C compiler does not like struct initialization with variables.
Use constant initialization followed by assignment on this compiler.
libarchive: Remove build options not used by CMake

Drop options POSIX_REGEX_LIB and ENABLE_SAFESEH that we do not want for
the CMake build of libarchive.
libarchive: Avoid requiring CMake 2.8.6 for CMakePushCheckState

Include the module from our own source tree directly.
CMake Nightly Date Stamp
Add cmake_reset_check_state() macro.

It's acknowledged that check state should not generally nest,
so it should be cleared when used, for example, in Find* module.

Also, add optional RESET argument to cmake_push_check_state().

General idea approved by neundorf@.
Unify the way the flags of a static library are read

Introduce cmLocalGenerator::GetStaticLibraryFlags() to have a central
function for getting the linker flags for a given target.
Add support for CMAKE_STATIC_LINKER_FLAGS

Add the content of this variable to the target specific linker flags
as we do with the other CMAKE_*_LINKER_FLAGS variables already.
Add CMAKE_STATIC_LINKER_FLAGS to CMakeCommonLanguageInclude

Add support for CMAKE_STATIC_LINKER_FLAGS_* to
CMakeCommonLanguageInclude.cmake to set the defaults similar
to the other CMAKE_*_LINKER_FLAGS_*.
Add documentation for the missing CMAKE_*_LINKER_FLAGS_* variables

Add CMAKE_MODULE_LINKER_FLAGS_*, CMAKE_SHARED_LINKER_FLAGS_* and
CMAKE_STATIC_LINKER_FLAGS_* to cmDocumentVariables.cxx with a
similar documentation as CMAKE_EXE_LINKER_FLAGS_*.
Add additonal tests for the linker flags

Extend Tests/LinkFlags to test libraries of the type MODULE and
the content of the CMAKE_*_LINKER_FLAGS_* variables.
CMake Nightly Date Stamp
Add option to use stdout/stderr of original terminal in cmake --build

Pass the original file handles to the native tool when using the
--use-stderr option in the build command. This enables the
usage of advanced terminal features like colored output.
Merge topic 'passthru' into next

2b473d2 Add option to use stdout/stderr of original terminal in cmake --build
fc1708a CMake Nightly Date Stamp
8d3b653 CMake Nightly Date Stamp
Merge topic 'static_library_flags' into next

3b581e0 Add additonal tests for the linker flags
bd58811 Add documentation for the missing CMAKE_*_LINKER_FLAGS_* variables
dcc753d Add CMAKE_STATIC_LINKER_FLAGS to CMakeCommonLanguageInclude
23957a8 Add support for CMAKE_STATIC_LINKER_FLAGS
f1081f5 Unify the way the flags of a static library are read
Fix documentation bugs, noted by and input from neundorf@.