Commit 1a8c7bc2 authored by LibArchive Upstream's avatar LibArchive Upstream Committed by Brad King
Browse files

libarchive 3.1.2-601-g3bfe5f1 (reduced)

Extract upstream libarchive using the following shell code.

url=git://github.com/libarchive/libarchive.git &&
v=3.1.2-601-g3bfe5f1 &&
r=3bfe5f1 &&
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) &&
fromdos libarchive-$v-g$r-reduced/build/cmake/Find*.cmake &&
echo "g$r date: $date"
parent 37f225b7
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6 FATAL_ERROR)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR)
#
PROJECT(libarchive C)
#
......@@ -35,6 +35,9 @@ ENDIF(NOT "${CMAKE_BUILD_TYPE}"
# On MacOS, prefer MacPorts libraries to system libraries.
# I haven't come up with a compelling argument for this to be conditional.
list(APPEND CMAKE_PREFIX_PATH /opt/local)
# Enable @rpath in the install name.
# detail in "cmake --help-policy CMP0042"
SET(CMAKE_MACOSX_RPATH ON)
#
# Version - read from 'version' file.
......@@ -85,7 +88,7 @@ SET(CMAKE_REQUIRED_FLAGS)
# Especially for early development, we want to be a little
# aggressive about diagnosing build problems; this can get
# relaxed somewhat in final shipping versions.
IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$")
IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$")
SET(CMAKE_REQUIRED_FLAGS "-Wall -Wformat -Wformat-security")
#################################################################
# Set compile flags for all build types.
......@@ -93,12 +96,14 @@ IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$")
#################################################################
# Set compile flags for debug build.
# This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug"
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror -Wextra -Wunused")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wextra")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wunused")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wshadow")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wmissing-prototypes")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wcast-qual")
ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$")
IF ("CMAKE_C_COMPILER_ID" MATCHES "^Clang$")
ENDIF (CMAKE_C_COMPILER_ID MATCHES "^GNU$")
IF (CMAKE_C_COMPILER_ID MATCHES "^Clang$")
SET(CMAKE_REQUIRED_FLAGS "-Wall -Wformat -Wformat-security")
#################################################################
# Set compile flags for all build types.
......@@ -107,11 +112,13 @@ IF ("CMAKE_C_COMPILER_ID" MATCHES "^Clang$")
# Set compile flags for debug build.
# This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug"
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror -Wextra -Wunused")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wextra")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wunused")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wshadow")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wmissing-prototypes")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wcast-qual")
ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^Clang$")
ENDIF (CMAKE_C_COMPILER_ID MATCHES "^Clang$")
IF (MSVC)
#################################################################
# Set compile flags for debug build.
......@@ -161,9 +168,12 @@ OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON)
OPTION(ENABLE_LZMA "Enable the use of the system found LZMA library if found" ON)
OPTION(ENABLE_ZLIB "Enable the use of the system found ZLIB library if found" ON)
OPTION(ENABLE_BZip2 "Enable the use of the system found BZip2 library if found" ON)
OPTION(ENABLE_LIBXML2 "Enable the use of the system found libxml2 library if found" ON)
OPTION(ENABLE_EXPAT "Enable the use of the system found EXPAT library if found" ON)
OPTION(ENABLE_PCREPOSIX "Enable the use of the system found PCREPOSIX library if found" ON)
OPTION(ENABLE_LibGCC "Enable the use of the system found LibGCC library if found" ON)
# CNG is used for encrypt/decrypt Zip archives on Windows.
OPTION(ENABLE_CNG "Enable the use of CNG(Crypto Next Generation)" ON)
OPTION(ENABLE_TAR "Enable tar building" ON)
OPTION(ENABLE_TAR_SHARED "Enable dynamic build of tar" FALSE)
......@@ -176,6 +186,7 @@ OPTION(ENABLE_ACL "Enable ACL support" ON)
OPTION(ENABLE_ICONV "Enable iconv support" ON)
OPTION(ENABLE_TEST "Enable unit and regression tests" ON)
OPTION(ENABLE_COVERAGE "Enable code coverage (GCC only, automatically sets ENABLE_TEST to ON)" FALSE)
OPTION(ENABLE_INSTALL "Enable installing of libraries" ON)
SET(POSIX_REGEX_LIB "AUTO" CACHE STRING "Choose what library should provide POSIX regular expression support")
SET(ENABLE_SAFESEH "AUTO" CACHE STRING "Enable use of /SAFESEH linker flag (MSVC only)")
......@@ -466,6 +477,33 @@ IF(LZO2_FOUND)
ENDIF(LZO2_FOUND)
MARK_AS_ADVANCED(CLEAR LZO2_INCLUDE_DIR)
MARK_AS_ADVANCED(CLEAR LZO2_LIBRARY)
#
# Find LZ4
#
IF (LZ4_INCLUDE_DIR)
# Already in cache, be silent
SET(LZ4_FIND_QUIETLY TRUE)
ENDIF (LZ4_INCLUDE_DIR)
FIND_PATH(LZ4_INCLUDE_DIR lz4.h)
FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR)
IF(LZ4_FOUND)
SET(HAVE_LIBLZ4 1)
SET(HAVE_LZ4_H 1)
CMAKE_PUSH_CHECK_STATE() # Save the state of the variables
SET(CMAKE_REQUIRED_INCLUDES ${LZ4_INCLUDE_DIR})
CHECK_INCLUDE_FILES("lz4hc.h" HAVE_LZ4HC_H)
CMAKE_POP_CHECK_STATE() # Restore the state of the variables
INCLUDE_DIRECTORIES(${LZ4_INCLUDE_DIR})
LIST(APPEND ADDITIONAL_LIBS ${LZ4_LIBRARY})
#
# TODO: test for static library.
#
ENDIF(LZ4_FOUND)
MARK_AS_ADVANCED(CLEAR LZ4_INCLUDE_DIR)
MARK_AS_ADVANCED(CLEAR LZ4_LIBRARY)
#
# Check headers
......@@ -511,7 +549,9 @@ LA_CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
LA_CHECK_INCLUDE_FILE("paths.h" HAVE_PATHS_H)
LA_CHECK_INCLUDE_FILE("poll.h" HAVE_POLL_H)
LA_CHECK_INCLUDE_FILE("process.h" HAVE_PROCESS_H)
LA_CHECK_INCLUDE_FILE("pthread.h" HAVE_PTHREAD_H)
LA_CHECK_INCLUDE_FILE("pwd.h" HAVE_PWD_H)
LA_CHECK_INCLUDE_FILE("readpassphrase.h" HAVE_READPASSPHRASE_H)
LA_CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H)
LA_CHECK_INCLUDE_FILE("signal.h" HAVE_SIGNAL_H)
LA_CHECK_INCLUDE_FILE("spawn.h" HAVE_SPAWN_H)
......@@ -542,6 +582,11 @@ LA_CHECK_INCLUDE_FILE("utime.h" HAVE_UTIME_H)
LA_CHECK_INCLUDE_FILE("wchar.h" HAVE_WCHAR_H)
LA_CHECK_INCLUDE_FILE("wctype.h" HAVE_WCTYPE_H)
LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H)
IF(ENABLE_CNG)
LA_CHECK_INCLUDE_FILE("Bcrypt.h" HAVE_BCRYPT_H)
ELSE(ENABLE_CNG)
UNSET(HAVE_BCRYPT_H CACHE)
ENDIF(ENABLE_CNG)
# Following files need windwos.h, so we should test it after windows.h test.
LA_CHECK_INCLUDE_FILE("wincrypt.h" HAVE_WINCRYPT_H)
LA_CHECK_INCLUDE_FILE("winioctl.h" HAVE_WINIOCTL_H)
......@@ -573,6 +618,7 @@ IF(ENABLE_NETTLE)
SET(HAVE_NETTLE_SHA_H 1)
INCLUDE_DIRECTORIES(${NETTLE_INCLUDE_DIR})
LIST(APPEND ADDITIONAL_LIBS ${NETTLE_LIBRARIES})
LA_CHECK_INCLUDE_FILE("nettle/pbkdf2.h" HAVE_NETTLE_PBKDF2_H)
ENDIF(NETTLE_FOUND)
MARK_AS_ADVANCED(CLEAR NETTLE_INCLUDE_DIR)
MARK_AS_ADVANCED(CLEAR NETTLE_LIBRARIES)
......@@ -584,6 +630,9 @@ ENDIF(ENABLE_NETTLE)
#
IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
FIND_PACKAGE(OpenSSL)
IF(OPENSSL_FOUND)
SET(HAVE_LIBCRYPTO 1)
ENDIF(OPENSSL_FOUND)
ELSE()
SET(OPENSSL_FOUND FALSE) # Override cached value
ENDIF()
......@@ -602,7 +651,7 @@ ENDIF(NOT OPENSSL_FOUND)
#
# How to prove that CRYPTO functions, which have several names on various
# platforms, just see if archive_crypto.c can compile and link against
# platforms, just see if archive_digest.c can compile and link against
# required libraries.
#
MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION)
......@@ -641,7 +690,7 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION)
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h)
FILE(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h"
CONFDEFS_H)
FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/libarchive/archive_crypto.c"
FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/libarchive/archive_digest.c"
ARCHIVE_CRYPTO_C)
SET(SOURCE "${CONFDEFS_H}
......@@ -791,14 +840,16 @@ ENDMACRO(CHECK_CRYPTO_WIN CRYPTO_LIST)
MACRO(CHECK_ICONV LIB TRY_ICONV_CONST)
IF(NOT HAVE_ICONV)
CMAKE_PUSH_CHECK_STATE() # Save the state of the variables
IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$")
IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
CMAKE_C_COMPILER_ID MATCHES "^Clang$")
#
# During checking iconv proto type, we should use -Werror to avoid the
# success of iconv detection with a warnig which success is a miss
# detection. So this needs for all build mode(even it's a release mode).
#
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror")
ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$")
ENDIF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
CMAKE_C_COMPILER_ID MATCHES "^Clang$")
IF (MSVC)
# NOTE: /WX option is the same as gcc's -Werror option.
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} /WX")
......@@ -919,8 +970,12 @@ ENDIF(ENABLE_ICONV)
#
# Find Libxml2
FIND_PACKAGE(LibXml2)
#
IF(ENABLE_LIBXML2)
FIND_PACKAGE(LibXml2)
ELSE()
SET(LIBXML2_FOUND FALSE)
ENDIF()
IF(LIBXML2_FOUND)
CMAKE_PUSH_CHECK_STATE() # Save the state of the variables
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
......@@ -945,7 +1000,11 @@ ELSE(LIBXML2_FOUND)
#
# Find Expat
#
FIND_PACKAGE(EXPAT)
IF(ENABLE_EXPAT)
FIND_PACKAGE(EXPAT)
ELSE()
SET(EXPAT_FOUND FALSE)
ENDIF()
IF(EXPAT_FOUND)
CMAKE_PUSH_CHECK_STATE() # Save the state of the variables
INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIR})
......@@ -1076,15 +1135,18 @@ ENDIF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_REGEX_LIB MATCHES "^(AUTO|LIBPCREPOSIX
# Check functions
#
CMAKE_PUSH_CHECK_STATE() # Save the state of the variables
IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$")
IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
CMAKE_C_COMPILER_ID MATCHES "^Clang$")
#
# During checking functions, we should use -fno-builtin to avoid the
# failure of function detection which failure is an error "conflicting
# types for built-in function" caused by using -Werror option.
#
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-builtin")
ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$")
ENDIF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
CMAKE_C_COMPILER_ID MATCHES "^Clang$")
CHECK_SYMBOL_EXISTS(_CrtSetReportMode "crtdbg.h" HAVE__CrtSetReportMode)
CHECK_FUNCTION_EXISTS_GLIBC(arc4random_buf HAVE_ARC4RANDOM_BUF)
CHECK_FUNCTION_EXISTS_GLIBC(chflags HAVE_CHFLAGS)
CHECK_FUNCTION_EXISTS_GLIBC(chown HAVE_CHOWN)
CHECK_FUNCTION_EXISTS_GLIBC(chroot HAVE_CHROOT)
......@@ -1132,6 +1194,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(pipe HAVE_PIPE)
CHECK_FUNCTION_EXISTS_GLIBC(poll HAVE_POLL)
CHECK_FUNCTION_EXISTS_GLIBC(posix_spawnp HAVE_POSIX_SPAWNP)
CHECK_FUNCTION_EXISTS_GLIBC(readlink HAVE_READLINK)
CHECK_FUNCTION_EXISTS_GLIBC(readpassphrase HAVE_READPASSPHRASE)
CHECK_FUNCTION_EXISTS_GLIBC(select HAVE_SELECT)
CHECK_FUNCTION_EXISTS_GLIBC(setenv HAVE_SETENV)
CHECK_FUNCTION_EXISTS_GLIBC(setlocale HAVE_SETLOCALE)
......@@ -1170,6 +1233,7 @@ CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME)
CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF)
CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP)
CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY)
CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE)
CMAKE_POP_CHECK_STATE() # Restore the state of the variables
......@@ -1538,12 +1602,6 @@ ADD_DEFINITIONS(-DHAVE_CONFIG_H)
# Handle generation of the libarchive.pc file for pkg-config
INCLUDE(CreatePkgConfigFile)
#
# Expose ADDITIONAL_LIBS for projects using libarchive as a subdirectory
# and linking against archive_static.
#
set(LIBARCHIVE_ADDITIONAL_LIBS ${ADDITIONAL_LIBS} CACHE INTERNAL "libarchive dependencies")
#
# Register installation of PDF documents.
#
......
......@@ -17,12 +17,11 @@ the actual statements in the files are controlling.
files for details:
libarchive/archive_entry.c
libarchive/archive_read_support_filter_compress.c
libarchive/archive_write_set_filter_compress.c
libarchive/archive_write_add_filter_compress.c
libarchive/mtree.5
tar/matching.c
* The following source files are in the public domain:
tar/getdate.c
libarchive/archive_getdate.c
* The build files---including Makefiles, configure scripts,
and auxiliary scripts used as part of the compile process---have
......
......@@ -27,5 +27,7 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/pkgconfig/libarchive.pc.in
${CMAKE_CURRENT_SOURCE_DIR}/build/pkgconfig/libarchive.pc
@ONLY)
# And install it, of course ;).
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/build/pkgconfig/libarchive.pc
DESTINATION "lib/pkgconfig")
IF(ENABLE_INSTALL)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/build/pkgconfig/libarchive.pc
DESTINATION "lib/pkgconfig")
ENDIF()
......@@ -63,7 +63,7 @@ typedef long long int64_t;
* Similarly for int32_t
*/
#if !defined(HAVE_INT32_T) && SIZE_OF_INT == 4
typedef long int32_t;
typedef int int32_t;
#define HAVE_INT32_T
#endif
......@@ -328,9 +328,15 @@ typedef uint64_t uintmax_t;
/* True for systems with POSIX ACL support */
#cmakedefine HAVE_ACL_USER 1
/* Define to 1 if you have the `arc4random_buf' function. */
#cmakedefine HAVE_ARC4RANDOM_BUF 1
/* Define to 1 if you have the <attr/xattr.h> header file. */
#cmakedefine HAVE_ATTR_XATTR_H 1
/* Define to 1 if you have the <Bcrypt.h> header file. */
#cmakedefine HAVE_BCRYPT_H 1
/* Define to 1 if you have the <bsdxml.h> header file. */
#cmakedefine HAVE_BSDXML_H 1
......@@ -579,12 +585,21 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `bz2' library (-lbz2). */
#cmakedefine HAVE_LIBBZ2 1
/* Define to 1 if you have the `charset' library (-lcharset). */
#cmakedefine HAVE_LIBCHARSET 1
/* Define to 1 if you have the `crypto' library (-lcrypto). */
#cmakedefine HAVE_LIBCRYPTO 1
/* Define to 1 if you have the `expat' library (-lexpat). */
#cmakedefine HAVE_LIBEXPAT 1
/* Define to 1 if you have the `gcc' library (-lgcc). */
#cmakedefine HAVE_LIBGCC 1
/* Define to 1 if you have the `lz4' library (-llz4). */
#cmakedefine HAVE_LIBLZ4 1
/* Define to 1 if you have the `lzma' library (-llzma). */
#cmakedefine HAVE_LIBLZMA 1
......@@ -676,6 +691,12 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `lutimes' function. */
#cmakedefine HAVE_LUTIMES 1
/* Define to 1 if you have the <lz4hc.h> header file. */
#cmakedefine HAVE_LZ4HC_H 1
/* Define to 1 if you have the <lz4.h> header file. */
#cmakedefine HAVE_LZ4_H 1
/* Define to 1 if you have the <lzmadec.h> header file. */
#cmakedefine HAVE_LZMADEC_H 1
......@@ -715,6 +736,9 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the <nettle/md5.h> header file. */
#cmakedefine HAVE_NETTLE_MD5_H 1
/* Define to 1 if you have the <nettle/pbkdf2.h> header file. */
#cmakedefine HAVE_NETTLE_PBKDF2_H 1
/* Define to 1 if you have the <nettle/ripemd160.h> header file. */
#cmakedefine HAVE_NETTLE_RIPEMD160_H 1
......@@ -736,6 +760,9 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `pipe' function. */
#cmakedefine HAVE_PIPE 1
/* Define to 1 if you have the `PKCS5_PBKDF2_HMAC_SHA1' function. */
#cmakedefine HAVE_PKCS5_PBKDF2_HMAC_SHA1 1
/* Define to 1 if you have the `poll' function. */
#cmakedefine HAVE_POLL 1
......@@ -748,6 +775,9 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the <process.h> header file. */
#cmakedefine HAVE_PROCESS_H 1
/* Define to 1 if you have the <pthread.h> header file. */
#cmakedefine HAVE_PTHREAD_H 1
/* Define to 1 if you have the <pwd.h> header file. */
#cmakedefine HAVE_PWD_H 1
......@@ -760,6 +790,12 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `readlinkat' function. */
#cmakedefine HAVE_READLINKAT 1
/* Define to 1 if you have the `readpassphrase' function. */
#cmakedefine HAVE_READPASSPHRASE 1
/* Define to 1 if you have the <readpassphrase.h> header file. */
#cmakedefine HAVE_READPASSPHRASE_H 1
/* Define to 1 if you have the <regex.h> header file. */
#cmakedefine HAVE_REGEX_H 1
......@@ -1015,6 +1051,9 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `wmemcpy' function. */
#cmakedefine HAVE_WMEMCPY 1
/* Define to 1 if you have the `wmemmove' function. */
#cmakedefine HAVE_WMEMMOVE 1
/* Define to 1 if you have a working EXT2_IOC_GETFLAGS */
#cmakedefine HAVE_WORKING_EXT2_IOC_GETFLAGS 1
......
......@@ -18,8 +18,10 @@ SET(libarchive_SOURCES
archive_cmdline.c
archive_cmdline_private.h
archive_crc32.h
archive_crypto.c
archive_crypto_private.h
archive_cryptor.c
archive_cryptor_private.h
archive_digest.c
archive_digest_private.h
archive_endian.h
archive_entry.c
archive_entry.h
......@@ -32,6 +34,8 @@ SET(libarchive_SOURCES
archive_entry_strmode.c
archive_entry_xattr.c
archive_getdate.c
archive_hmac.c
archive_hmac_private.h
archive_match.c
archive_options.c
archive_options_private.h
......@@ -44,9 +48,12 @@ SET(libarchive_SOURCES
archive_ppmd7.c
archive_ppmd7_private.h
archive_private.h
archive_random.c
archive_random_private.h
archive_rb.c
archive_rb.h
archive_read.c
archive_read_add_passphrase.c
archive_read_append_filter.c
archive_read_data_into_fd.c
archive_read_disk_entry_from_file.c
......@@ -68,6 +75,7 @@ SET(libarchive_SOURCES
archive_read_support_filter_gzip.c
archive_read_support_filter_grzip.c
archive_read_support_filter_lrzip.c
archive_read_support_filter_lz4.c
archive_read_support_filter_lzop.c
archive_read_support_filter_none.c
archive_read_support_filter_program.c
......@@ -87,6 +95,7 @@ SET(libarchive_SOURCES
archive_read_support_format_rar.c
archive_read_support_format_raw.c
archive_read_support_format_tar.c
archive_read_support_format_warc.c
archive_read_support_format_xar.c
archive_read_support_format_zip.c
archive_string.c
......@@ -113,6 +122,7 @@ SET(libarchive_SOURCES
archive_write_add_filter_grzip.c
archive_write_add_filter_gzip.c
archive_write_add_filter_lrzip.c
archive_write_add_filter_lz4.c
archive_write_add_filter_lzop.c
archive_write_add_filter_none.c
archive_write_add_filter_program.c
......@@ -124,6 +134,7 @@ SET(libarchive_SOURCES
archive_write_set_format_by_name.c
archive_write_set_format_cpio.c
archive_write_set_format_cpio_newc.c
archive_write_set_format_filter_by_ext.c
archive_write_set_format_gnutar.c
archive_write_set_format_iso9660.c
archive_write_set_format_mtree.c
......@@ -132,11 +143,15 @@ SET(libarchive_SOURCES
archive_write_set_format_shar.c
archive_write_set_format_ustar.c
archive_write_set_format_v7tar.c
archive_write_set_format_warc.c
archive_write_set_format_xar.c
archive_write_set_format_zip.c
archive_write_set_options.c
archive_write_set_passphrase.c
archive_xxhash.h
filter_fork_posix.c
filter_fork.h
xxhash.c
)
# Man pages
......@@ -149,12 +164,14 @@ SET(libarchive_MANS
archive_entry_stat.3
archive_entry_time.3
archive_read.3
archive_read_add_passphrase.3
archive_read_disk.3
archive_read_set_options.3
archive_util.3
archive_write.3
archive_write_disk.3
archive_write_set_options.3
archive_write_set_passphrase.3
cpio.5
libarchive.3
libarchive_internals.3
......@@ -179,6 +196,7 @@ SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION})
# archive_static is a static library
ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS})
TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS})
SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS
LIBARCHIVE_STATIC)
# On Posix systems, libarchive.so and libarchive.a can co-exist.
......@@ -186,12 +204,14 @@ IF(NOT WIN32 OR CYGWIN)
SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive)
ENDIF(NOT WIN32 OR CYGWIN)
# How to install the libraries
INSTALL(TARGETS archive archive_static
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
INSTALL_MAN(${libarchive_MANS})
INSTALL(FILES ${include_HEADERS} DESTINATION include)
IF(ENABLE_INSTALL)
# How to install the libraries
INSTALL(TARGETS archive archive_static
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
INSTALL_MAN(${libarchive_MANS})
INSTALL(FILES ${include_HEADERS} DESTINATION include)
ENDIF()
add_subdirectory(test)
......@@ -45,25 +45,44 @@
# include <inttypes.h>
#endif
/* Get appropriate definitions of standard POSIX-style types. */
/* These should match the types used in 'struct stat' */
#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
# define __LA_INT64_T __int64
# if defined(_SSIZE_T_DEFINED) || defined(_SSIZE_T_)
# define __LA_SSIZE_T ssize_t
# elif defined(_WIN64)
# define __LA_SSIZE_T __int64
# else
# define __LA_SSIZE_T long
/* Get appropriate definitions of 64-bit integer */
#if !defined(__LA_INT64_T_DEFINED)
/* Older code relied on the __LA_INT64_T macro; after 4.0 we'll switch to the typedef exclusively. */
# if ARCHIVE_VERSION_NUMBER < 4000000
#define __LA_INT64_T la_int64_t
# endif
#else
#define __LA_INT64_T_DEFINED
# if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
typedef __int64 la_int64_t;
# else
# include <unistd.h> /* ssize_t */
# if defined(_SCO_DS)
# define __LA_INT64_T long long
# if defined(_SCO_DS)
typedef long long la_int64_t;
# else
typedef int64_t la_int64_t;
# endif
# endif
#endif
/* The la_ssize_t should match the type used in 'struct stat' */
#if !defined(__LA_SSIZE_T_DEFINED)
/* Older code relied on the __LA_SSIZE_T macro; after 4.0 we'll switch to the typedef exclusively. */
# if ARCHIVE_VERSION_NUMBER < 4000000
#define __LA_SSIZE_T la_ssize_t
# endif
#define __LA_SSIZE_T_DEFINED
# if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
# if defined(_SSIZE_T_DEFINED) || defined(_SSIZE_T_)
typedef ssize_t la_ssize_t;
# elif defined(_WIN64)
typedef __int64 la_ssize_t;
# else
typedef long la_ssize_t;
# endif
# else
# define __LA_INT64_T int64_t
# include <unistd.h> /* ssize_t */
typedef ssize_t la_ssize_t;
# endif
# define __LA_SSIZE_T ssize_t
#endif
/*
......@@ -130,11 +149,16 @@ __LA_DECL int archive_version_number(void);
/*
* Textual name/version of the library, useful for version displays.
*/
#define ARCHIVE_VERSION_STRING "libarchive 3.1.2"
#define ARCHIVE_VERSION_ONLY_STRING "3.1.2"
#define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
__LA_DECL const char * archive_version_string(void);
/*
* Detailed textual name/version of the library and its dependencies.
* This has the form:
* "libarchive x.y.z zlib/a.b.c liblzma/d.e.f ... etc ..."
* the list of libraries described here will vary depending on how
* libarchive was compiled.
*/
__LA_DECL const char * archive_version_details(void);
......@@ -178,7 +202,7 @@ struct archive_entry;
*/
/* Returns pointer and size of next block of data from archive. */
typedef __LA_SSIZE_T archive_read_callback(struct archive *,
typedef la_ssize_t archive_read_callback(struct archive *,
void *_client_data, const void **_buffer);
/* Skips at most request bytes from archive and returns the skipped amount.
......@@ -186,18 +210,18 @@ typedef __LA_SSIZE_T archive_read_callback(struct archive *,
* If you do skip fewer bytes than requested, libarchive will invoke your
* read callback and discard data as necessary to make up the full skip.
*/
typedef __LA_INT64_T archive_skip_callback(struct archive *,
void *_client_data, __LA_INT64_T request);
typedef la_int64_t archive_skip_callback(struct archive *,
void *_client_data, la_int64_t request);
/* Seeks to specified location in the file and returns the position.
* Whence values are SEEK_SET, SEEK_CUR, SEEK_END from stdio.h.
* Return ARCHIVE_FATAL if the seek fails for any reason.
*/
typedef __LA_INT64_T archive_seek_callback(struct archive *,
void *_client_data, __LA_INT64_T offset, int whence);
typedef la_int64_t archive_seek_callback(struct archive *,
void *_client_data, la_int64_t offset, int whence);
/* Returns size actually written, zero on EOF, -1 on error. */
typedef __LA_SSIZE_T archive_write_callback(struct archive *,
typedef la_ssize_t archive_write_callback(struct archive *,
void *_client_data,
const void *_buffer, size_t _length);
......@@ -212,6 +236,13 @@ typedef int archive_close_callback(struct archive *, void *_client_data);
typedef int archive_switch_callback(struct archive *, void *_client_data1,
void *_client_data2);
/*
* Returns a passphrase used for encryption or decryption, NULL on nothing
* to do and give it up.
*/
typedef const char *archive_passphrase_callback(struct archive *,
void *_client_data);
/*
* Codes to identify various stream filters.
*/
......@@ -228,6 +259,7 @@ typedef int archive_switch_callback(struct archive *, void *_client_data1,
#define ARCHIVE_FILTER_LRZIP 10
#define ARCHIVE_FILTER_LZOP 11
#define ARCHIVE_FILTER_GRZIP 12
#define ARCHIVE_FILTER_LZ4 13
#if ARCHIVE_VERSION_NUMBER < 4000000
#define ARCHIVE_COMPRESSION_NONE ARCHIVE_FILTER_NONE
......@@ -289,6 +321,7 @@ typedef int archive_switch_callback(struct archive *, void *_client_data1,
#define ARCHIVE_FORMAT_CAB 0xC0000
#define ARCHIVE_FORMAT_RAR 0xD0000