From: Michihiro NAKAJIMA Date: Sat, 15 Dec 2012 23:01:37 +0000 (+0900) Subject: Fix build failure without zlib. X-Git-Tag: v3.1.0~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=213a263c4131887285814ccd968fc653778dbc48;p=thirdparty%2Flibarchive.git Fix build failure without zlib. --- diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c index 8fa39cb74..aaae72028 100644 --- a/libarchive/archive_write_disk_posix.c +++ b/libarchive/archive_write_disk_posix.c @@ -554,7 +554,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) else a->todo |= TODO_MAC_METADATA; } -#if defined(__APPLE__) && defined(UF_COMPRESSED) +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_ZLIB_H) if ((a->flags & ARCHIVE_EXTRACT_NO_HFS_COMPRESSION) == 0) { unsigned long set, clear; archive_entry_fflags(a->entry, &set, &clear); @@ -603,7 +603,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) ret = restore_entry(a); -#if defined(__APPLE__) && defined(UF_COMPRESSED) +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_ZLIB_H) /* * Check if the filesystem the file is restoring on supports * HFS+ Compression. If not, cancel HFS+ Compression. @@ -839,7 +839,8 @@ write_data_block(struct archive_write_disk *a, const char *buff, size_t size) return (start_size - size); } -#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H) +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\ + && defined(HAVE_ZLIB_H) /* * Set UF_COMPRESSED file flag. @@ -1507,7 +1508,7 @@ _archive_write_disk_finish_entry(struct archive *_a) } else if (a->fd_offset == a->filesize) { /* Last write ended at exactly the filesize; we're done. */ /* Hopefully, this is the common case. */ -#if defined(__APPLE__) && defined(UF_COMPRESSED) +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_ZLIB_H) } else if (a->todo & TODO_HFS_COMPRESSION) { char null_d[1024]; ssize_t r; diff --git a/libarchive/test/test_write_disk_appledouble.c b/libarchive/test/test_write_disk_appledouble.c index e9ec6cb49..d604fbf2d 100644 --- a/libarchive/test/test_write_disk_appledouble.c +++ b/libarchive/test/test_write_disk_appledouble.c @@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$"); #include #endif -#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H) +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\ + && defined(HAVE_ZLIB_H) static int has_xattr(const char *filename, const char *xattrname) { @@ -75,7 +76,8 @@ has_xattr(const char *filename, const char *xattrname) */ DEFINE_TEST(test_write_disk_appledouble) { -#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H) +#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)\ + || !defined(HAVE_ZLIB_H) skipping("MacOS-specific AppleDouble test"); #else const char *refname = "test_write_disk_appledouble.cpio.gz"; diff --git a/libarchive/test/test_write_disk_hfs_compression.c b/libarchive/test/test_write_disk_hfs_compression.c index dbb8a6fbc..24c13c4ed 100644 --- a/libarchive/test/test_write_disk_hfs_compression.c +++ b/libarchive/test/test_write_disk_hfs_compression.c @@ -30,7 +30,8 @@ __FBSDID("$FreeBSD$"); #include #endif -#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H) +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\ + && defined(HAVE_ZLIB_H) static int has_xattr(const char *filename, const char *xattrname) { @@ -87,7 +88,8 @@ get_rsrc_footer(const char *filename, char *buff, size_t s) */ DEFINE_TEST(test_write_disk_hfs_compression) { -#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H) +#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)\ + || !defined(HAVE_ZLIB_H) skipping("MacOS-specific HFS+ Compression test"); #else const char *refname = "test_write_disk_hfs_compression.tgz"; diff --git a/libarchive/test/test_write_disk_mac_metadata.c b/libarchive/test/test_write_disk_mac_metadata.c index aef6152ee..f9e47d659 100644 --- a/libarchive/test/test_write_disk_mac_metadata.c +++ b/libarchive/test/test_write_disk_mac_metadata.c @@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$"); #include #endif -#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H) +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\ + && defined(HAVE_ZLIB_H) static int has_xattr(const char *filename, const char *xattrname) { @@ -75,7 +76,8 @@ has_xattr(const char *filename, const char *xattrname) */ DEFINE_TEST(test_write_disk_mac_metadata) { -#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H) +#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)\ + || !defined(HAVE_ZLIB_H) skipping("MacOS-specific Mac Metadata test"); #else const char *refname = "test_write_disk_mac_metadata.tar.gz"; diff --git a/libarchive/test/test_write_disk_no_hfs_compression.c b/libarchive/test/test_write_disk_no_hfs_compression.c index 9c6d2c21a..a1afb9bb2 100644 --- a/libarchive/test/test_write_disk_no_hfs_compression.c +++ b/libarchive/test/test_write_disk_no_hfs_compression.c @@ -30,7 +30,8 @@ __FBSDID("$FreeBSD$"); #include #endif -#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H) +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\ + && defined(HAVE_ZLIB_H) static int has_xattr(const char *filename, const char *xattrname) { @@ -71,7 +72,8 @@ has_xattr(const char *filename, const char *xattrname) */ DEFINE_TEST(test_write_disk_no_hfs_compression) { -#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H) +#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)\ + || !defined(HAVE_ZLIB_H) skipping("MacOS-specific HFS+ Compression test"); #else const char *refname = "test_write_disk_no_hfs_compression.tgz";